/* Video Downloader Styles - Similar to downtik.to */

/* CSS Custom Properties for Theming */
:root {
    /* Dark Theme (YouTube & TikTok inspired) */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #212121;
    --bg-card: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #717171;
    --accent-primary: #ff0050; /* TikTok pink accent */
    --accent-secondary: #ff1744;
    --accent-hover: #ff4569;
    --youtube-red: #ff0000; /* YouTube red for specific elements */
    --tiktok-cyan: #25f4ee; /* TikTok cyan for highlights */
    --border-color: #303030;
    --success-color: #00d4aa;
    --warning-color: #ffb300;
    --error-color: #ff1744;
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f1f1f1;
    --bg-card: #ffffff;
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --text-muted: #909090;
    --accent-primary: #ff0050; /* TikTok pink accent */
    --accent-secondary: #ff1744;
    --accent-hover: #ff4569;
    --youtube-red: #ff0000; /* YouTube red for specific elements */
    --tiktok-cyan: #25f4ee; /* TikTok cyan for highlights */
    --border-color: #e0e0e0;
    --success-color: #00d4aa;
    --warning-color: #ffb300;
    --error-color: #ff1744;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: scale(1.05);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Main Content */
.main {
    flex: 1;
    padding: 40px 0;
}

/* Input Section */
.input-section {
    margin-bottom: 40px;
}

.input-container {
    max-width: 600px;
    margin: 0 auto;
}

.download-form {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 12px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 8px;
    box-shadow: var(--shadow);
    transition: border-color 0.3s ease;
}

.input-group:focus-within {
    border-color: var(--accent-primary);
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 16px 20px;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.url-input::placeholder {
    color: var(--text-muted);
}

.download-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.download-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Platform Info */
.platform-info {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

/* Removed .platform-badge; replaced with compact preview */
.compact-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    max-width: 600px;
    width: 100%;
}

.compact-thumbnail {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.compact-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compact-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.compact-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.compact-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Format Selection */
.format-section {
    margin-bottom: 40px;
}

.format-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.format-container h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-weight: 600;
}

.format-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 4px;
}

.format-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-tab.active {
    background: var(--accent-primary);
    color: white;
}

/* New List-Style Format Selectors */
.format-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-list-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.format-list-item .format-radio,
.format-list-item .format-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.format-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.format-label:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.format-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.format-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.2;
}

