:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;

    /* Accent Colors */
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-tertiary: #c4b5fd;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f97316 100%);
    --accent-gradient-hover: linear-gradient(135deg, #a78bfa 0%, #f472b6 50%, #fb923c 100%);

    /* YouTube Red */
    --youtube-red: #ff0033;
    --youtube-red-hover: #cc0029;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);

    /* Status Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.2);
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.2);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.2);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.2);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* === Reset & Base === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Animated Background === */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
    top: 50%;
    right: -15%;
    animation-delay: -7s;
    animation-duration: 25s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.3) 0%, transparent 70%);
    bottom: -10%;
    left: 30%;
    animation-delay: -14s;
    animation-duration: 22s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -30px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 50px) scale(0.95);
    }

    75% {
        transform: translate(-40px, -20px) scale(1.05);
    }
}

/* === Container === */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Glass Card === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    transition: all var(--transition-base);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
}

/* === Header === */
.header {
    text-align: center;
    padding: var(--spacing-2xl) 0;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    animation: pulse-glow 3s ease-in-out infinite;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
    }

    50% {
        box-shadow: 0 8px 40px rgba(139, 92, 246, 0.6);
    }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

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

.tagline-sub {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-weight: 400;
    margin-top: var(--spacing-xs);
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

/* === Input Section === */
.input-section {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.6s ease-out 0.1s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-wrapper {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    transition: all var(--transition-base);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.input-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.input-icon svg {
    width: 22px;
    height: 22px;
    color: var(--text-tertiary);
    transition: color var(--transition-base);
}

.input-wrapper:focus-within .input-icon svg {
    color: var(--accent-primary);
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    padding: var(--spacing-md) 0;
    font-family: inherit;
}

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

.input-hint {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.input-hint svg {
    width: 16px;
    height: 16px;
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-download {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    font-size: 1.1rem;
    padding: var(--spacing-lg) var(--spacing-2xl);
}

.btn-download svg {
    width: 22px;
    height: 22px;
}

.btn-download:hover:not(:disabled) {
    background: #0ea371;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

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

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

/* Button Loader */
.btn-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* === Error Message === */
.error-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--error-light);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    color: var(--error);
    animation: shake 0.5s ease-in-out;
}

.error-message svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* === Hidden Utility === */
.hidden {
    display: none !important;
}

/* === Playlist Info Section === */
.playlist-info {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.6s ease-out both;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.playlist-details h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    line-height: 1.3;
}

.channel-name {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
}

.playlist-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat svg {
    width: 18px;
    height: 18px;
    color: var(--accent-secondary);
}

/* === Format Selector === */
.format-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.format-selector label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.format-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.format-btn svg {
    width: 18px;
    height: 18px;
}

.format-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.format-btn.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* === Quality Selector === */
.quality-selector {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.quality-selector label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quality-buttons {
    display: flex;
}

.quality-options {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.quality-options.hidden {
    display: none;
}

.quality-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    min-width: 48px;
    text-align: center;
}

.quality-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--glass-border);
}

.quality-btn.active {
    background: var(--success);
    color: white;
    border-color: var(--success);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

/* 4K/High quality badge */
.quality-btn[data-quality="320"],
.quality-btn[data-quality="2160"] {
    position: relative;
}

.quality-btn[data-quality="320"]::after,
.quality-btn[data-quality="2160"]::after {
    content: '★';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    color: var(--warning);
}

/* === Advanced Options Panel === */
.advanced-options {
    margin-bottom: var(--spacing-lg);
}

.toggle-options-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.toggle-options-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.toggle-options-btn svg {
    width: 18px;
    height: 18px;
}

.toggle-options-btn svg:first-child {
    color: var(--accent-secondary);
}

.toggle-options-btn .chevron {
    margin-left: auto;
    transition: transform var(--transition-base);
}

.toggle-options-btn.active .chevron {
    transform: rotate(180deg);
}

.options-content {
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    animation: slideDown 0.3s ease-out;
}

.options-content.hidden {
    display: none;
}

.option-group {
    margin-bottom: var(--spacing-md);
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group>label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.option-group>label svg {
    width: 16px;
    height: 16px;
    color: var(--accent-secondary);
}

.template-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
}

.template-select:hover,
.template-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.template-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Checkbox with icon in options */
.option-group .checkbox-wrapper svg {
    width: 16px;
    height: 16px;
    color: var(--accent-secondary);
}

/* === Selection Bar === */
.selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.selection-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

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

.estimated-size {
    font-size: 0.85rem;
    color: var(--accent-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Custom Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.checkbox-wrapper input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    background: var(--bg-tertiary);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    position: relative;
}

.checkmark::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    transition: all var(--transition-base);
}

.checkbox-wrapper input:checked+.checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-wrapper input:checked+.checkmark::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

.checkbox-wrapper:hover .checkmark {
    border-color: var(--accent-secondary);
}

/* === Song List === */
.song-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

/* Custom Scrollbar */
.song-list::-webkit-scrollbar {
    width: 8px;
}

.song-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.song-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

.song-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* === Song Item === */
.song-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-base);
    cursor: pointer;
}

.song-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border);
}

