/* CSS Variables */
:root {
    /* Spotify 2024 Color Palette */
    --bg-base: #000000;
    --bg-primary: #121212;
    --bg-elevated: #1A1A1A;
    --bg-highlight: #282828;
    --bg-press: #3E3E3E;
    --bg-subtle: rgba(255, 255, 255, 0.05);

    /* Spotify Green - 2024 Brighter */
    --spotify-green: #1ED760;
    --primary: #1ED760;
    --primary-hover: #1FDF64;
    --primary-active: #169C46;

    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #B3B3B3;
    --text-subdued: #6A6A6A;
    --text-muted: #535353;
    --border: rgba(255, 255, 255, 0.1);

    /* Semantic Colors */
    --error: #E91429;
    --warning: #FFA42B;
    --success: #1ED760;
    --info: #3291FF;

    /* Layout Dimensions */
    --sidebar-width: 232px;
    --player-height: 96px;
    --header-height: 64px;

    /* Smoother transitions */
    --transition-fast: 0.1s ease;
    --transition: 0.2s cubic-bezier(0.3, 0, 0.4, 1);
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Z-Index System */
    --z-below: -1;
    --z-normal: 1;
    --z-sticky: 10;
    --z-fixed: 100;
    --z-sidebar: 200;
    --z-player: 100;
    --z-modal: 1000;
    --z-tooltip: 2000;

    /* Spacing System (8px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Legacy aliases (for backward compatibility) */
    --space-xs: var(--space-1);
    --space-sm: var(--space-2);
    --space-xm: var(--space-3);
    --space-md: var(--space-4);
    --space-lg: var(--space-6);
    --space-xl: var(--space-8);
    --space-xxl: var(--space-12);

    /* Typography System */
    --font-xs: 11px;
    --font-sm: 12px;
    --font-base: 14px;
    --font-md: 16px;
    --font-lg: 18px;
    --font-xl: 24px;
    --font-2xl: 32px;
    --font-3xl: 48px;

    /* Font Weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 900;

    /* Line Heights */
    --lh-tight: 1.2;
    --lh-base: 1.5;
    --lh-relaxed: 1.6;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-full: 500px;
    --radius: var(--radius-sm);
    /* default */
    --radius-pill: var(--radius-full);

    /* Effects */
    --blur: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
}

/* Hardware Acceleration Class */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

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

/* Base */
html,
body {
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-base);
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    line-height: var(--lh-base);
    font-size: var(--font-base);
    font-weight: var(--fw-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Enable font feature settings for better Inter rendering */
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Global Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

input[type="text"],
input[type="search"] {
    background: var(--bg-highlight);
    /* Lighter than body */
    border: 0;
    color: var(--text-primary);
    font: inherit;
    font-size: var(--font-sm);
    padding: 12px 20px;
    /* More padding */
    border-radius: 500px;
    outline: none;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="search"]:focus {
    background: #333;
    /* Even lighter on focus */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    /* Focus ring */
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    /* Rounded pill shape */
    border: 2px solid transparent;
    /* Gap around thumb */
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Helper Class for "Button Pressure" effect */
.btn-press:active {
    transform: scale(0.96);
    opacity: 0.8;
}

/* App Layout */
#app {
    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-color: var(--bg-base);
    padding: var(--space-6) var(--space-2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    width: var(--sidebar-width);
    z-index: var(--z-sidebar);
}

.sidebar-header {
    padding: 0 12px 24px;
}

.sidebar-close {
    display: none;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 4px;
    margin-bottom: 8px;
}

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

.sidebar-logo span {
    font-size: var(--font-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* More breathing room between main items */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: var(--fw-bold);
    font-size: var(--font-base);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-subtle);
}

.nav-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.14);
}

.nav-link svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    /* Inherit color change */
}

/* Specific styling for Liked Songs to match "Your Library" vibe */
.liked-songs-link {
    margin-top: 24px;
    opacity: 0.8;
}

.liked-songs-link:hover {
    opacity: 1;
}

.liked-songs-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #4F46E5, #06B6D4);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.liked-songs-icon svg {
    width: 12px;
    /* Smaller icon inside the box */
    height: 12px;
    fill: white;
}

.sidebar-divider {
    height: 1px;
    background: var(--bg-highlight);
    margin: 16px 12px;
    /* Separator line */
    opacity: 0.5;
}

.sidebar-section {
    flex: 1;
    /* Take remaining space */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* For scrolling playlists */
}

.sidebar-section h3 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.sidebar-playlists {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    /* Scrollable playlists */
    flex: 1;
    margin-right: -10px;
    /* Hide scrollbar visually but keep function */
    padding-right: 10px;
}

/* Custom scrollbar for playlists */
.sidebar-playlists::-webkit-scrollbar {
    width: 8px;
}

.sidebar-playlists::-webkit-scrollbar-thumb {
    background: transparent;
    /* Hidden by default */
}

