@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   DESIGN TOKENS (DESIGN.md)
   ========================================================================== */
:root {
    /* Themes */
    --color-glass-bg-rgb: 20, 18, 30;         /* Default Dark Glass */
    --color-glass-border: rgba(255, 255, 255, 0.08); /* Default Subtle White Border */

    /* Colors */
    --color-primary: #0066cc;                /* Action Blue */
    --color-primary-focus: #0071e3;          /* Focus Blue */
    --color-primary-on-dark: #2997ff;        /* Sky Link Blue */
    --color-ink: #1d1d1f;                    /* Near-Black Ink */
    --color-ink-muted-80: #333333;           /* Softer black */
    --color-ink-muted-48: #7a7a7a;           /* Disabled / Fine print */
    --color-canvas: #ffffff;                 /* Pure White */
    --color-canvas-parchment: #f5f5f7;       /* Off-White Parchment */
    --color-surface-pearl: #fafafc;          /* Secondary button Pearl */
    --color-surface-black: #000000;          /* True Black */
    --color-hairline: #e0e0e0;               /* Hairline Border */
    --color-divider-soft: rgba(0, 0, 0, 0.04);
    --color-error: #ff3366;
    
    /* Typography Stacks */
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    
    /* Radii */
    --radius-none: 0px;
    --radius-xs: 5px;
    --radius-sm: 8px;                        /* Dark utility buttons, small images */
    --radius-md: 11px;                       /* Pearl capsules */
    --radius-lg: 18px;                       /* Store cards */
    --radius-pill: 9999px;                   /* Primary CTA, search inputs */
    --radius-full: 50%;
    
    /* Spacing Grid */
    --space-xxs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 17px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --space-section: 80px;
}

/* ==========================================================================
   GLOBAL RESET & BASES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-canvas-parchment);
    color: var(--color-ink);
    font-family: var(--font-family);
    font-size: 17px;
    font-weight: 400;
    line-height: 1.47;
    letter-spacing: -0.374px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* ==========================================================================
   DOUBLE NAVIGATION SYSTEM (global-nav & sub-nav-frosted)
   ========================================================================== */
.global-nav {
    background-color: rgba(var(--color-glass-bg-rgb), 0.65);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--color-glass-border);
    height: 60px;
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.global-nav-container {
    max-width: 980px;
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.global-nav-logo {
    color: var(--color-canvas);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: -0.12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-nav-links {
    display: flex;
    gap: 24px;
}

.global-nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: -0.12px;
    text-decoration: none;
}

.global-nav-link:hover {
    color: var(--color-canvas);
}

.sub-nav-frosted {
    background-color: rgba(245, 245, 247, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    height: 52px;
    width: 100%;
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 90;
    border-bottom: 1px solid var(--color-hairline);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.5s, border-color 0.5s;
}

.sub-nav-container {
    max-width: 980px;
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-nav-title {
    font-family: var(--font-family);
    font-size: 21px;
    font-weight: 600;
    line-height: 1.19;
    letter-spacing: 0.231px;
    color: var(--color-ink);
}

.sub-nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-canvas);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.29;
    letter-spacing: -0.224px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

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

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

.btn-primary-large {
    font-size: 17px;
    padding: 11px 22px;
    font-weight: 400;
}

.btn-secondary-pill {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-pill);
    padding: 11px 22px;
    font-size: 17px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-secondary-pill:hover {
    background-color: rgba(0, 102, 204, 0.05);
}

.btn-secondary-pill:active {
    transform: scale(0.95);
}

.btn-dark-utility {
    background-color: var(--color-ink);
    color: var(--color-canvas);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.29;
    letter-spacing: -0.224px;
    padding: 8px 15px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-dark-utility:hover {
    background-color: #333335;
}

.btn-dark-utility:active {
    transform: scale(0.95);
}

/* ==========================================================================
   INPUTS & LABELS
   ========================================================================== */
.form-group {
    margin-bottom: var(--space-lg);
    text-align: left;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-ink-muted-48);
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 12px 20px;
    background-color: var(--color-canvas);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: var(--radius-pill);
    color: var(--color-ink);
    font-family: var(--font-family);
    font-size: 17px;
    line-height: 1.47;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary-focus);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.15);
}

