/* ============================================
   YTDown Media Player Pro v3 - Premium Themes
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== DARK THEME (default) ===== */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a2e;
    --bg-card: rgba(26, 26, 46, 0.6);
    --bg-hover: rgba(139, 92, 246, 0.08);
    --bg-active: rgba(139, 92, 246, 0.15);
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-pink: #ec4899;
    --accent-cyan: #22d3ee;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --gradient-main: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(139, 92, 246, 0.4) 0%, rgba(236, 72, 153, 0.4) 100%);
    --glass-bg: rgba(18, 18, 26, 0.85);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
    --bg-primary: #f5f3ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #ede9fe;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-hover: rgba(139, 92, 246, 0.06);
    --bg-active: rgba(139, 92, 246, 0.12);
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent-primary: #7c3aed;
    --accent-secondary: #6d28d9;
    --accent-pink: #db2777;
    --accent-cyan: #0891b2;
    --accent-green: #059669;
    --accent-orange: #d97706;
    --gradient-main: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(219, 39, 119, 0.1) 100%);
    --gradient-glow: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(219, 39, 119, 0.2) 100%);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.06);
    --glass-border-hover: rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.1);
}

:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --sidebar-width: 280px;
    --player-height: 96px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    transition: background-color 0.3s, color 0.3s;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.4);
}

/* ===== LAYOUT ===== */
.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: 1fr var(--player-height);
    height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    grid-row: 1 / 3;
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
    transition: background 0.3s;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .title {
    font-size: 1.1rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text .subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-active);
    transform: rotate(20deg);
}

.sidebar-nav {
    padding: 8px 10px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--accent-primary);
}

.nav-item .icon {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--gradient-main);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.nav-item .fav-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.sidebar-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 16px;
}

.sidebar-section-title {
    padding: 10px 16px 4px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-action-btn {
    margin-left: auto;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-action-btn:first-of-type {
    margin-left: auto;
}

.sidebar-action-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.playlist-list {
    overflow-y: auto;
    padding: 0 10px 6px;
    max-height: 28vh;
}

.custom-playlist-list {
    max-height: 22vh;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
}

.playlist-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.playlist-item.active {
    background: var(--bg-active);
    color: var(--accent-primary);
}

.playlist-item .pl-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.playlist-item .pl-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-item .pl-count {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    background: var(--gradient-subtle);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--transition-normal);
}

.download-link:hover {
    background: var(--gradient-glow);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    overflow-y: auto;
    background: var(--bg-primary);
    position: relative;
    transition: background 0.3s;
}

.content-hero {
    position: relative;
    padding: 32px 40px 24px;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.12) 0%, transparent 100%);
}

.content-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse at 30% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
    position: relative;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    position: relative;
}

.search-container {
    position: relative;
    margin-top: 16px;
    max-width: 480px;
}

.search-container .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-normal);
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.stats-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    position: relative;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.stat-chip .stat-value {
    font-weight: 700;
    color: var(--accent-primary);
}

/* ===== TRACKS ===== */
.content-body {
    padding: 0 40px 120px;
}

.playlist-section {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .folder-icon {
    font-size: 1.1rem;
}

.section-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.play-all-btn,
.download-folder-btn,
.secondary-action-btn,
.danger-action-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 1px solid;
}

.play-all-btn {
    background: var(--gradient-subtle);
    border-color: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
}

.play-all-btn:hover {
    background: var(--gradient-glow);
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.download-folder-btn {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.download-folder-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
}

.secondary-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-border);
    color: var(--text-secondary);
}