.sidebar-playlists:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    /* Visible on hover */
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color var(--transition-fast);
    cursor: default;
    /* Spotify playlists are links but feel like list items */
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: none;
}

/* Main Content Area */
.main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
    position: relative;
    background: linear-gradient(180deg, rgba(42, 42, 42, 0.6) 0%, var(--bg-primary) 340px);
}

.header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-8);
    background: rgba(0, 0, 0, 0);
    transition: all var(--transition-smooth);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    height: var(--header-height);
}

/* Header becomes solid on scroll*/
.header.scrolled {
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.menu-toggle {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.header-nav {
    display: flex;
    gap: var(--space-2);
}

.nav-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 50%;
    transition: all var(--transition);
    cursor: pointer;
}

.nav-btn:hover {
    transform: scale(1.04);
    background: rgba(0, 0, 0, 0.95);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--text-primary);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px 32px;
    /* Adjusted top padding */
    isolation: isolate;
    /* Create new stacking context */
}

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

.section-title {
    font-size: var(--font-xl);
    font-weight: 700;
    margin-bottom: 24px;
    /* Increased from 20px */
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.section-title:hover {
    text-decoration: underline;
    cursor: pointer;
}

/* Song/Card Grid Shared Styles */
.song-grid,
.artist-grid,
.album-grid,
.playlists-grid,
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    /* Optimizing for slightly wider cards */
    gap: var(--space-lg);
}

/* Base Card Style */
.song-card,
.artist-card,
.album-card,
.playlist-card {
    background-color: var(--bg-elevated);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    isolation: isolate;
    will-change: transform, box-shadow;
}

.song-card:hover,
.artist-card:hover,
.album-card:hover,
.playlist-card:hover {
    background-color: var(--bg-highlight);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Card Images */
.song-card-image,
.artist-card-image,
.album-card-image,
.playlist-card-image {
    position: relative;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    background-color: var(--bg-highlight);
    box-shadow: var(--shadow-sm);
}

.artist-card-image {
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.song-card-image img,
.artist-card-image img,
.album-card-image img,
.playlist-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Play Button Overlay (The iconic Green Button) */
.play-overlay {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

.play-overlay svg {
    width: 24px;
    height: 24px;
    fill: #000;
    margin-left: 2px;
}

/* Hover Effects logic */
.song-card:hover .play-overlay,
.album-card:hover .play-overlay,
.playlist-card:hover .play-overlay {
    opacity: 1;
    transform: translateY(0);
}

.play-overlay:hover {
    transform: scale(1.06) translateY(0);
    background-color: var(--primary-hover);
}

/* Card Text */
.song-card-title,
.album-card-title,
.artist-card-name,
.playlist-title {
    font-size: var(--font-md);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-1);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: var(--lh-tight);
}

.song-card-artist,
.album-card-artist,
.artist-card-type,
.album-card-year {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: var(--space-1);
    font-weight: var(--fw-regular);
    line-height: var(--lh-base);
}

.song-card-artist:hover,
.album-card-artist:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

/* Download Button (Specific to this app, keep it subtle) */
.download-song-card {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition);
    color: var(--text-primary);
}

.song-card:hover .download-song-card {
    opacity: 1;
}

.download-song-card:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.08);
}

/* Placeholder Cover */
.placeholder-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-highlight);
}

.placeholder-cover svg {
    width: 48px;
    height: 48px;
    fill: #7f7f7f;
}

.placeholder-cover.lg svg {
    width: 80px;
    height: 80px;
}

/* Song Table */
.song-table {
    display: flex;
    flex-direction: column;
}