/* ==========================================================================
   LAYOUT CONTENT (Tiles system)
   ========================================================================== */
.main-wrapper {
    margin-top: 60px; /* Offset for single fix-positioned nav */
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Adjust offset if a sub-nav is also present */
.sub-nav-frosted ~ .main-wrapper {
    margin-top: 96px;
}

/* Alternate light/dark product-tile design */
.product-tile-light {
    background-color: var(--color-canvas);
    color: var(--color-ink);
    padding: var(--space-section) 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.product-tile-parchment {
    background-color: var(--color-canvas-parchment);
    color: var(--color-ink);
    padding: var(--space-section) 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Card-box container for form elements */
.auth-card {
    background-color: var(--color-canvas);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    width: 90%;
    max-width: 420px;
    margin: var(--space-lg) auto;
}

/* Typography styles */
.hero-display {
    font-size: 56px;
    font-weight: 600;
    line-height: 1.07;
    letter-spacing: -0.01em; /* Negative tracking for Apple tight style */
    color: var(--color-ink);
    margin-bottom: var(--space-xs);
}

@media (max-width: 640px) {
    .hero-display {
        font-size: 34px;
    }
}

.display-lg {
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--color-ink);
    margin-bottom: var(--space-xs);
}

.lead {
    font-size: 28px;
    font-weight: 400;
    line-height: 1.14;
    color: var(--color-ink-muted-80);
    margin-bottom: var(--space-lg);
}

.tagline {
    font-size: 21px;
    font-weight: 600;
    line-height: 1.19;
    color: var(--color-ink);
    margin-bottom: var(--space-md);
}

.caption {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.43;
    color: var(--color-ink-muted-48);
}

/* Alerts */
.alert-danger {
    color: var(--color-error);
    background-color: rgba(255, 51, 102, 0.05);
    border: 1px solid rgba(255, 51, 102, 0.15);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    font-size: 14px;
    margin-bottom: var(--space-md);
    text-align: left;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.alert-success {
    color: var(--color-primary);
    background-color: rgba(0, 102, 204, 0.05);
    border: 1px solid rgba(0, 102, 204, 0.15);
    border-radius: var(--radius-sm);
    padding: var(--space-sm);
    font-size: 14px;
    margin-bottom: var(--space-md);
    text-align: left;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ==========================================================================
   APPLE MUSIC FULL-SCREEN LAYOUT & DYNAMIC BACKDROP
   ========================================================================== */
.apple-music-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-size: cover;
    background-position: center;
    filter: blur(80px) saturate(160%);
    opacity: 0.55;
    transition: background-image 1s ease-in-out;
    transform: scale(1.15);
    pointer-events: none;
}

.apple-music-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: rgba(10, 8, 20, 0.76); /* Dark masking screen */
    pointer-events: none;
}

/* Body state for logged in music app */
body.music-app {
    color: #ffffff;
}

body.music-app .sub-nav-frosted {
    background-color: rgba(var(--color-glass-bg-rgb), 0.4);
    border-bottom-color: var(--color-glass-border);
}

body.music-app .sub-nav-title {
    color: #ffffff;
}

body.music-app .sub-nav-actions span {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ==========================================================================
   PORTAL PLAYER GRID LAYOUT
   ========================================================================== */
.player-wrapper {
    max-width: 980px;
    width: 90%;
    margin: 40px auto;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 45px;
    align-items: start;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Translucent Dark Glass Containers */
.active-track-card, .playlist-card {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-glass-border);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: #ffffff;
    height: 540px; /* Fixed matching height for desktop panels */
    display: flex;
    flex-direction: column;
}

/* Active Track Left Showcase */
.active-track-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.active-track-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mobile-controls-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.welcome-controls-bg {
    display: none;
}

.product-artwork {
    width: 280px;
    height: 280px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 10px 40px;
    margin-bottom: var(--space-xl);
    background-color: rgba(255, 255, 255, 0.02);
    transition: width 0.5s, height 0.5s;
}

.active-track-details {
    text-align: center;
    margin-bottom: var(--space-lg);
    width: 100%;
}

.active-track-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: #ffffff;
    margin-bottom: var(--space-xxs);
}

.active-track-genre {
    font-size: 17px;
    color: var(--color-primary-on-dark);
    font-weight: 500;
}

/* Hidden elements by default on desktop */
#btn-playlist-toggle {
    display: none;
}

.drawer-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.active-track-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.mobile-cover-art {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: rgba(0, 0, 0, 0.2) 0px 4px 12px;
    display: none;
}

.active-track-header-spacer {
    width: 48px;
    flex-shrink: 0;
    display: none;
}

.active-track-header .active-track-details {
    flex: 1;
    text-align: center;
    min-width: 0; /* Prevent text overflow */
}

.mini-title {
    font-weight: 600;
}

.mini-dot {
    color: rgba(255, 255, 255, 0.4);
}

.mini-genre {
    color: var(--color-primary-on-dark);
    font-size: 13px;
}

/* Linear Progress Bar (White on Dark Glass) */
.player-progress-bar {
    width: 100%;
    margin-bottom: var(--space-md);
}

.progress-timestamps {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-family: var(--font-family);
    margin-bottom: 6px;
}

.progress-rail {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-pill);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #ffffff; /* Clean white progress fill */
    border-radius: var(--radius-pill);
    transition: width 0.1s linear;
}

