/* ==========================================================================
   RIVI - THE DARK OBSIDIAN & ELECTRIC YELLOW STREAMING EXPERIENCE
   COMPLETE DESIGN SYSTEM: NEUMORPHISM, MINI-PLAYER DOCK & DUAL WAVE VISUALIZER
   ========================================================================== */

/* --- 1. DESIGN TOKENS --- */
:root {
    --bg-color: #080a0f;
    --sidebar-bg: #0c0f16;
    --topbar-bg: #080a0f;
    --card-bg: #111622;
    --card-hover-bg: #161c2b;
    --well-bg: #06080c;
    --card-border: rgba(255, 255, 255, 0.05);

    --text-primary: #f5f7fa;
    --text-secondary: #949eb0;
    --text-muted: #566173;

    /* RIVI Signature Electric Yellow */
    --rivi-yellow: #ffe600;
    --rivi-yellow-hover: #fff04d;
    --rivi-gold: #f5c518;
    --rivi-amber: #ff9800;
    --rivi-gradient: linear-gradient(135deg, #ffe600 0%, #ffb700 50%, #ff8800 100%);
    --rivi-glow: rgba(255, 230, 0, 0.4);
    --rivi-glow-subtle: rgba(255, 230, 0, 0.15);

    /* Neumorphic Dark Shadows */
    --shadow-out: 8px 8px 20px rgba(0, 0, 0, 0.75), -6px -6px 14px rgba(255, 255, 255, 0.025);
    --shadow-out-sm: 4px 4px 12px rgba(0, 0, 0, 0.65), -3px -3px 8px rgba(255, 255, 255, 0.02);
    --shadow-out-hover: 10px 10px 26px rgba(0, 0, 0, 0.85), -8px -8px 20px rgba(255, 230, 0, 0.12);
    --shadow-in: inset 6px 6px 14px rgba(0, 0, 0, 0.8), inset -4px -4px 10px rgba(255, 255, 255, 0.02);
    --shadow-in-sm: inset 3px 3px 8px rgba(0, 0, 0, 0.7), inset -2px -2px 6px rgba(255, 255, 255, 0.02);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 10px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-full: 9999px;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 2. GLOBAL RESET --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    padding-bottom: 90px; /* Space for mini player if docked */
}

:focus-visible {
    outline: 2px solid var(--rivi-yellow);
    outline-offset: 3px;
}

/* Ambient Yellow Glow Lights */
.glow-bg {
    position: fixed;
    border-radius: 50%;
    filter: blur(160px);
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 650px;
    height: 650px;
    background: var(--rivi-yellow);
    top: -180px;
    left: 20%;
}

.glow-2 {
    width: 600px;
    height: 600px;
    background: var(--rivi-amber);
    bottom: -120px;
    right: -100px;
}

/* --- 3. APP GRID LAYOUT --- */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* TOP BAR */
.app-top-bar {
    width: 100%;
    height: 74px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--card-border);
    display: grid;
    grid-template-columns: 240px 1fr auto;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1.5rem;
}

.brand-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.brand-logo-link:hover {
    transform: scale(1.04);
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 12px var(--rivi-glow-subtle));
}

.search-box-wrapper {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 44px;
    padding: 0 2.5rem 0 2.8rem;
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.92rem;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--rivi-yellow);
    box-shadow: var(--shadow-in-sm), 0 0 14px rgba(255, 230, 0, 0.25);
    outline: none;
}

.search-clear-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
}

.search-clear-btn:hover {
    color: var(--text-primary);
}

.badge-construction {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    border: 1px solid rgba(255, 230, 0, 0.25);
    border-radius: var(--radius-full);
    color: var(--rivi-yellow);
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.45rem 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.badge-construction:hover {
    box-shadow: var(--shadow-out-hover), 0 0 14px var(--rivi-glow-subtle);
    border-color: var(--rivi-yellow);
    transform: translateY(-1px);
}

/* APP BODY */
.app-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    flex: 1;
    min-height: calc(100vh - 74px);
}

