/**
 * YouTube Downloader Styles
 */

.youtube-downloader-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    color: white;
    margin: 2rem 0;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.youtube-downloader-container h3 {
    margin-top: 0;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.youtube-downloader-container p {
    margin-bottom: 1.5rem;
    opacity: 0.95;
    line-height: 1.6;
}

#youtube-downloader-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.youtube-url-input-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#youtube-url {
    flex: 1;
    min-width: 250px;
    padding: 0.75rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

#youtube-url::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#youtube-url:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

#youtube-url.valid {
    border-color: #4ade80;
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.3);
}

#youtube-url.invalid {
    border-color: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

#youtube-download-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    min-width: 150px;
}

#youtube-download-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

#youtube-download-btn:active:not(:disabled) {
    transform: translateY(0);
}

#youtube-download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#youtube-progress-container {
    display: none;
    margin-top: 1.5rem;
}

.youtube-progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.youtube-progress-info strong {
    opacity: 0.9;
}

.youtube-progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#youtube-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
}

#youtube-progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

/* Download Progress Bar - Separate Style */
#youtube-download-progress-container {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.youtube-progress-bar-bg.download-progress-bar {
    height: 12px;
    background: rgba(102, 126, 234, 0.3);
    border: 2px solid rgba(102, 126, 234, 0.6);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

#youtube-download-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.8);
    position: relative;
    overflow: hidden;
}

#youtube-download-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: shimmer 1.5s infinite;
}

#youtube-download-progress-text {
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

#youtube-download-status-message {
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    line-height: 1.4;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

#youtube-status-message {
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    word-break: break-word;
    line-height: 1.4;
}

.status-message.success {
    background: rgba(74, 222, 128, 0.2);
    color: #dcfce7;
    border: 1px solid rgba(74, 222, 128, 0.5);
    font-weight: 600;
    animation: success-pulse 0.6s ease-out;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fee2e2;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.status-message.warning {
    background: rgba(250, 204, 21, 0.2);
    color: #fef3c7;
    border: 1px solid rgba(250, 204, 21, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .youtube-downloader-container {
        padding: 1.5rem;
    }

    .youtube-url-input-group {
        flex-direction: column;
    }

    #youtube-url {
        width: 100%;
        min-width: auto;
    }

    #youtube-download-btn {
        width: 100%;
    }
}

/* RTL Support */
[dir="rtl"] .youtube-downloader-container {
    direction: rtl;
}

[dir="rtl"] #youtube-downloader-form {
    direction: rtl;
}

[dir="rtl"] .youtube-progress-info {
    flex-direction: row-reverse;
}

/* Animation for loading state */
@keyframes loading-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes success-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-pulse {
    animation: loading-pulse 1.5s ease-in-out infinite;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
}

#youtube-status-message.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.2);
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(102, 126, 234, 0.5);
}