/* Audio Controls */
.player-controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: var(--space-sm);
}

.player-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    transition: transform 0.1s ease, color 0.2s, background-color 0.2s;
}

.player-btn:hover {
    color: #ffffff;
}

.player-btn:active {
    transform: scale(0.92);
}

.player-btn-play {
    background-color: #ffffff;
    color: #0b0719;
    font-size: 18px;
}

.player-btn-play:hover {
    background-color: #f5f5f7;
    color: #0b0719;
}

.player-btn.btn-active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--color-glass-border);
}

.player-btn.btn-active:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Hide lyrics box by default inside standard track card */
.active-track-card .lyrics-scroll-box {
    display: none;
}

/* ==========================================================================
   TIME-SYNCED LYRICS (GIANT APPLE MUSIC WEB STYLE)
   ========================================================================== */
.lyrics-scroll-box {
    width: 100%;
    height: 440px;
    overflow-y: auto;
    margin-bottom: 0;
    scroll-behavior: smooth;
    padding: 120px 0; /* Huge padding to allow active line centering */
    position: relative;
    text-align: left;
    
    /* Scroll mask: fades top and bottom */
    mask-image: linear-gradient(to bottom, transparent, white 20%, white 80%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent, white 20%, white 80%, transparent);
    
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.lyrics-scroll-box::-webkit-scrollbar {
    display: none;
}

.lyric-line {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.35); /* highly faded when inactive */
    padding: 16px 0;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    text-align: left;
    transform-origin: left center;
}

.lyric-line:hover {
    color: rgba(255, 255, 255, 0.75);
}