.secondary-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.danger-action-btn {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.danger-action-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

.tracks-grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.track-row {
    display: grid;
    grid-template-columns: 32px 1fr 70px 80px;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.track-row:hover {
    background: var(--bg-hover);
}

.track-row.playing {
    background: var(--bg-active);
}

.track-row.playing .track-name {
    color: var(--accent-primary);
}

.track-index {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}

.track-row:hover .track-index .num,
.track-row.playing .track-index .num {
    display: none;
}

.track-row:hover .track-index .play-icon,
.track-row.playing .track-index .play-icon {
    display: block;
}

.track-index .play-icon {
    display: none;
    color: var(--accent-primary);
}

.track-row.playing .track-index .play-icon {
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.track-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.track-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 1px;
}

.track-type-badge.video {
    color: var(--accent-cyan);
}

.track-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.track-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.track-row:hover .track-actions {
    opacity: 1;
}

.action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.82rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ===== PLAYER BAR ===== */
.player-bar {
    grid-column: 2;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    display: grid;
    grid-template-columns: 260px 1fr 220px;
    align-items: center;
    padding: 0 16px;
    z-index: 20;
    position: relative;
    transition: background 0.3s;
}

.player-bar::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-main);
    opacity: 0.3;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.now-playing-art {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--gradient-subtle);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.now-playing-art.has-thumb {
    background-size: cover;
    background-position: center;
    font-size: 0;
}

.now-playing-art.playing::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    animation: art-pulse 2s ease-in-out infinite;
}

@keyframes art-pulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

.now-playing-info {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.now-playing-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-artist {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-muted);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fav-btn:hover {
    transform: scale(1.2);
}

.fav-btn.active {
    color: #f59e0b;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.controls-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctrl-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    font-size: 0.95rem;
}

.ctrl-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.ctrl-btn.active {
    color: var(--accent-primary);
}

.ctrl-btn.play-pause {
    width: 42px;
    height: 42px;
    background: var(--gradient-main);
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.ctrl-btn.play-pause:hover {
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.6);
    transform: scale(1.08);
}

.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 600px;
}

.time-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    min-width: 34px;
    text-align: center;
}

.seek-bar-container {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.seek-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
}

.seek-bar-fill {
    height: 100%;
    background: var(--gradient-main);
    border-radius: 2px;
    width: 0%;
    position: relative;
    transition: width 0.1s linear;
}

.seek-bar-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.seek-bar-container:hover .seek-bar-thumb {
    opacity: 1;
}

.seek-bar-container:hover .seek-bar-track {
    height: 6px;
}

.player-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.volume-btn {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.volume-btn:hover {
    color: var(--text-primary);
}

.volume-slider-container {
    width: 80px;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.volume-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.volume-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    width: 80%;
    position: relative;
}

.volume-thumb {
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.volume-slider-container:hover .volume-thumb {
    opacity: 1;
}

/* Equalizer mini animation */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 20px;
    padding: 0 4px;
}

.eq-bar {
    width: 3px;
    background: var(--accent-primary);
    border-radius: 1px;
    animation: eq-dance 0.6s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) {
    height: 30%;
    animation-delay: 0s;
}

.eq-bar:nth-child(2) {
    height: 60%;
    animation-delay: 0.1s;
}

.eq-bar:nth-child(3) {
    height: 90%;
    animation-delay: 0.2s;
}

.eq-bar:nth-child(4) {
    height: 50%;
    animation-delay: 0.15s;
}

.eq-bar:nth-child(5) {
    height: 70%;
    animation-delay: 0.05s;
}

@keyframes eq-dance {
    to {
        height: 100%;
    }
}

.equalizer.paused .eq-bar {
    animation-play-state: paused;
}

/* ===== VIDEO OVERLAY ===== */
.video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-overlay.active {
    display: flex;
}

.video-wrapper {
    position: relative;
    width: 90vw;
    max-width: 960px;
}

.video-wrapper video {
    width: 100%;
    border-radius: var(--radius-lg);
}

.video-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-full);
}

/* ===== VISUALIZER ===== */
.visualizer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 900;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.visualizer-overlay.active {
    display: flex;
}

#visualizerCanvas {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}

.vis-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: var(--radius-full);
    z-index: 10;
}