.song-table-header {
    display: grid;
    grid-template-columns: 50px 1fr 200px 100px;
    gap: var(--space-md);
    padding: 8px 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

.song-table-header svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.song-row {
    display: grid;
    grid-template-columns: 50px 1fr 200px 100px 50px;
    gap: var(--space-md);
    padding: 8px 16px;
    align-items: center;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.song-row:hover {
    background: var(--bg-elevated);
}

.song-row-index {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.song-row:hover .index-number {
    display: none;
}

.index-play {
    display: none;
}

.song-row:hover .index-play {
    display: block;
}

.index-play svg {
    width: 18px;
    height: 18px;
    fill: var(--text-primary);
}

.song-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.song-row-main img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.song-row-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.song-row-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row-artist {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row-artist .artist-link,
.song-card-artist .artist-link,
.song-list-artist .artist-link,
.artist-link {
    cursor: pointer;
    transition: color 0.15s ease, text-decoration 0.15s ease;
}

.song-row-artist .artist-link:hover,
.song-card-artist .artist-link:hover,
.song-list-artist .artist-link:hover,
.artist-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.song-row-album {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-row-album:hover {
    text-decoration: underline;
    color: var(--text-primary);
}

.song-row-duration {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.song-row-actions {
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.song-row:hover .song-row-actions {
    opacity: 1;
}

/* Page Headers */
.artist-header,
.album-header,
.playlist-header {
    display: flex;
    align-items: flex-end;
    gap: var(--space-lg);
    padding: 40px 0;
    min-height: 280px;
}

.artist-header {
    background-size: cover;
    background-position: center;
    margin: -32px -32px 0;
    padding: 100px 32px 24px;
}

.artist-image,
.album-cover,
.playlist-cover {
    width: 232px;
    height: 232px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.artist-image {
    border-radius: 50%;
}

.artist-info,
.album-info,
.playlist-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.artist-name,
.album-title,
.playlist-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
}

.album-meta,
.playlist-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.album-artist {
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.album-artist:hover {
    text-decoration: underline;
}

.dot {
    margin: 0 4px;
}

/* Action Buttons */
.artist-actions,
.album-actions,
.playlist-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 24px 0;
}

.btn-play-large {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-play-large:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.btn-play-large svg {
    width: 28px;
    height: 28px;
    fill: var(--bg-primary);
    margin-left: 3px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: 500px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    padding: 12px 24px;
    border: 1px solid var(--text-secondary);
    border-radius: 500px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
}

/* Search Page */
.search-page {
    padding-top: 16px;
}

.search-header {
    margin-bottom: 32px;
}

.search-input-container {
    position: relative;
    max-width: 400px;
}

.search-input-container input {
    padding-left: 52px;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

.search-input {
    width: 100%;
    padding: 14px 48px;
    background: var(--bg-elevated);
    border-radius: 500px;
    font-size: var(--font-sm);
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: var(--transition);
}

.clear-search.visible {
    opacity: 1;
}

.clear-search svg {
    width: 20px;
    height: 20px;
    fill: var(--text-muted);
}

/* Genre Cards */
.browse-content h2 {
    margin-bottom: 20px;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-md);
}

.genre-card {
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    padding: var(--space-md);
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    transition: var(--transition);
}

.genre-card:hover {
    transform: scale(1.02);
}

/* Song List (Search Results) */
.song-list {
    display: flex;
    flex-direction: column;
}

.song-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.song-list-item:hover {
    background: var(--bg-elevated);
}

.song-index {
    width: 24px;
    text-align: center;
    color: var(--text-muted);
}

.song-list-item img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.song-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.song-list-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-list-artist {
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.song-list-play {
    opacity: 0;
    transition: var(--transition);
}

.song-list-item:hover .song-list-play {
    opacity: 1;
}

.song-list-play svg {
    width: 20px;
    height: 20px;
    fill: var(--text-primary);
}

/* Fix: Add styles for song list download button */
.song-list-download {
    opacity: 0;
    transition: var(--transition);
}

.song-list-item:hover .song-list-download {
    opacity: 1;
}

.song-list-download svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

.song-list-download:hover svg {
    fill: var(--text-primary);
}

/* Top Result Card */
.top-result-card {
    position: relative;
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    max-width: 400px;
}

.top-result-card:hover {
    background: var(--bg-highlight);
}

.top-result-card img {
    width: 92px;
    height: 92px;
    border-radius: var(--radius);
    margin-bottom: var(--space-md);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.top-result-card h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.top-result-card p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.result-type {
    display: inline-block;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 500px;
    font-size: 12px;
    text-transform: uppercase;
}

.btn-play-large.top-result-card .play-overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

/* Library Page */
.library-page {
    padding-top: 16px;
}

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

.library-header h1 {
    font-size: 32px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Loading */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-elevated);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 60px auto;
}

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

/* Skeleton Loading */
.skeleton {
    pointer-events: none;
}

.skeleton-image {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-highlight) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-highlight) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Error State */
.error-message,
.error-page {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.error-icon {
    width: 48px;
    height: 48px;
    fill: var(--text-muted);
    margin: 0 auto 16px;
}

.retry-btn {
    margin-top: 16px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    width: 64px;
    height: 64px;
    fill: var(--text-muted);
    margin: 0 auto 16px;
}

.no-results h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
}

.modal {
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal h2 {
    margin-bottom: 20px;
}

.modal input[type="text"] {
    width: 100%;
    margin-bottom: 20px;
}

.modal .btns {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.song-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.song-preview img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
}

.btn-create-new,
.full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

/* Fullscreen Login Modal Overlay with Blur */
#login-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
    border-radius: 0;
    transform: none;
    /* Reset transform from generic modal if any */
}

#login-modal.open {
    opacity: 1;
    visibility: visible;
}

/* Modal Content Box */
#login-modal .modal-content {
    background: var(--bg-elevated);
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

#login-modal.open .modal-content {
    transform: scale(1);
    opacity: 1;
}


.pl-list {
    max-height: 200px;
    overflow-y: auto;
}

.pl-opt {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pl-opt:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.close-modal svg {
    width: 24px;
    height: 24px;
    fill: var(--text-muted);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: calc(var(--player-height) + 24px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--primary);
    color: var(--bg-primary);
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1001;
}

.notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification.error {
    background: var(--error);
    color: white;
}

.notification.warning {
    background: var(--warning);
    color: var(--bg-primary);
}

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--error);
    color: white;
    padding: 8px 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    z-index: 1002;
}

.offline-banner svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-sm);
    color: var(--primary);
    margin-bottom: 8px;
}

.verified-badge svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

/* Scroll Horizontal */
.scroll-horizontal {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
}

.scroll-horizontal::-webkit-scrollbar {
    display: none;
}

.scroll-horizontal .album-card {
    min-width: 180px;
    flex-shrink: 0;
}

/* ========== NEW FEATURES STYLES ========== */

/* Player Extras (Queue, Share buttons) */
.player-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* Quality Selector */
.quality-selector {
    position: relative;
    display: flex;
    align-items: center;
}

.quality-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 140px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 100;
}

.quality-selector.open .quality-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    border-radius: 4px;
    transition: var(--transition);
}

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

.quality-option.active {
    color: var(--primary);
    background: rgba(29, 185, 84, 0.1);
}

.quality-badge {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-muted);
}