/* LEFT SIDEBAR */
.app-sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: 1.5rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-section-title {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 0.8rem 0.4rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--rivi-yellow);
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    font-weight: 800;
}

.sidebar-divider {
    height: 1px;
    background: var(--card-border);
    margin: 0.2rem 0;
}

.sidebar-artists-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.artist-quick-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.artist-quick-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.artist-quick-item.active-artist {
    color: var(--rivi-yellow);
    font-weight: 800;
    background: rgba(255, 230, 0, 0.06);
}

.sidebar-artist-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-in-sm);
}

.sidebar-artist-info {
    display: flex;
    flex-direction: column;
}

.sidebar-artist-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
}

.sidebar-artist-genre {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* MAIN CONTENT */
.app-main-content {
    padding: 2rem 2.5rem 4rem;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

.app-view {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* --- 4. NEUMORPHIC MUSIC PLAYER CARD --- */
.player-container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-container.minimized-hidden {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    height: 0;
    margin: 0;
    overflow: hidden;
    pointer-events: none;
}

.player-card {
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    position: relative;
}

.player-card-top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -0.5rem;
}

.btn-minimize-player {
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-minimize-player:hover {
    color: var(--rivi-yellow);
    box-shadow: var(--shadow-out-hover);
    transform: scale(1.08);
}

.player-viewport {
    min-height: 340px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-panel {
    width: 100%;
    height: 100%;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal) ease;
}

.view-panel.active {
    display: flex;
    opacity: 1;
}

/* COVER ART (CLEAN, NO CD DISK) */
.cover-art-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 0;
}

.album-frame {
    position: relative;
    width: 290px;
    height: 290px;
    border-radius: var(--radius-md);
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.album-frame:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-out-hover);
}

.album-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: calc(var(--radius-md) - 6px);
    box-shadow: var(--shadow-in-sm);
}

.album-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 0 35px var(--rivi-glow);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.player-card.playing .album-glow {
    opacity: 1;
}

/* ULTRA-FINE MULTI-STRAND WAVE OSCILLOSCOPE */
.visualizer-container {
    width: 100%;
    height: 340px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in);
    border-radius: var(--radius-md);
    position: relative;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visualizer-canvas {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-sm);
}

/* LYRICS */
.lyrics-container {
    width: 100%;
    height: 340px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.lyrics-container::-webkit-scrollbar {
    width: 6px;
}
.lyrics-container::-webkit-scrollbar-track {
    background: transparent;
}
.lyrics-container::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
    opacity: 0.4;
}

.lyric-section-header {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--rivi-amber);
    margin: 1.2rem 0 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    display: inline-block;
}

.lyric-line {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 90%;
    user-select: none;
}

.lyric-line:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.lyric-line.active-line {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--rivi-yellow);
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    transform: scale(1.03);
    text-shadow: 0 0 14px var(--rivi-glow);
}

/* TRACK INFO */
.track-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
}

.track-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
}

.track-artist-link {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rivi-yellow);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0.2rem 0.8rem;
    border-radius: var(--radius-full);
}

.track-artist-link:hover {
    text-decoration: underline;
    background: rgba(255, 230, 0, 0.12);
}

/* TIMELINE */
.timeline-box {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.timeline-slider-wrap {
    width: 100%;
    height: 10px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    touch-action: none;
    display: flex;
    align-items: center;
}

.timeline-progress {
    height: 100%;
    width: 0%;
    background: var(--rivi-gradient);
    border-radius: var(--radius-full);
    position: relative;
    box-shadow: 0 0 10px var(--rivi-glow);
}

.timeline-thumb {
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    border: 2px solid var(--rivi-yellow);
}

.timeline-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* CONTROLS BAR */
.player-bottom-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: flex-start;
}

.controls-center {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    justify-content: center;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: flex-end;
}