.vis-info {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.vis-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.vis-artist {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

/* ===== EQUALIZER PANEL ===== */
.eq-panel {
    position: fixed;
    bottom: var(--player-height);
    right: 20px;
    width: 340px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    display: none;
    animation: slide-up 0.25s ease-out;
}

.eq-panel.active {
    display: block;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eq-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--glass-border);
}

.eq-panel-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.eq-close {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eq-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.eq-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 18px;
}

.eq-preset {
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.eq-preset:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.eq-preset.active {
    background: var(--gradient-subtle);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-primary);
}

.eq-sliders {
    padding: 10px 18px;
}

.eq-slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.eq-slider-group label {
    font-size: 0.72rem;
    color: var(--text-muted);
    width: 45px;
    text-align: right;
}

.eq-range {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.eq-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

.eq-val {
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 35px;
    text-align: left;
}

.eq-extra {
    padding: 8px 18px 16px;
    border-top: 1px solid var(--glass-border);
    margin-top: 4px;
}

.eq-extra label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 6px;
}

.eq-extra #crossfadeVal {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== LYRICS PANEL ===== */
.lyrics-panel {
    position: fixed;
    bottom: var(--player-height);
    right: 380px;
    width: 360px;
    max-height: 50vh;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 500;
    display: none;
    animation: slide-up 0.25s ease-out;
    overflow: hidden;
}

.lyrics-panel.active {
    display: block;
}

.lyrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--glass-border);
}

.lyrics-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.lyrics-close {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lyrics-body {
    padding: 16px 20px;
    max-height: 40vh;
    overflow-y: auto;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.lyrics-placeholder {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 30px 0;
}

.lyrics-loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* ===== EMPTY / SKELETON ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-track {
    height: 48px;
    margin-bottom: 6px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    box-shadow: var(--shadow-md);
    animation: toast-in 0.3s ease-out;
}

.toast.success {
    border-left: 3px solid var(--accent-green);
}

.toast.error {
    border-left: 3px solid #ef4444;
}

.toast.info {
    border-left: 3px solid var(--accent-cyan);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 440px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: modal-in 0.25s ease-out;
    overflow: hidden;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-full);
    font-size: 1rem;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-body {
    padding: 18px 22px 22px;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.modal-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.modal-message {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
}

.modal-cancel {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-confirm {
    background: var(--gradient-main);
    color: white;
}

.modal-confirm:hover {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.modal-danger {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.modal-danger:hover {
    background: #ef4444;
}

.modal-new-pl-btn {
    width: 100%;
    padding: 10px;
    background: var(--gradient-subtle);
    border: 1px dashed rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    color: var(--accent-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-normal);
}

.modal-new-pl-btn:hover {
    background: var(--gradient-glow);
    border-color: rgba(139, 92, 246, 0.5);
}

.modal-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 0;
}

.modal-playlist-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-playlist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all var(--transition-fast);
}

.modal-playlist-item:hover {
    background: var(--bg-hover);
    border-color: rgba(139, 92, 246, 0.2);
}

.modal-pl-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-pl-count {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Folder selector in modal */
.modal-folder-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.modal-folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    color: var(--text-primary);
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.modal-folder-item:hover {
    background: var(--bg-hover);
}

/* ===== CONTEXT MENU ===== */
.context-menu {
    position: fixed;
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-md);
    padding: 5px;
    z-index: 3000;
    min-width: 190px;
    max-width: 280px;
    box-shadow: var(--shadow-lg);
    animation: ctx-in 0.15s ease-out;
}

@keyframes ctx-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ctx-item {
    display: block;
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.ctx-item:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

.ctx-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 3px 8px;
}

/* ===== STATS VIEW ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    text-align: center;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.top-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top-track-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
}

.top-track-rank {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-primary);
    width: 28px;
    text-align: center;
}

.top-track-name {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-track-plays {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        display: none;
    }

    .player-bar {
        grid-template-columns: 1fr 1fr;
    }

    .player-extras {
        display: none;
    }

    .content-hero,
    .content-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .section-actions {
        flex-wrap: wrap;
    }

    .eq-panel,
    .lyrics-panel {
        right: 10px;
        left: 10px;
        width: auto;
    }
}