.lyric-line.active {
    font-size: 34px;
    font-weight: 800;
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 0 25px rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

/* ==========================================================================
   LYRICS MODE GRID TRANSFORMATION (SPLIT-VIEW SCREEN)
   ========================================================================== */
.player-wrapper.lyrics-mode {
    grid-template-columns: 1fr; /* Card takes full width */
    max-width: 980px;
}

.player-wrapper.lyrics-mode .playlist-card {
    display: none; /* Hide playlist cards in lyrics view */
}

/* Card expands into a clean split-panel grid */
.player-wrapper.lyrics-mode .active-track-card {
    display: grid;
    grid-template-columns: 1fr 1.45fr; /* Left is artwork/controls, Right is lyrics */
    gap: 60px;
    align-items: center;
    width: 100%;
}

.player-wrapper.lyrics-mode .active-track-card .lyrics-scroll-box {
    display: block;
    order: 2; /* Lyrics on the right side in desktop layout */
}

.player-wrapper.lyrics-mode .active-track-card .product-artwork {
    width: 240px; /* Smaller art size on the right side */
    height: 240px;
    margin-bottom: var(--space-lg);
}

.player-wrapper.lyrics-mode .active-track-card .active-track-sidebar {
    display: flex; /* Active info and controls on the right */
    flex-direction: column;
    align-items: center;
    order: 1; /* Cover artwork and playback controls on the left side */
}

/* Mobile Stacking for Lyrics Mode */
/* Mobile Layout & Interactive Elements */
@media (max-width: 833px) {
    body {
        overflow: hidden !important; /* Prevent global scrollbars that shift layout */
    }

    .player-wrapper {
        grid-template-columns: 1fr; /* Single column */
        gap: 0;
        width: 100%;
        margin: 0;
    }
    
    .active-track-card {
        height: calc(100dvh - 60px); padding: 0; border: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; display: flex; flex-direction: column; justify-content: flex-start; position: relative; overflow: hidden;
    }
    
    .active-track-sidebar {
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0; /* No padding to allow image to span edge-to-edge */
        box-sizing: border-box;
        position: relative; /* Context for absolute image */
    }

    .product-artwork, .player-wrapper.lyrics-mode .active-track-card .product-artwork { position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        object-fit: cover; /* Crop to fill screen completely */
                object-position: top;
        border-radius: 0; /* Remove rounded corners on mobile */
        box-shadow: none;
        margin: 0;
        z-index: 0; /* Background layer */
        transition: all 0.3s ease;
    }

    .mobile-controls-bg, .welcome-controls-bg { z-index: 9999; position: absolute; bottom: 12px; left: 12px; right: 12px; width: auto; height: auto; min-height: 180px; background-color: rgba(var(--color-glass-bg-rgb), 0.75); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px); padding: var(--space-md) var(--space-lg); border: 1px solid var(--color-glass-border); border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center; /* Center elements inside fixed height */
        align-items: center;
        gap: var(--space-sm);
    }

    /* Welcome Mode logic */
    .player-wrapper.welcome-mode .mobile-controls-bg,
    .player-wrapper.welcome-mode .product-artwork {
        display: none !important;
    }
    
    .welcome-controls-bg {
        display: none; /* hidden when not in welcome mode */
    }
    
    .player-wrapper.welcome-mode .welcome-controls-bg {
        display: flex !important;
    }
    
    /* Contenedor centralizado para playlist (ver regla combinada más abajo) */
    
    .player-wrapper.welcome-mode #btn-playlist-toggle,
    .player-wrapper.welcome-mode .drawer-close-btn {
        display: none !important;
    }

    /* Override margins inside the fixed section */
    .mobile-controls-bg .active-track-details {
        margin-bottom: 0;
        text-align: center;
    }

    .mobile-controls-bg .player-progress-bar {
        margin-bottom: 0;
    }

    .mobile-controls-bg .player-controls {
        margin-top: 0;
    }
    
    /* Playlist Card becomes a central overlay panel */
    .playlist-card {
        display: none;
    }

    .playlist-card.open,
    .player-wrapper.welcome-mode .playlist-card,
    .player-wrapper.lyrics-mode .playlist-card.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 84px; /* 12px gap + 60px navbar + 12px margin */
        left: 12px;
        width: calc(100% - 24px);
        bottom: 204px; /* Leaves 12px gap from bottom controls */
        height: calc(100vh - 288px); /* 100vh - 84px(top) - 204px(bottom) */
        max-height: none;
        max-width: none;
        padding: var(--space-md) var(--space-lg);
        box-sizing: border-box;
        z-index: 200; /* Sits above lyrics and cover art */
        
        /* Contenedor estilo mobile-controls-bg */
        background-color: rgba(var(--color-glass-bg-rgb), 0.65);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        border: 1px solid var(--color-glass-border);
        border-radius: var(--radius-lg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .drawer-overlay {
        display: none !important;
    }

    .drawer-close-btn {
        display: none !important;
    }
    
    .drawer-close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    /* Playlist toggle button on mobile controls */
    #btn-playlist-toggle {
        display: flex !important;
    }

    /* Mobile lyrics layout */
    .player-wrapper.lyrics-mode .active-track-card {
        height: calc(100vh - 60px);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0;
    }
    

    
    .player-wrapper.lyrics-mode .active-track-card .lyrics-scroll-box {
        display: block !important;
        height: calc(100vh - 60px);
        margin-top: 0;
        padding: 40px var(--space-lg) 200px var(--space-lg); /* 200px padding bottom to scroll past bottom controls */
        box-sizing: border-box;
        flex: 1;
        position: relative;
        z-index: 2;
        background-color: rgba(var(--color-glass-bg-rgb), 0.7);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
    }
    
    .player-wrapper.lyrics-mode .active-track-card .active-track-sidebar {
        height: auto;
        padding: 0;
    }

    .player-wrapper.lyrics-mode .mobile-cover-art,
    .player-wrapper.lyrics-mode .active-track-header-spacer {
        display: block !important;
    }
    
    /* La regla del cajón lateral en modo letras ha sido eliminada */
}