.quality-option:hover .quality-badge {
    background: var(--bg-primary);
}

.quality-badge.low {
    color: var(--warning);
}

/* Like Button */
.like-btn {
    margin-left: 12px;
}

.like-btn.active {
    color: var(--primary);
}

.like-btn.active svg {
    fill: var(--primary);
}

/* Queue Button Active */
#queue-btn.active {
    color: var(--primary);
}

/* Queue Panel */
.queue-panel {
    position: fixed;
    right: -380px;
    top: 0;
    bottom: var(--player-height);
    width: 380px;
    background: var(--bg-secondary);
    z-index: 90;
    /* Lower than sidebar (100) to prevent overlap conflicts */
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.queue-panel.open {
    right: 0;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.queue-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.queue-section {
    padding: 16px 20px;
}

.queue-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Queue Panel Container */
.queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 580px;
    /* Increased from 320px */
    max-width: 100vw;
    background: var(--bg-elevated);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.queue-panel.open {
    transform: translateX(0);
}

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

.queue-header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.close-queue {
    color: var(--text-secondary);
}

.close-queue:hover {
    color: var(--text-primary);
}

.queue-section {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Important for nested scroll */
}

.queue-section h4 {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 16px;
    /* Increased gap */
    padding: 10px;
    /* Better padding */
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.queue-item:hover {
    background: var(--bg-elevated);
}

.queue-item.current {
    background: var(--bg-elevated);
    border: 1px solid var(--primary);
    /* Highlight current song better */
}

.queue-index {
    width: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.queue-item img {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
}

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

.queue-item-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-artist {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item .remove-queue {
    opacity: 0;
    transition: opacity 0.2s;
}

.queue-item:hover .remove-queue {
    opacity: 1;
}

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

.clear-queue {
    margin: 16px 20px;
}

/* Favorites Page */
.favorites-page {
    padding-top: 0;
}

.favorites-header {
    display: flex;
    align-items: flex-end;
    gap: var(--space-lg);
    padding: 60px 0 24px;
    background: linear-gradient(transparent 0, rgba(80, 56, 160, 0.5) 100%);
    margin: -32px -32px 0;
    padding-left: 32px;
    padding-right: 32px;
    min-height: 300px;
}

.favorites-icon {
    width: 232px;
    height: 232px;
    background: linear-gradient(135deg, #450af5, #8e8ee5);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
}

.favorites-icon svg {
    width: 92px;
    height: 92px;
    fill: white;
}

.favorites-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.favorites-info span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.favorites-info h1 {
    font-size: 72px;
    font-weight: 900;
    line-height: 1;
}

.favorites-info p {
    color: var(--text-secondary);
}

.favorites-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 24px 0;
}

.remove-favorite {
    color: var(--primary) !important;
}

/* Improved Notifications */
.notification {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-elevated);
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.notification.success {
    border-left-color: var(--primary);
}

.notification.error {
    background: var(--bg-elevated);
    border-left-color: var(--error);
    color: var(--text-primary);
}

.notification.warning {
    background: var(--bg-elevated);
    border-left-color: var(--warning);
    color: var(--text-primary);
}

.notification-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--text-muted);
    transition: color 0.2s;
}

.notification-close:hover {
    color: var(--text-primary);
}

.notification-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Seek Feedback Overlay */
.seek-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 1000;
}

.seek-feedback.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.seek-feedback svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Liked Songs Link in Sidebar */
.liked-songs-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 600;
    transition: var(--transition);
    margin: 0 0 8px;
}

.liked-songs-link:hover {
    color: var(--text-primary);
}

.liked-songs-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #450af5, #8e8ee5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.liked-songs-icon svg {
    width: 14px;
    height: 14px;
    fill: white;
}