.song-item.selected {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.song-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.song-thumbnail {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.song-channel {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.song-checkbox {
    flex-shrink: 0;
}

/* === Download Section === */
.download-section {
    display: flex;
    justify-content: center;
}

/* === Download Progress Section === */
.download-progress {
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    animation: slideUp 0.4s ease-out both;
}

.progress-header {
    margin-bottom: var(--spacing-xl);
}

.progress-header h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
}

.progress-header h3 svg {
    width: 24px;
    height: 24px;
    color: var(--success);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.overall-progress {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

#progressText {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* === Real-time Statistics Panel === */
.stats-panel {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
}

.stat-card {
    flex: 1 1 calc(25% - var(--spacing-sm));
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stat-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.speed-icon {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.1) 100%);
    color: #f97316;
}

.stat-icon.time-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
    color: #3b82f6;
}

.stat-icon.eta-icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: #8b5cf6;
    animation: pulse-opacity 2s ease-in-out infinite;
}

.stat-icon.active-icon {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #10b981;
}

@keyframes pulse-opacity {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Speed value animation */
.stat-value.updating {
    animation: value-update 0.3s ease;
}

@keyframes value-update {
    0% {
        opacity: 0.5;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments for stats panel */
@media (max-width: 768px) {
    .stat-card {
        flex: 1 1 calc(50% - var(--spacing-sm));
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex: 1 1 100%;
        min-width: 100%;
        padding: var(--spacing-sm);
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-label {
        font-size: 0.65rem;
    }

    .stat-value {
        font-size: 0.85rem;
    }
}

/* === Download Item with Speed === */
.download-item-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.download-item-speed {
    color: var(--accent-secondary);
    font-weight: 500;
}

.download-item-eta {
    color: var(--text-muted);
}

/* === Download List === */
.download-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
    padding-right: var(--spacing-sm);
}

.download-list::-webkit-scrollbar {
    width: 8px;
}

.download-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
}

.download-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

/* === Download Item === */
.download-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.download-item.downloading {
    border-left: 3px solid var(--info);
}

.download-item.completed {
    border-left: 3px solid var(--success);
}

.download-item.error {
    border-left: 3px solid var(--error);
}

.download-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.download-item.downloading .download-item-icon {
    background: var(--info-light);
    color: var(--info);
}

.download-item.completed .download-item-icon {
    background: var(--success-light);
    color: var(--success);
}

.download-item.error .download-item-icon {
    background: var(--error-light);
    color: var(--error);
}

.download-item-icon svg {
    width: 20px;
    height: 20px;
}

.download-item-icon .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: var(--info);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.download-item-info {
    flex: 1;
    min-width: 0;
}

.download-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-item-status {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.download-item-progress {
    width: 60px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
}

.download-item-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--info);
    border-radius: var(--radius-full);
    transition: width var(--transition-fast);
}

/* === Completed Section === */
.completed-section {
    padding: var(--spacing-2xl);
    text-align: center;
    animation: scaleIn 0.5s var(--transition-bounce) both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.completed-icon {
    width: 80px;
    height: 80px;
    background: var(--success-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    animation: checkmark 0.5s ease-out 0.2s both;
}

.completed-icon svg {
    width: 40px;
    height: 40px;
    color: var(--success);
}

@keyframes checkmark {
    from {
        transform: scale(0) rotate(-45deg);
    }

    to {
        transform: scale(1) rotate(0deg);
    }
}

.completed-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.completed-section p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xl);
}

/* === File List === */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: var(--spacing-xl);
    text-align: left;
}

/* ZIP Download Button */
.zip-btn {
    width: 100%;
    margin-bottom: var(--spacing-lg);
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

.zip-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.file-item svg {
    width: 20px;
    height: 20px;
    color: var(--success);
    flex-shrink: 0;
}

.file-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.file-item-download {
    color: var(--accent-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* === Completed Actions === */
.completed-actions {
    display: flex;
    justify-content: center;
}

/* === Footer === */
.footer {
    margin-top: auto;
    padding-top: var(--spacing-2xl);
    text-align: center;
}

.footer p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .container {
        padding: var(--spacing-lg);
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .logo-icon {
        width: 44px;
        height: 44px;
    }

    .logo-icon svg {
        width: 22px;
        height: 22px;
    }

    .input-wrapper {
        flex-direction: column;
        padding: var(--spacing-md);
    }

    .input-icon {
        display: none;
    }

    .btn-primary {
        width: 100%;
    }

    .playlist-header {
        flex-direction: column;
    }

    .format-buttons {
        width: 100%;
    }

    .format-btn {
        flex: 1;
        justify-content: center;
    }

    .selection-bar {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .song-item {
        padding: var(--spacing-sm);
    }

    .song-thumbnail {
        width: 44px;
        height: 44px;
    }

    .song-number {
        display: none;
    }

    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: var(--spacing-md);
    }

    .glass-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }

    .input-section {
        padding: var(--spacing-md);
    }

    .playlist-info {
        padding: var(--spacing-md);
    }

    .playlist-details h2 {
        font-size: 1.25rem;
    }

    .song-duration {
        display: none;
    }

    .completed-section {
        padding: var(--spacing-xl);
    }

    .completed-icon {
        width: 60px;
        height: 60px;
    }

    .completed-icon svg {
        width: 30px;
        height: 30px;
    }

    .completed-section h3 {
        font-size: 1.25rem;
    }
}

/* === Animations for Song Items (staggered) === */
.song-item {
    animation: fadeInUp 0.4s ease-out both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply staggered delay via JS by adding --animation-order custom property */
.song-item:nth-child(1) {
    animation-delay: 0.05s;
}

.song-item:nth-child(2) {
    animation-delay: 0.1s;
}

.song-item:nth-child(3) {
    animation-delay: 0.15s;
}

.song-item:nth-child(4) {
    animation-delay: 0.2s;
}

.song-item:nth-child(5) {
    animation-delay: 0.25s;
}

.song-item:nth-child(6) {
    animation-delay: 0.3s;
}

.song-item:nth-child(7) {
    animation-delay: 0.35s;
}

.song-item:nth-child(8) {
    animation-delay: 0.4s;
}

.song-item:nth-child(9) {
    animation-delay: 0.45s;
}

.song-item:nth-child(10) {
    animation-delay: 0.5s;
}

/* === Focus States for Accessibility === */
button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* === Selection === */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: white;
}

/* === Features Section === */
.features-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
    animation: slideUp 0.6s ease-out 0.2s both;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

.speed-feature {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.1) 100%);
    color: #f97316;
}

.quality-feature {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.2) 0%, rgba(202, 138, 4, 0.1) 100%);
    color: #eab308;
}