.format-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.format-checkmark {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.format-checkmark.checkbox-mark {
    border-radius: 6px;
}

/* Selected State */
.format-list-item.selected .format-label {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.format-list-item.selected .format-title {
    color: white;
}

.format-list-item.selected .format-description {
    color: rgba(255, 255, 255, 0.9);
}

.format-list-item.selected .format-checkmark {
    background: white;
    border-color: white;
    color: var(--accent-primary);
    transform: scale(1.1);
}

/* Special styling for merge audio option */
.merge-audio-item .format-label {
    background: linear-gradient(135deg, var(--success-color), #059669);
    border-color: var(--success-color);
}

.merge-audio-item .format-title,
.merge-audio-item .format-description {
    color: white;
}

.merge-audio-item .format-checkmark {
    background: white;
    border-color: white;
    color: var(--success-color);
}

.merge-audio-item:not(.selected) .format-label {
    background: var(--bg-tertiary);
    border-color: var(--success-color);
}

.merge-audio-item:not(.selected) .format-title {
    color: var(--text-primary);
}

.merge-audio-item:not(.selected) .format-description {
    color: var(--text-secondary);
}

.merge-audio-item:not(.selected) .format-checkmark {
    background: var(--bg-secondary);
    border-color: var(--success-color);
    color: transparent;
}

.merge-audio-item:not(.selected) .format-label:hover {
    background: var(--bg-secondary);
    border-color: var(--success-color);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

/* Animation for selection */
@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.format-list-item.selected {
    animation: selectPulse 0.3s ease-out;
}

/* Legacy quality options (fallback) */
.quality-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quality-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quality-option:hover {
    border-color: var(--accent-primary);
}

.quality-option input[type="radio"] {
    margin-right: 12px;
    accent-color: var(--accent-primary);
}

.quality-label {
    font-weight: 500;
    color: var(--text-primary);
}

.quality-size {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.audio-merge-option {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.checkbox-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 12px;
    accent-color: var(--accent-primary);
}

/* Video Preview */
.preview-section {
    margin-bottom: 40px;
}

.video-preview {
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 20px;
}

.preview-thumbnail {
    position: relative;
    width: 160px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.preview-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-overlay {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.preview-info {
    flex: 1;
}

.context-download-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.context-download-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Download Queue */
.queue-section {
    margin-bottom: 40px;
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.queue-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.queue-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.download-queue {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-queue {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Download Item */
.download-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.download-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.download-info {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.download-thumbnail {
    width: 80px;
    height: 45px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.download-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-details {
    flex: 1;
}

.download-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
    line-height: 1.3;
}

.download-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.download-progress {
    margin-bottom: 16px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progress-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-percentage {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-btn {
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.action-btn.secondary:hover {
    background: var(--bg-secondary);
}

.expiry-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--warning-color);
}

/* Footer (BEM) */
.footer {
    border-top: 1px solid var(--border-color);
    padding: clamp(20px, 3vw, 32px) 0; /* responsive spacing */
    margin-top: auto;
    background: var(--bg-card);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    flex-wrap: wrap;
}

.footer__brand {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer__social {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
}

.footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; /* a11y touch target min width */
    height: 48px; /* a11y touch target min height */
    border-radius: 10px;
    text-decoration: none;
    outline: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.footer__icon {
    width: 32px; /* base icon size */
    height: 32px;
    color: var(--text-primary);
}

/* Hover and focus interactions */
.footer__social-link:hover,
.footer__social-link:focus {
    transform: scale(1.1); /* 10% scale transform */
    background-color: var(--accent-tertiary, rgba(0,0,0,0.05));
    box-shadow: var(--shadow);
}

.footer__social-link--youtube:hover .footer__icon,
.footer__social-link--youtube:focus .footer__icon {
    color: #ff0000; /* YouTube brand color */
}

.footer__social-link--tiktok:hover .footer__icon,
.footer__social-link--tiktok:focus .footer__icon {
    color: #000000; /* TikTok primary black; secondary accent handled by theme */
}

/* High-DPI scaling considerations: keep vectors crisp; icons use currentColor */
@media (min-resolution: 2dppx) {
    .footer__icon { transform: translateZ(0); }
}

/* Responsive alignment adjustments to prevent layout gaps */
@media (max-width: 768px) {
    .footer__content {
        flex-direction: column;
        text-align: center;
    }
    .footer__social { justify-content: center; }
}

/* Documentation: 
   - Icons are bare SVGs from Font Awesome Free (brand family), sized to 32x32px base.
   - Touch targets set to 48x48px per WCAG 2.1 AA.
   - Hover: 0.2s color and scale transitions with easing.
   - Focus states mirror hover for keyboard accessibility.
   - BEM naming: .footer, .footer__content, .footer__brand, .footer__social, .footer__social-link, modifiers per platform.
*/

.retention-notice {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.supported-platforms {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.platform-icons {
    display: flex;
    gap: 8px;
}

.platform-icon {
    font-size: 1.2rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .download-btn {
        width: 100%;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-thumbnail {
        width: 100%;
        height: 200px;
        margin: 0 auto;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .queue-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .download-info {
        flex-direction: column;
        text-align: center;
    }
    
    .download-thumbnail {
        width: 100%;
        height: 120px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 20px 0;
    }
    
    .format-container {
        padding: 16px;
    }
    
    .quality-option {
        padding: 12px 16px;
    }
    
    .download-item {
        padding: 16px;
    }
}
.site-header {
    padding: 16px 0 8px;
}
.header-content {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.site-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.site-header .logo img {
    height: 28px;
    width: auto;
    display: block;
}
.theme-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}
.subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    text-align: left;
    margin: 24px auto 8px;
    max-width: 600px;
    color: var(--text-secondary);
}
.input-section { margin-bottom: 20px; }
.platform-row { margin-top: 8px; }
.queue-section { margin-top: 18px; }
.queue-section h2 { font-size: 0.9rem; font-weight: 600; }
.download-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-btn {
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.expiry-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--warning-color);
}

/* Footer (BEM) */
.footer {
    border-top: 1px solid var(--border-color);
    padding: clamp(20px, 3vw, 32px) 0; /* responsive spacing */
    margin-top: auto;
    background: var(--bg-card);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    flex-wrap: wrap;
}

.footer__brand {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer__social {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
}

.footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; /* a11y touch target min width */
    height: 48px; /* a11y touch target min height */
    border-radius: 10px;
    text-decoration: none;
    outline: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.footer__icon {
    width: 32px; /* base icon size */
    height: 32px;
    color: var(--text-primary);
}

/* Hover and focus interactions */
.footer__social-link:hover,
.footer__social-link:focus {
    transform: scale(1.1); /* 10% scale transform */
    background-color: var(--accent-tertiary, rgba(0,0,0,0.05));
    box-shadow: var(--shadow);
}

.footer__social-link--youtube:hover .footer__icon,
.footer__social-link--youtube:focus .footer__icon {
    color: #ff0000; /* YouTube brand color */
}

.footer__social-link--tiktok:hover .footer__icon,
.footer__social-link--tiktok:focus .footer__icon {
    color: #000000; /* TikTok primary black; secondary accent handled by theme */
}

/* High-DPI scaling considerations: keep vectors crisp; icons use currentColor */
@media (min-resolution: 2dppx) {
    .footer__icon { transform: translateZ(0); }
}

/* Responsive alignment adjustments to prevent layout gaps */
@media (max-width: 768px) {
    .footer__content {
        flex-direction: column;
        text-align: center;
    }
    .footer__social { justify-content: center; }
}

/* Documentation: 
   - Icons are bare SVGs from Font Awesome Free (brand family), sized to 32x32px base.
   - Touch targets set to 48x48px per WCAG 2.1 AA.
   - Hover: 0.2s color and scale transitions with easing.
   - Focus states mirror hover for keyboard accessibility.
   - BEM naming: .footer, .footer__content, .footer__brand, .footer__social, .footer__social-link, modifiers per platform.
*/

.retention-notice {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.supported-platforms {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.platform-icons {
    display: flex;
    gap: 8px;
}

.platform-icon {
    font-size: 1.2rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .download-btn {
        width: 100%;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-thumbnail {
        width: 100%;
        height: 200px;
        margin: 0 auto;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .queue-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .download-info {
        flex-direction: column;
        text-align: center;
    }
    
    .download-thumbnail {
        width: 100%;
        height: 120px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 20px 0;
    }
    
    .format-container {
        padding: 16px;
    }
    
    .quality-option {
        padding: 12px 16px;
    }
    
    .download-item {
        padding: 16px;
    }
}
.site-header .container { min-height: auto; display: block; padding-top: 8px; padding-bottom: 0; }
.header-content {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.site-header .logo {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}
.theme-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}
.subtitle {
    font-size: 0.75rem;
    font-weight: 400;
    text-align: left;
    margin: 24px auto 8px;
    max-width: 600px;
    color: var(--text-secondary);
}
.input-section { margin-bottom: 20px; }
.platform-row { margin-top: 8px; }
.queue-section { margin-top: 18px; }
.queue-section h2 { font-size: 0.9rem; font-weight: 600; }
.download-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-btn {
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.expiry-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--warning-color);
}

/* Footer (BEM) */
.footer {
    border-top: 1px solid var(--border-color);
    padding: clamp(20px, 3vw, 32px) 0; /* responsive spacing */
    margin-top: auto;
    background: var(--bg-card);
}

.footer__content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    flex-wrap: wrap;
}

.footer__brand {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.footer__social {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2vw, 20px);
}

.footer__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; /* a11y touch target min width */
    height: 48px; /* a11y touch target min height */
    border-radius: 10px;
    text-decoration: none;
    outline: none;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.footer__icon {
    width: 32px; /* base icon size */
    height: 32px;
    color: var(--text-primary);
}

/* Hover and focus interactions */
.footer__social-link:hover,
.footer__social-link:focus {
    transform: scale(1.1); /* 10% scale transform */
    background-color: var(--accent-tertiary, rgba(0,0,0,0.05));
    box-shadow: var(--shadow);
}

.footer__social-link--youtube:hover .footer__icon,
.footer__social-link--youtube:focus .footer__icon {
    color: #ff0000; /* YouTube brand color */
}

.footer__social-link--tiktok:hover .footer__icon,
.footer__social-link--tiktok:focus .footer__icon {
    color: #000000; /* TikTok primary black; secondary accent handled by theme */
}

/* High-DPI scaling considerations: keep vectors crisp; icons use currentColor */
@media (min-resolution: 2dppx) {
    .footer__icon { transform: translateZ(0); }
}

/* Responsive alignment adjustments to prevent layout gaps */
@media (max-width: 768px) {
    .footer__content {
        flex-direction: column;
        text-align: center;
    }
    .footer__social { justify-content: center; }
}

/* Documentation: 
   - Icons are bare SVGs from Font Awesome Free (brand family), sized to 32x32px base.
   - Touch targets set to 48x48px per WCAG 2.1 AA.
   - Hover: 0.2s color and scale transitions with easing.
   - Focus states mirror hover for keyboard accessibility.
   - BEM naming: .footer, .footer__content, .footer__brand, .footer__social, .footer__social-link, modifiers per platform.
*/

.retention-notice {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.supported-platforms {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.platform-icons {
    display: flex;
    gap: 8px;
}

.platform-icon {
    font-size: 1.2rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .download-btn {
        width: 100%;
    }
    
    .video-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .preview-thumbnail {
        width: 100%;
        height: 200px;
        margin: 0 auto;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .queue-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .download-info {
        flex-direction: column;
        text-align: center;
    }
    
    .download-thumbnail {
        width: 100%;
        height: 120px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 20px 0;
    }
    
    .format-container {
        padding: 16px;
    }
    
    .quality-option {
        padding: 12px 16px;
    }
    
    .download-item {
        padding: 16px;
    }
}

/* Topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: var(--shadow);
}
.topbar__nav { display: flex; gap: 16px; }
.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 8px;
    text-decoration: none;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* Hero */
.hero { text-align: center; padding: 24px 0; }
.hero__title { font-size: 2rem; font-weight: 700; margin: 8px 0; }
.hero__subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* Input form width */
.input-section .download-form { max-width: 920px; margin: 0 auto; }

/* Info card section */
.info-card-section { margin-top: 24px; display: flex; justify-content: center; }
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 900px;
    box-shadow: var(--shadow);
}
.info-card h3 { font-size: 0.95rem; margin-bottom: 12px; }
.info-card p, .info-card li { font-size: 0.85rem; color: var(--text-secondary); }
.info-card ul { margin: 12px 0 0 18px; }

/* Features grid */
.features { padding: 40px 0 24px; }
.section-label { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 8px; }
.features__title { text-align: center; font-size: 1.3rem; font-weight: 700; margin-bottom: 16px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; max-width: 1000px; margin: 0 auto; }
.feature-card {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.feature-number {
    display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
    align-items: center; justify-content: center;
    background: var(--accent-primary);
    color: #fff; font-weight: 600; font-size: 0.9rem;
}
.feature-text { color: var(--text-secondary); font-size: 0.9rem; }

/* Responsive adjustments for features */
@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .feature-grid { grid-template-columns: 1fr; } }

/* Footer polish overrides */
.footer { padding: clamp(12px, 2vw, 20px) 0; background: transparent; }
.footer__content { justify-content: center; gap: 12px 20px; }
.footer__brand { color: var(--text-muted); font-size: 0.9rem; }
.footer__social { gap: 12px; }
.footer__social-link { width: auto; height: auto; background: transparent; border: none; padding: 0; }
.footer__icon { width: 22px; height: 22px; opacity: 0.8; }
.footer__social-link:hover, .footer__social-link:focus { transform: none; box-shadow: none; background-color: transparent; opacity: 1; }

/* Platform-specific styling enhancements */
.partner-list svg {
    transition: all 0.3s ease;
}

.partner-list svg:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* YouTube-specific elements */
.platform-youtube .download-btn,
.platform-youtube .context-download-btn {
    background: linear-gradient(135deg, var(--youtube-red), #cc0000);
}

.platform-youtube .download-btn:hover,
.platform-youtube .context-download-btn:hover {
    background: linear-gradient(135deg, #cc0000, var(--youtube-red));
}

/* TikTok-specific elements */
.platform-tiktok .download-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.platform-tiktok .download-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
}

/* Platform indicators in download queue */
.download-platform.youtube {
    background: var(--youtube-red);
    color: white;
}

.download-platform.tiktok {
    background: var(--accent-primary);
    color: white;
}

/* Enhanced navigation for dual platform focus */
.nav-link:first-child {
    color: var(--youtube-red);
}

.nav-link:last-child {
    color: var(--accent-primary);
}

.nav-link:hover {
    opacity: 0.8;
}

/* Reduce space before footer */
.info-card-section { margin-bottom: 8px; }
.features { margin-bottom: 8px; }

/* Utility Classes */
.text-center {
    text-align: center;
}