.btn-shuffle {
    color: var(--text-secondary);
}

.btn-shuffle:hover {
    color: var(--primary);
}

/* Audio Quality Selector */
.quality-selector {
    position: relative;
}

#quality-btn {
    font-size: 11px;
    font-weight: 700;
    min-width: 36px;
    border: 1px solid var(--text-muted);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text-secondary);
}

#quality-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.quality-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background: var(--bg-elevated);
    border-radius: var(--radius);
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.quality-selector.open .quality-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quality-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 16px;
    text-align: left;
    color: var(--text-secondary);
    transition: var(--transition);
}

.quality-option:hover {
    background: var(--bg-highlight);
    color: var(--text-primary);
}

.quality-option.active {
    color: var(--primary);
}

.quality-option.active::before {
    content: '✓';
    margin-right: 8px;
}

.quality-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary);
    color: var(--bg-primary);
    font-weight: 600;
}

.quality-badge.low {
    background: var(--text-muted);
}

/* Section Icon (for Made For You) */
.section-icon {
    width: 24px;
    height: 24px;
    fill: var(--primary);
    vertical-align: middle;
    margin-right: 8px;
}

/* ========== SPOTIFY-STYLE UI ========== */

/* Greeting Header */
.greeting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 24px;
}

.greeting-text {
    font-size: var(--font-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.greeting-actions {
    display: flex;
    gap: var(--space-md);
}

.greeting-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: var(--transition);
}

.greeting-btn:hover {
    color: var(--text-secondary);
}

.greeting-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Horizontal Scroll Row (Spotify-style) */
.scroll-section {
    margin-bottom: 32px;
}

.scroll-section .section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--space-md);
    padding-right: 16px;
}

.scroll-row {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scroll-row::-webkit-scrollbar {
    display: none;
}

/* Spotify-style Cards */
.spotify-card {
    flex-shrink: 0;
    width: 140px;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: var(--transition);
    scroll-snap-align: start;
}

.spotify-card:hover {
    background: var(--bg-elevated);
}

.spotify-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--bg-elevated);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.spotify-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotify-card-image.artist {
    border-radius: 50%;
}

.spotify-card .play-overlay {
    width: 40px;
    height: 40px;
    bottom: 6px;
    right: 6px;
}

.spotify-card .play-overlay svg {
    width: 20px;
    height: 20px;
}

.spotify-card-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.spotify-card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Radio badge overlay (Spotify-style) */
.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.card-badge svg {
    width: 12px;
    height: 12px;
    fill: var(--primary);
}

/* Bottom Navigation Bar (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(180deg, rgba(18, 18, 18, 0.95) 0%, #121212 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 56px;
    max-width: 500px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--text-primary);
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 600;
}

/* Home page layout */
.home-page {
    padding-bottom: 20px;
}

/* ========== FULL-SCREEN NOW PLAYING ========== */

/* ========== FULL-SCREEN NOW PLAYING ========== */

.fullscreen-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0, 0.2, 1);
    visibility: visible;
    /* Always visible for transform to work, moved off-screen */
    display: flex;
    /* Flexbox for centering */
    align-items: center;
    justify-content: center;
}

.fullscreen-player.open {
    transform: translateY(0);
}

.fullscreen-player-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #121212 0%, #000000 100%);
    z-index: 0;
    transition: background 1s ease;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.fullscreen-player-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    height: 100dvh;
    /* Dynamic viewport height */
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    gap: 0;
    /* Remove gap, use explicit margins */
}

/* Header */
.fullscreen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 8px 0;
}

.fullscreen-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    transform: scale(1.05);
}

.fullscreen-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.fullscreen-title {
    text-align: center;
    opacity: 0.8;
}

.fullscreen-title span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
}

/* Album Art - The Hero */
.fullscreen-artwork {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 32px;
    min-height: 0;
}

.fullscreen-artwork img {
    width: 100%;
    max-width: min(340px, 65vw, 55vh);
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6),
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: albumArtFadeIn 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    transform-origin: center center;
}

@keyframes albumArtFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

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

/* Song Info */
.fullscreen-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
    animation: infoFadeIn 0.4s 0.15s cubic-bezier(0.25, 0.8, 0.25, 1) backwards;
}

@keyframes infoFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.fullscreen-song-details {
    width: 100%;
    max-width: 100%;
}