.btn-ctrl {
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-ctrl:hover {
    box-shadow: var(--shadow-out-hover);
    color: var(--rivi-yellow);
}

.btn-ctrl:active {
    box-shadow: var(--shadow-in-sm);
    transform: scale(0.95);
}

.btn-ctrl.active-toggle {
    box-shadow: var(--shadow-in);
    color: var(--rivi-yellow);
}

.btn-ctrl-secondary {
    width: 42px;
    height: 42px;
}

.btn-ctrl-skip {
    width: 50px;
    height: 50px;
}

.btn-ctrl-play {
    width: 68px;
    height: 68px;
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    color: var(--rivi-yellow);
}

.btn-ctrl-play:hover {
    box-shadow: var(--shadow-out-hover);
    color: #fff;
    transform: scale(1.05);
}

.btn-icon-neu {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon-neu:hover {
    box-shadow: var(--shadow-out-hover);
    color: var(--rivi-yellow);
}

/* POPOVERS */
.popover-wrapper {
    position: relative;
    display: inline-block;
}

.popup-panel {
    position: absolute;
    bottom: calc(100% + 14px);
    right: 0;
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.popup-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mode-menu-popup {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.popup-title {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 0.4rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.2rem;
}

.mode-menu-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    width: 100%;
}

.mode-menu-item:hover {
    color: var(--text-primary);
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
}

.mode-menu-item.active {
    color: var(--rivi-yellow);
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    font-weight: 800;
}

.volume-vertical-popup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 0.8rem;
    min-width: 58px;
}

.volume-val-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--rivi-yellow);
}

.volume-vertical-track {
    width: 12px;
    height: 140px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    touch-action: none;
    display: flex;
    flex-direction: column-reverse;
}

.volume-vertical-fill {
    width: 100%;
    height: 85%;
    background: var(--rivi-gradient);
    border-radius: var(--radius-full);
    position: relative;
}

.volume-vertical-thumb {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    border: 2px solid var(--rivi-yellow);
    pointer-events: none;
}

/* --- 5. FIXED BOTTOM MINI-PLAYER BAR --- */
.bottom-mini-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 82px;
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.85);
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    align-items: center;
    padding: 0 2rem;
    z-index: 900;
    gap: 1.5rem;
    animation: slideUpMini 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpMini {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mini-player-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    overflow: hidden;
}

.mini-cover-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: var(--shadow-out-sm);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.mini-player-left:hover .mini-cover-thumb {
    transform: scale(1.05);
}

.mini-track-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    overflow: hidden;
}

.mini-track-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-track-artist {
    font-size: 0.78rem;
    color: var(--rivi-yellow);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
}

.mini-controls-btns {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mini-btn-ctrl {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.mini-btn-ctrl:hover {
    color: var(--rivi-yellow);
    transform: scale(1.1);
}

.mini-btn-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--rivi-gradient);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 12px var(--rivi-glow);
    transition: all var(--transition-fast);
}

.mini-btn-play:hover {
    transform: scale(1.08);
    box-shadow: 0 0 18px var(--rivi-glow);
}

.mini-timeline-bar {
    width: 100%;
    height: 4px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    border-radius: var(--radius-full);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.mini-timeline-progress {
    height: 100%;
    width: 0%;
    background: var(--rivi-gradient);
    border-radius: var(--radius-full);
}

.mini-player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.2rem;
}

.mini-btn-ctrl.active-toggle {
    color: var(--rivi-yellow);
    filter: drop-shadow(0 0 6px var(--rivi-glow));
}

.mini-wave-wrapper {
    width: 180px;
    height: 44px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all var(--transition-fast);
}

.mini-visualizer-canvas {
    width: 100%;
    height: 100%;
}

.mini-lyrics-wrapper {
    width: 220px;
    height: 44px;
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    border: 1px solid rgba(255, 230, 0, 0.2);
    border-radius: var(--radius-sm);
    padding: 0 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    overflow: hidden;
    position: relative;
}