/* ==========================================================================
   PLAYLIST IN GLASS THEME
   ========================================================================== */
.playlist-card {
    max-height: 576px;
    display: flex;
    flex-direction: column;
}

.playlist-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--color-glass-border);
}

.playlist-title-row h3 {
    font-size: 17px;
    font-weight: 600;
}

.playlist-card .search-input {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--color-glass-border);
    color: #ffffff;
    transition: all 0.2s ease;
}

.playlist-card .search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.playlist-card .search-input:focus {
    border-color: var(--color-primary-on-dark);
}

.playlist-songs-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.playlist-songs-list::-webkit-scrollbar {
    width: 6px;
}
.playlist-songs-list::-webkit-scrollbar-track {
    background: transparent;
}
.playlist-songs-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}
.playlist-songs-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.playlist-song-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.playlist-song-row:hover {
    background-color: var(--color-glass-border);
}

.playlist-song-row.active {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.playlist-song-cover {
    width: 75px;
    height: 75px;
    border-radius: var(--radius-xs);
    object-fit: cover;
}

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

.playlist-song-title {
    font-size: 15.4px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-song-genre {
    font-size: 13.2px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-song-duration {
    font-size: 13.2px;
    color: rgba(255, 255, 255, 0.5);
    font-family: monospace;
}



/* ==========================================================================
   THEME PICKER
   ========================================================================== */
.theme-picker-container {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-picker-dropdown {
    position: fixed;
    top: 70px;
    left: 50%;
    width: max-content;
    background-color: rgba(var(--color-glass-bg-rgb), 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    padding: var(--space-md) var(--space-lg);
    display: none;
    flex-direction: column;
    gap: 16px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-picker-dropdown.active {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.theme-picker-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.theme-picker-label {
    width: 70px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    text-align: left;
}

.theme-swatch-group {
    display: flex;
    gap: 10px;
}

.theme-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.theme-swatch:hover, .theme-swatch:active {
    transform: scale(1.15);
    border-color: rgba(255, 255, 255, 0.8);
}


.theme-swatch.active {
    transform: scale(1.2);
    border-color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    z-index: 2;
}


/* ==========================================================================
   LOGOUT MODAL
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 15000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-card {
    background-color: rgba(var(--color-glass-bg-rgb), 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--color-glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    padding: var(--space-xl);
    text-align: center;
    max-width: 360px;
    width: 90%;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.modal-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-cancel, .btn-modal-confirm {
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-modal-cancel {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-modal-cancel:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.btn-modal-confirm {
    background-color: rgba(255, 59, 48, 0.9);
    color: #ffffff;
}

.btn-modal-confirm:hover {
    background-color: rgba(255, 59, 48, 1);
}