.fullscreen-song-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.fullscreen-song-artist {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fullscreen-song-artist .fs-artist-link {
    cursor: pointer;
    transition: color 0.2s, text-decoration 0.2s;
}

.fullscreen-song-artist .fs-artist-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.fullscreen-song-album {
    font-size: var(--font-sm);
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    cursor: pointer;
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fullscreen-song-album:hover {
    color: white;
    text-decoration: underline;
}

.fullscreen-like-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.fullscreen-like-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
    background: none;
}

.fullscreen-like-btn.active {
    color: var(--primary);
}

.fullscreen-like-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Progress Bar (Immersive) */
.fullscreen-progress {
    margin-bottom: 32px;
}

.fullscreen-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    padding: 10px 0;
    margin: -10px 0;
    background-clip: content-box;
    transition: height 0.2s ease;
}

.fullscreen-progress-fill {
    height: 6px;
    background: var(--text-primary);
    border-radius: 3px;
    width: 0%;
    position: absolute;
    top: 10px;
    left: 0;
    pointer-events: none;
    transition: background 0.2s ease;
}

.fullscreen-progress-fill::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.fullscreen-progress-bar:hover .fullscreen-progress-fill::after {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.fullscreen-progress-bar:hover .fullscreen-progress-fill {
    background: var(--primary);
}

.fullscreen-progress-bar:hover .fullscreen-progress-fill::after {
    opacity: 1;
}

.fullscreen-time {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
}

.fullscreen-time span {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
}

/* Main Controls */
.fullscreen-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    margin-bottom: 32px;
}

.fullscreen-control-btn {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fullscreen-control-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.08);
}

.fullscreen-control-btn:active {
    transform: scale(0.95);
}

.fullscreen-control-btn.active {
    color: var(--primary);
    position: relative;
}

/* Dot indicator for active shuffle/repeat */
.fullscreen-control-btn.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

.fullscreen-control-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.fullscreen-control-lg svg {
    width: 36px;
    height: 36px;
}

.fullscreen-play-btn {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.fullscreen-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.fullscreen-play-btn:active {
    transform: scale(0.98);
}

.fullscreen-play-btn svg {
    width: 32px;
    height: 32px;
    fill: #000;
    margin-left: 4px;
}

/* Extra Controls (Volume/Device) */
.fullscreen-extras {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Align right */
    gap: var(--space-md);
    padding: 0 12px;
}

.fullscreen-volume {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    max-width: 240px;
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 20px;
    border-radius: 50px;
    transition: background 0.2s;
}

.fullscreen-volume:hover {
    background: rgba(255, 255, 255, 0.1);
}

.fullscreen-volume svg {
    width: 20px;
    height: 20px;
    fill: var(--text-secondary);
}

/* Fullscreen Volume Slider */
.fullscreen-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: transparent;
    cursor: pointer;
    border-radius: 2px;
}

.fullscreen-volume-slider:focus {
    outline: none;
}

/* Chrome/Safari/Edge */
.fullscreen-volume-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: linear-gradient(to right, #b3b3b3 var(--volume-percent, 50%), #535353 var(--volume-percent, 50%));
    border-radius: 2px;
}

.fullscreen-volume-slider:hover::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #1DB954 var(--volume-percent, 50%), #535353 var(--volume-percent, 50%));
}

.fullscreen-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -4px;
    /* (4px track - 12px thumb) / 2 */
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.fullscreen-volume-slider:hover::-webkit-slider-thumb,
.fullscreen-volume:hover .fullscreen-volume-slider::-webkit-slider-thumb {
    opacity: 1;
}

/* Firefox */
.fullscreen-volume-slider::-moz-range-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #535353;
    border-radius: 2px;
}

.fullscreen-volume-slider::-moz-range-progress {
    background-color: #b3b3b3;
    height: 4px;
    border-radius: 2px;
}

.fullscreen-volume-slider:hover::-moz-range-progress {
    background-color: #1DB954;
}