.mini-lyric-icon {
    color: var(--rivi-yellow);
    flex-shrink: 0;
    animation: pulseLyricIcon 1.5s ease-in-out infinite alternate;
}

@keyframes pulseLyricIcon {
    from { transform: scale(0.9); opacity: 0.7; }
    to { transform: scale(1.15); opacity: 1; filter: drop-shadow(0 0 8px var(--rivi-glow)); }
}

.mini-lyric-marquee {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--rivi-yellow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 10px var(--rivi-glow-subtle);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mini-btn-maximize {
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-out-sm);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.mini-btn-maximize:hover {
    color: var(--rivi-yellow);
    box-shadow: var(--shadow-out-hover);
    transform: scale(1.08);
}

/* --- 6. TRACKS TABLE --- */
.tracks-section {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1.2rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.spotify-tracklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.spotify-track-row {
    display: grid;
    grid-template-columns: 36px 1fr 180px 70px;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
    user-select: none;
}

.spotify-track-row:hover {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: var(--shadow-out-sm);
}

.spotify-track-row.active-row {
    background: var(--card-bg);
    box-shadow: var(--shadow-in-sm);
}

.spotify-track-row.active-row .track-row-title {
    color: var(--rivi-yellow);
    font-weight: 800;
}

.track-row-num {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.track-row-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.track-row-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: var(--shadow-in-sm);
    flex-shrink: 0;
}

.track-row-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--rivi-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 900;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.track-row-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.track-row-title {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-primary);
}

.track-row-artist {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.track-row-album {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.track-row-duration {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: right;
}

/* --- 7. ARTIST PROFILE PAGE --- */
.artist-hero-profile {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2.5rem;
    padding: 1.8rem;
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
}

.artist-hero-photo-wrap {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--well-bg);
    box-shadow: var(--shadow-in);
    padding: 8px;
    flex-shrink: 0;
}

.artist-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow-out-sm);
}

.artist-hero-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.artist-verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--rivi-yellow);
}

.artist-hero-name {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
}

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

.artist-hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-play-random {
    border: none;
    background: var(--rivi-gradient);
    color: #000;
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    box-shadow: 0 0 18px var(--rivi-glow);
    transition: all var(--transition-fast);
}

.btn-play-random:hover {
    transform: scale(1.05);
    box-shadow: 0 0 28px var(--rivi-glow);
}

.btn-spotify-follow {
    border: none;
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    color: var(--text-primary);
    padding: 0.75rem 1.8rem;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-spotify-follow:hover {
    box-shadow: var(--shadow-out-hover);
    color: var(--rivi-yellow);
}

.btn-spotify-follow.following {
    color: var(--rivi-yellow);
    box-shadow: var(--shadow-in);
}

/* ARTISTS GRID */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 860px;
    margin: 0 auto;
}

.artist-grid-card {
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.artist-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-out-hover);
}

.artist-card-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-out-sm);
}

.artist-card-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--rivi-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 900;
    font-size: 1.5rem;
    box-shadow: var(--shadow-out-sm);
}

.artist-card-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.artist-card-genre {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- 8. USER PROFILE MODAL --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 1.5rem;
}

.modal-card {
    background: var(--card-bg);
    box-shadow: var(--shadow-out);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
}

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

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem;
    background: var(--well-bg);
    box-shadow: var(--shadow-in-sm);
    border-radius: var(--radius-md);
}

.user-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--rivi-gradient);
    color: #000;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-display-name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
}

.user-tier {
    font-size: 0.8rem;
    color: var(--rivi-yellow);
    font-weight: 700;
}

.user-settings-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-secondary);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--card-border);
}

.badge-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    background: var(--well-bg);
    color: var(--rivi-yellow);
    font-weight: 700;
}