.free-feature {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: #10b981;
}

.metadata-feature {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(124, 58, 237, 0.1) 100%);
    color: #8b5cf6;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

@media (max-width: 900px) {
    .features-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .features-section {
        grid-template-columns: 1fr;
    }
}

/* === How it Works Section === */
.how-it-works {
    margin-bottom: var(--spacing-2xl);
    animation: slideUp 0.6s ease-out 0.3s both;
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
}

.steps-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    max-width: 200px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.step-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.step-content p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    line-height: 1.4;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-tertiary));
    margin-bottom: 60px;
    opacity: 0.5;
}

@media (max-width: 700px) {
    .steps-container {
        flex-direction: column;
    }

    .step-connector {
        width: 2px;
        height: 30px;
        margin-bottom: 0;
    }

    .step {
        max-width: none;
    }
}

/* === Input Title === */
.input-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

/* === Footer === */
.footer {
    margin-top: auto;
    padding-top: var(--spacing-2xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-2xl);
    padding: var(--spacing-xl);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-lg);
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.footer-logo svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
}

.footer-logo span {
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.footer-stats {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-stat svg {
    width: 18px;
    height: 18px;
    color: var(--accent-secondary);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.footer-content:hover {
    opacity: 1;
}

.footer-content i {
    font-size: 0.65rem;
    color: var(--accent-secondary);
    animation: heartbeat 2s infinite ease-in-out;
}

.footer-link {
    text-decoration: none;
    color: var(--accent-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.footer-disclaimer {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
}

@media (max-width: 700px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-brand {
        max-width: none;
    }

    .footer-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
}