.fullscreen-volume-slider::-moz-range-thumb {
    height: 12px;
    width: 12px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.fullscreen-volume-slider:hover::-moz-range-thumb,
.fullscreen-volume:hover .fullscreen-volume-slider::-moz-range-thumb {
    opacity: 1;
}


/* Mobile Responsive */
@media (max-width: 768px) {
    .fullscreen-player-content {
        padding: 20px;
        justify-content: flex-start;
    }

    .fullscreen-header {
        margin-bottom: 20px;
    }

    .fullscreen-artwork {
        margin: 16px 0 24px;
        max-height: 50vh;
    }

    .fullscreen-artwork img {
        max-width: min(300px, 85vw);
        border-radius: 12px;
    }

    .fullscreen-song-title {
        font-size: 26px;
    }

    .fullscreen-song-artist {
        font-size: var(--font-md);
    }

    .fullscreen-song-album {
        font-size: 13px;
    }

    .fullscreen-info {
        margin-bottom: 20px;
    }

    .fullscreen-progress {
        margin-bottom: 24px;
    }

    /* Always show progress thumb on mobile for better touch */
    .fullscreen-progress-fill::after {
        opacity: 1;
    }

    .fullscreen-controls {
        gap: 20px;
        margin-bottom: 24px;
    }

    .fullscreen-control-btn {
        width: 48px;
        height: 48px;
    }

    .fullscreen-control-btn svg {
        width: 24px;
        height: 24px;
    }

    .fullscreen-play-btn {
        width: 64px;
        height: 64px;
    }

    .fullscreen-play-btn svg {
        width: 28px;
        height: 28px;
    }



    /* Volume Section - Enhanced for Mobile */
    .fullscreen-volume {
        display: flex;
        width: auto;
        max-width: 80%;
        margin: 0 auto 16px;
        padding: 0;
        background: transparent;
        border-radius: 0;
        height: 44px;
        align-items: center;
    }

    .fullscreen-volume svg {
        width: 24px;
        height: 24px;
        opacity: 0.9;
    }

    .fullscreen-volume-slider {
        height: 6px;
    }

    .fullscreen-volume-slider::-webkit-slider-runnable-track {
        height: 6px;
    }

    .fullscreen-volume-slider::-webkit-slider-thumb {
        height: 16px;
        width: 16px;
        margin-top: -5px;
        opacity: 1;
    }

    .fullscreen-volume-slider::-moz-range-track {
        height: 6px;
    }

    .fullscreen-volume-slider::-moz-range-thumb {
        height: 16px;
        width: 16px;
        opacity: 1;
    }
}

.fullscreen-volume-slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 8px;
}

.fullscreen-volume-slider {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
}

/* Track Fill Simulation (using gradient if supported, otherwise simple bg) */
.fullscreen-volume-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
}

.fullscreen-volume-slider::-webkit-slider-thumb {
    width: 20px;
    /* Larger touch target */
    height: 20px;
    margin-top: -7px;
    /* Center on 6px track: (6 - 20) / 2 */
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

/* Extras Row (Queue, Share, etc.) */
.fullscreen-extras {
    display: flex !important;
    /* Force visible */
    width: 100%;
    justify-content: space-between;
    padding: 0 16px;
    gap: 0;
    margin-bottom: 24px;
    /* Space from bottom edge */
    margin-top: 0;
    /* Volume handles the push */
}

.fullscreen-quality-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
    padding: 2px 4px;
    border-radius: 4px;
}

/* ========== FULLSCREEN LYRICS PANEL ========== */

.fullscreen-lyrics-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fullscreen-lyrics-panel.open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.fullscreen-lyrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fullscreen-lyrics-header h3 {
    font-size: 18px;
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.lyrics-source-badge {
    font-size: 10px;
    padding: 4px 8px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fullscreen-lyrics-content {
    flex: 1;
    overflow-y: auto;
    font-size: var(--font-md);
    line-height: 2;
    color: var(--text-secondary);
    scroll-behavior: smooth;
    padding-right: 8px;
}

.fullscreen-lyrics-content .lyric-line {
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 4px;
}

.fullscreen-lyrics-content .lyric-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

.fullscreen-lyrics-content .lyric-line.active {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    background: rgba(29, 185, 84, 0.15);
    border-left: 4px solid var(--primary);
    padding-left: 8px;
}

.fullscreen-lyrics-content .lyric-line.previous {
    opacity: 0.5;
}

.fullscreen-lyrics-content .lyrics-loading,
.fullscreen-lyrics-content .lyrics-empty,
.fullscreen-lyrics-content .lyrics-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.fullscreen-lyrics-content .lyrics-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-md);
}

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

.fullscreen-lyrics-content .lyrics-error svg,
.fullscreen-lyrics-content .lyrics-empty svg {
    opacity: 0.3;
    margin-bottom: var(--space-md);
}

.fullscreen-lyrics-content::-webkit-scrollbar {
    width: 6px;
}

.fullscreen-lyrics-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.fullscreen-lyrics-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Mobile adjustments for lyrics panel */
@media (max-width: 768px) {
    .fullscreen-lyrics-panel {
        width: 95%;
        max-height: 65vh;
        padding: 20px;
    }

    .fullscreen-lyrics-content {
        font-size: var(--font-sm);
    }

    .fullscreen-lyrics-content .lyric-line.active {
        font-size: var(--font-md);
    }
}

/* Mobile Quality Modal */
.fullscreen-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(4px);
}

.fullscreen-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.fullscreen-modal-content {
    background: #1e1e1e;
    border-radius: 16px 16px 0 0;
    padding: 24px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.fullscreen-modal-overlay.open .fullscreen-modal-content {
    transform: translateY(0);
}

.fullscreen-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    font-size: 18px;
}