/* --- 9. RESPONSIVE BREAKPOINTS & MOBILE OPTIMIZATION --- */
@media (max-width: 900px) {
    .app-top-bar {
        grid-template-columns: auto 1fr auto;
        padding: 0 1rem;
        gap: 0.8rem;
        height: 64px;
    }

    .top-bar-left {
        display: flex;
    }

    .brand-logo-img {
        height: 28px;
    }

    .search-box-wrapper {
        max-width: 100%;
    }

    .search-input {
        height: 38px;
        font-size: 0.84rem;
        padding: 0 1.8rem 0 2.2rem;
    }

    .search-icon {
        left: 10px;
        width: 15px;
        height: 15px;
    }

    .app-body {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        display: none;
    }

    .app-main-content {
        padding: 1.2rem 0.8rem 6rem;
    }

    .artist-hero-profile {
        flex-direction: column;
        text-align: center;
        gap: 1.2rem;
        padding: 1.5rem 1rem;
    }

    .artist-hero-avatar {
        width: 120px;
        height: 120px;
    }

    .artist-hero-actions {
        justify-content: center;
    }

    .spotify-track-row {
        grid-template-columns: 28px 1fr 55px;
        padding: 0.7rem 0.8rem;
        gap: 0.8rem;
    }

    .track-row-album {
        display: none;
    }

    /* Mobile Player Card */
    .player-card {
        padding: 1.5rem 1.2rem 1.4rem;
        gap: 1.2rem;
        max-width: 100%;
    }

    .album-cover-frame {
        width: min(240px, 68vw);
        height: min(240px, 68vw);
    }

    .track-title {
        font-size: 1.4rem;
    }

    .track-artist-link {
        font-size: 0.92rem;
    }

    .visualizer-container {
        height: 200px;
        padding: 0.6rem;
    }

    .lyrics-container {
        height: 240px;
        gap: 0.8rem;
    }

    .lyric-line {
        font-size: 1.05rem;
        padding: 0.4rem 0.8rem;
    }

    .lyric-line.active-line {
        font-size: 1.22rem;
    }

    .btn-play {
        width: 58px;
        height: 58px;
    }

    /* Mobile Bottom Mini-Player */
    .bottom-mini-player {
        grid-template-columns: 1fr auto auto;
        height: 72px;
        padding: 0 0.8rem;
        gap: 0.6rem;
    }

    .mini-player-left {
        gap: 0.6rem;
        max-width: 160px;
    }

    .mini-cover-thumb {
        width: 44px;
        height: 44px;
    }

    .mini-track-title {
        font-size: 0.86rem;
    }

    .mini-track-artist {
        font-size: 0.72rem;
    }

    .mini-player-center {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        max-width: none;
        width: auto;
    }

    .mini-controls-btns {
        gap: 0.5rem;
    }

    .mini-btn-ctrl {
        display: inline-flex;
    }

    #mini-shuffle-btn, #mini-repeat-btn {
        display: none;
    }

    .mini-btn-play {
        width: 36px;
        height: 36px;
    }

    .mini-timeline-bar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        border-radius: 0;
        margin: 0;
    }

    .mini-player-right {
        gap: 0.5rem;
    }

    .mini-wave-wrapper, .mini-lyrics-wrapper {
        display: none !important;
    }

    .mini-btn-maximize {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .badge-construction span {
        display: none;
    }

    .badge-construction {
        padding: 0.5rem;
        border-radius: 50%;
    }

    .app-top-bar {
        padding: 0 0.6rem;
        gap: 0.5rem;
    }

    .brand-logo-img {
        height: 24px;
    }

    .player-card {
        padding: 1.2rem 0.8rem 1rem;
        border-radius: var(--radius-md);
    }

    .album-cover-frame {
        width: min(200px, 64vw);
        height: min(200px, 64vw);
    }

    .player-card-controls {
        gap: 0.8rem;
    }

    .btn-ctrl {
        width: 40px;
        height: 40px;
    }

    .btn-play {
        width: 52px;
        height: 52px;
    }

    .mini-player-left {
        max-width: 130px;
    }
}