.quality-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.quality-option-mobile {
    background: #2a2a2a;
    border: 1px solid transparent;
    padding: var(--space-md);
    border-radius: 12px;
    color: white;
    font-size: var(--font-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-option-mobile.active {
    background: #1DB954;
    color: white;
    font-weight: bold;
}

.quality-option-mobile span {
    font-size: 12px;
    opacity: 0.7;
}

.modal-close-btn {
    width: 100%;
    padding: var(--space-md);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--font-md);
    font-weight: 600;
}

.fullscreen-extra-btn {
    width: 44px;
    /* Slightly larger tap target */
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    /* Subtle bg for visibility confirmation */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    border: none;
}

.fullscreen-extra-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* End of file */

/* Update Notification */
.update-notification {
    position: fixed;
    bottom: 90px;
    /* Above player */
    right: 24px;
    background-color: #222222;
    /* High contrast dark */
    color: #ffffff;
    /* Explicit white */
    border: 1px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    padding: var(--space-md);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    font-weight: 500;
}

.update-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.update-notification span {
    font-weight: 500;
    font-size: var(--font-sm);
    color: #ffffff;
    /* Force white */
}

.btn-primary-small {
    background: var(--primary);
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: 500px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary-small:hover {
    transform: scale(1.05);
    background: var(--primary-hover);
}

.notification-close {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.reset-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    width: 100%;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.reset-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Settings Modal */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    background: var(--bg-elevated);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1001;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
    visibility: hidden;
}

.settings-panel.visible {
    transform: translate(-50%, -50%);
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.settings-header h2 {
    font-size: 20px;
    margin: 0;
}

.settings-content {
    padding: 24px;
    overflow-y: auto;
}

.setting-item {
    background: var(--bg-highlight);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

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

.setting-header-row h3 {
    font-size: var(--font-md);
    margin: 0;
    color: var(--text-primary);
}

.setting-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.setting-badge.success {
    background: rgba(29, 185, 84, 0.1);
    color: var(--primary);
}

.setting-badge.warning {
    background: rgba(255, 164, 43, 0.15);
    color: var(--warning);
}

.setting-description {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.setting-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: rgba(233, 20, 41, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(233, 20, 41, 0.3);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: var(--font-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(233, 20, 41, 0.2);
    transform: scale(1.02);
}

.cache-details {
    margin-top: 16px;
    padding: var(--space-md);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .settings-panel {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: translate(0, 100%);
    }

    .settings-panel.visible {
        transform: translate(0, 0);
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #222222;
    /* Slightly lighter than bg-elevated */
    color: #ffffff;
    /* Explicit white for max contrast */
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 90%;
    width: max-content;
    font-weight: 500;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification.error {
    border-color: var(--error);
    color: #ff4d4d;
    /* Ensure visibility */
}

/* Progress Notification */
.notification.progress-notification {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 300px;
}

.notification-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    margin-left: auto;
}

.notification-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.notification-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Keyboard Shortcuts Modal */
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.shortcuts-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.shortcuts-content {
    background: #181818;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.shortcuts-modal.open .shortcuts-content {
    transform: translateY(0);
}

.shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.shortcuts-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.shortcuts-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcuts-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.shortcuts-close svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 600px) {
    .shortcuts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

.shortcut-group h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: var(--space-md);
    font-weight: 700;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.shortcut-desc {
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

.shortcut-keys {
    display: flex;
    align-items: center;
    gap: 6px;
}

.key {
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--text-primary);
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
    display: inline-block;
}

/* Authentication Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.open {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #282828;
    /* margin: auto; - Removed to rely on flexbox centering */
    padding: 32px;
    border: 1px solid #444;
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.close-modal {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.modal h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #444;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

.auth-tab:hover:not(.active) {
    color: var(--text-primary);
}

/* Forms */
.auth-form {
    display: none;
    flex-direction: column;
    gap: var(--space-md);
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #121212;
    color: #fff;
    font-size: var(--font-sm);
}

.form-group input:focus {
    border-color: var(--primary);
    outline: none;
}

.primary-btn {
    background-color: var(--primary);
    color: #000;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 500px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: var(--font-sm);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: scale(1.02);
}

.primary-btn.full-width {
    width: 100%;
}

.social-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background-color: #fff;
    color: #333;
    border-radius: 500px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    width: 100%;
}

.social-login-btn:hover {
    background-color: #f0f0f0;
}

.social-login-btn img {
    width: 18px;
    height: 18px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 10px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #444;
}

.divider::before {
    margin-right: .5em;
}

.divider::after {
    margin-left: .5em;
}

.auth-link {
    display: block;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--primary);
}

/* Modal Overlay - Added for Playlist Creation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Search Result Actions */
.top-result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.top-result-actions .btn-icon,
.top-result-actions .download-song-card,
.top-result-actions .add-to-playlist {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.top-result-actions .btn-icon:hover,
.top-result-actions .download-song-card:hover,
.top-result-actions .add-to-playlist:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.song-list-item .add-to-playlist {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    margin-left: 4px;
}

.song-list-item:hover .add-to-playlist {
    opacity: 1;
}

.song-list-item .add-to-playlist:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.add-to-playlist svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}