/**
 * Spotify Clone — Production User UI
 * Spotify Web Player inspired design system
 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --green: #f02c22;
    --green-hover: #ff5146;
    --green-glow: rgba(240, 44, 34, 0.35);
    --green-dim: rgba(240, 44, 34, 0.12);
    --black: #000000;
    --bg-base: #121212;
    --bg-elevated: #181818;
    --bg-highlight: #282828;
    --bg-press: #333333;
    --bg-card: #181818;
    --bg-card-hover: #282828;
    --text-base: #ffffff;
    --text-subdued: #b3b3b3;
    --text-muted: #6a6a6a;
    --border-subtle: rgba(255, 255, 255, 0.08);
    --sidebar-w: 280px;
    --topbar-h: 64px;
    --player-h: 96px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 500px;
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-play: 0 8px 24px rgba(0, 0, 0, 0.6);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease: var(--ease-out);
    --transition: 0.2s var(--ease-out);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--black);
    color: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--text-base); }
img { display: block; max-width: 100%; }

::selection { background: var(--green); color: var(--black); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-highlight); border: 3px solid var(--bg-base); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-press); }

/* ─── Buttons ─── */
.btn-spotify {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; background: var(--green); color: var(--black);
    border: none; border-radius: var(--radius-pill); font-weight: 700; font-size: 14px;
    font-family: inherit; cursor: pointer; transition: transform var(--transition), background var(--transition);
    text-decoration: none; white-space: nowrap;
}
.btn-spotify:hover { background: var(--green-hover); color: var(--black); transform: scale(1.04); }
.btn-spotify:active { transform: scale(1); }
.btn-spotify.btn-sm { padding: 10px 24px; font-size: 13px; }
.btn-spotify.btn-lg { padding: 16px 48px; font-size: 16px; }
.btn-spotify.btn-block { width: 100%; }
.btn-spotify.btn-icon-only { width: 48px; height: 48px; padding: 0; border-radius: 50%; }

.btn-outline-spotify {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 32px; background: transparent; color: var(--text-subdued);
    border: 1px solid var(--text-subdued); border-radius: var(--radius-pill);
    font-weight: 700; font-size: 14px; font-family: inherit; cursor: pointer;
    transition: all var(--transition); text-decoration: none;
}
.btn-outline-spotify:hover { border-color: var(--text-base); color: var(--text-base); transform: scale(1.04); }
.btn-outline-spotify.btn-sm { padding: 10px 24px; font-size: 13px; }
.btn-outline-spotify.btn-lg { padding: 16px 48px; font-size: 16px; }

.btn-ghost {
    background: none; border: none; color: var(--text-subdued); cursor: pointer;
    padding: 8px; font-size: 16px; transition: color var(--transition), transform var(--transition);
    font-family: inherit;
}
.btn-ghost:hover { color: var(--text-base); }
.btn-ghost.active { color: var(--green); }

.btn-icon {
    background: none; border: none; color: var(--text-subdued); cursor: pointer;
    padding: 8px; font-size: 16px; transition: color var(--transition);
}
.btn-icon:hover { color: var(--text-base); }

/* ─── Forms ─── */
.form-control-spotify {
    width: 100%; padding: 14px; background: var(--bg-highlight); border: 1px solid transparent;
    border-radius: var(--radius-sm); color: var(--text-base); font-size: 14px; font-family: inherit;
    transition: border-color var(--transition), background var(--transition);
}
.form-control-spotify:focus { outline: none; border-color: var(--text-subdued); background: var(--bg-press); }
.form-control-spotify::placeholder { color: var(--text-muted); }
textarea.form-control-spotify { resize: vertical; min-height: 120px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--text-base); }
.form-hint { font-size: 12px; color: var(--text-subdued); margin-top: 6px; }

.alert {
    padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: 14px;
    border: none;
}
.alert-success { background: rgba(240, 44, 34, 0.12); color: var(--green); }
.alert-danger { background: rgba(233, 20, 41, 0.12); color: #ff6b7a; }
.alert .btn-close { filter: invert(1); opacity: 0.6; }

.text-muted { color: var(--text-subdued) !important; }

/* ═══════════════════════════════════════
   LANDING PAGE
   ═══════════════════════════════════════ */
.landing-body {
    background: var(--black);
    min-height: 100vh;
    overflow-x: hidden;
}

.landing-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    padding: 18px 48px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.3s;
}

.landing-brand {
    display: flex; align-items: center; gap: 12px;
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-base);
}
.landing-brand svg { width: 36px; height: 36px; }
.landing-nav-links { display: flex; align-items: center; gap: 12px; }

.landing-hero {
    min-height: 100vh;
    display: flex; align-items: center;
    padding: 120px 48px 80px;
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(240, 44, 34, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(80, 155, 245, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #1a1a2e 0%, var(--black) 50%, var(--bg-base) 100%);
}

.landing-hero h1 {
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 900; line-height: 1.05; letter-spacing: -0.03em;
    margin-bottom: 24px;
}
.landing-hero h1 em { font-style: normal; color: var(--green); }

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-subdued); max-width: 520px;
    margin-bottom: 40px; line-height: 1.7;
}

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 48px; }

.hero-stats {
    display: flex; gap: 40px; flex-wrap: wrap;
}
.hero-stat strong { display: block; font-size: 28px; font-weight: 800; color: var(--green); }
.hero-stat span { font-size: 13px; color: var(--text-subdued); text-transform: uppercase; letter-spacing: 0.05em; }

.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; }

.hero-mockup {
    width: 100%; max-width: 420px;
    background: var(--bg-elevated);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-subtle);
    animation: none;
}

@keyframes floatMockup {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.mockup-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-dot:nth-child(1) { background: #ff5f57; }
.mockup-dot:nth-child(2) { background: #febc2e; }
.mockup-dot:nth-child(3) { background: #28c840; }

.mockup-now-playing {
    background: linear-gradient(135deg, #f02c22 0%, #169c46 100%);
    border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px;
}
.mockup-now-playing .track { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.mockup-now-playing .artist { font-size: 13px; opacity: 0.85; }

.mockup-tracks { display: flex; flex-direction: column; gap: 8px; }
.mockup-track {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-md); transition: background var(--transition);
}
.mockup-track:hover { background: var(--bg-highlight); }
.mockup-track img, .mockup-track .track-art {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--bg-highlight); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--green); font-size: 18px;
}
.mockup-track .info { flex: 1; min-width: 0; }
.mockup-track .t-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mockup-track .t-artist { font-size: 12px; color: var(--text-subdued); }

.landing-features { padding: 100px 48px; background: var(--black); }
.landing-features .section-eyebrow {
    text-align: center; color: var(--green); font-size: 13px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 12px;
}
.section-title {
    text-align: center; font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 900; letter-spacing: -0.02em; margin-bottom: 16px;
}
.section-subtitle {
    text-align: center; color: var(--text-subdued); font-size: 18px;
    max-width: 560px; margin: 0 auto 64px;
}

.feature-card {
    background: var(--bg-elevated); border-radius: var(--radius-lg);
    padding: 36px 28px; height: 100%;
    border: 1px solid var(--border-subtle);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(29, 185, 84, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.feature-icon {
    width: 56px; height: 56px; border-radius: var(--radius-md);
    background: rgba(240, 44, 34, 0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--green); margin-bottom: 20px;
}
.feature-card h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.feature-card p { color: var(--text-subdued); font-size: 15px; line-height: 1.65; }

.landing-showcase {
    padding: 80px 48px;
    background: linear-gradient(180deg, var(--black) 0%, var(--bg-base) 100%);
}
.showcase-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px; max-width: 1000px; margin: 0 auto;
}
.showcase-item {
    aspect-ratio: 1; border-radius: var(--radius-lg); padding: 24px;
    display: flex; flex-direction: column; justify-content: flex-end;
    font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
    transition: transform var(--transition); cursor: default;
}
.showcase-item:hover { transform: scale(1.03); }
.showcase-item:nth-child(1) { background: linear-gradient(135deg, #e13300, #7358a6); }
.showcase-item:nth-child(2) { background: linear-gradient(135deg, #f02c22, #148a3f); }
.showcase-item:nth-child(3) { background: linear-gradient(135deg, #509bf5, #1e3264); }
.showcase-item:nth-child(4) { background: linear-gradient(135deg, #f59b23, #e91429); }

.landing-cta {
    padding: 100px 48px;
    background: linear-gradient(135deg, var(--green) 0%, #169c46 100%);
    text-align: center; color: var(--black);
}
.landing-cta h2 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; margin-bottom: 16px; letter-spacing: -0.02em; }
.landing-cta p { font-size: 18px; margin-bottom: 36px; opacity: 0.85; max-width: 500px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.landing-cta .btn-spotify { background: var(--black); color: var(--text-base); }
.landing-cta .btn-spotify:hover { background: #222; color: var(--text-base); }
.landing-cta .btn-outline-spotify { border-color: var(--black); color: var(--black); }
.landing-cta .btn-outline-spotify:hover { background: rgba(0,0,0,0.12); color: var(--black); border-color: var(--black); }

.landing-footer {
    padding: 64px 48px 32px; background: var(--black);
    border-top: 1px solid var(--border-subtle);
}
.footer-grid {
    display: grid; grid-template-columns: 2fr repeat(3, 1fr);
    gap: 48px; max-width: 1200px; margin: 0 auto 48px;
}
.footer-brand p { color: var(--text-subdued); font-size: 14px; margin-top: 12px; max-width: 280px; }
.footer-col h6 {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-subdued); margin-bottom: 20px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--text-subdued); font-size: 14px; }
.footer-links a:hover { color: var(--text-base); text-decoration: underline; }
.copyright { text-align: center; color: var(--text-muted); font-size: 13px; padding-top: 32px; border-top: 1px solid var(--border-subtle); max-width: 1200px; margin: 0 auto; }

/* ═══════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════ */
.auth-body {
    min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
    background: var(--black);
}
.auth-panel-left {
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px 64px;
    background:
        radial-gradient(ellipse 80% 80% at 20% 50%, rgba(29, 185, 84, 0.15) 0%, transparent 60%),
        var(--black);
    border-right: 1px solid var(--border-subtle);
}
.auth-panel-left h2 { font-size: 2.5rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 16px; }
.auth-panel-left p { color: var(--text-subdued); font-size: 16px; line-height: 1.7; max-width: 400px; }
.auth-panel-left .auth-features { margin-top: 40px; list-style: none; }
.auth-panel-left .auth-features li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; color: var(--text-subdued); font-size: 15px;
}
.auth-panel-left .auth-features i { color: var(--green); width: 20px; }

.auth-panel-right {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 48px 32px;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 24px; font-weight: 800; margin-bottom: 40px; color: var(--text-base);
}
.auth-logo svg { width: 32px; height: 32px; }
.auth-card { width: 100%; }
.auth-card h1 { font-size: 32px; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 8px; }
.auth-card .auth-subtitle { color: var(--text-subdued); margin-bottom: 32px; font-size: 15px; }
.auth-footer-text { text-align: center; margin-top: 28px; color: var(--text-subdued); font-size: 14px; }
.auth-footer-text a { color: var(--text-base); font-weight: 600; text-decoration: underline; }

.auth-card-inline, .form-card, .profile-edit-card, .playlist-create-card {
    background: var(--bg-elevated); border-radius: var(--radius-lg);
    padding: 32px; border: 1px solid var(--border-subtle);
}

/* ═══════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════ */
.app-body { overflow: hidden; height: 100vh; }

.app-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: 1fr var(--player-h);
    height: 100vh;
}

.app-sidebar {
    grid-row: 1 / 3;
    background: var(--black);
    display: flex; flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-subtle);
    z-index: 200;
}

.sidebar-header { padding: 24px 24px 16px; flex-shrink: 0; }

.sidebar-brand {
    display: flex; align-items: center; gap: 12px;
    font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
    color: var(--text-base); margin-bottom: 24px;
}
.sidebar-brand svg { width: 32px; height: 32px; flex-shrink: 0; }

.sidebar-nav-scroll {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 0 12px 16px;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }

.sidebar-nav .nav-link {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-subdued); font-size: 14px; font-weight: 600;
    transition: color var(--transition), background var(--transition);
}
.sidebar-nav .nav-link i { width: 22px; text-align: center; font-size: 18px; }
.sidebar-nav .nav-link:hover { color: var(--text-base); }
.sidebar-nav .nav-link.active { color: var(--text-base); background: var(--bg-highlight); }

.nav-section-title {
    padding: 20px 16px 8px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-muted);
}

.sidebar-playlist-link {
    display: block; padding: 8px 16px; border-radius: var(--radius-sm);
    color: var(--text-subdued); font-size: 14px; font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color var(--transition);
}
.sidebar-playlist-link:hover { color: var(--text-base); }

.sidebar-footer {
    padding: 16px 24px; border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.sidebar-footer a {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-subdued); font-size: 13px;
}
.sidebar-footer a:hover { color: var(--text-base); }

.app-main {
    grid-row: 1;
    display: flex; flex-direction: column;
    min-width: 0; min-height: 0;
    background: var(--bg-base);
    border-radius: 8px 0 0 0;
    overflow: hidden;
}

.app-topbar {
    height: var(--topbar-h); padding: 0 24px;
    display: flex; align-items: center; gap: 16px;
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(20px);
    position: sticky; top: 0; z-index: 100;
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s;
}
.app-topbar.scrolled {
    background: rgba(18, 18, 18, 0.95);
    box-shadow: 0 1px 0 var(--border-subtle);
}

.nav-arrows { display: flex; gap: 8px; }
.nav-arrow {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.5); border: none;
    color: var(--text-base); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; transition: background var(--transition);
}
.nav-arrow:hover { background: var(--bg-highlight); }
.nav-arrow:disabled { opacity: 0.4; cursor: not-allowed; }

.topbar-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 480px;
    position: relative;
}
.topbar-search-mobile {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-highlight);
    color: var(--text-base);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition), transform var(--transition);
}
.topbar-search-mobile:hover {
    background: var(--bg-press);
    color: var(--text-base);
    transform: scale(1.04);
}
.topbar-search i {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--text-base); font-size: 16px; pointer-events: none;
}
.topbar-search input {
    width: 100%;
    min-width: 0;
    padding: 12px 16px 12px 48px;
    background: var(--bg-highlight); border: none;
    border-radius: var(--radius-pill); color: var(--text-base);
    font-size: 14px; font-family: inherit;
    transition: background var(--transition), box-shadow var(--transition);
    text-overflow: ellipsis;
}
.topbar-search input::placeholder { color: var(--text-subdued); }
.topbar-search input:focus {
    outline: none; background: var(--bg-press);
    box-shadow: 0 0 0 2px var(--text-subdued);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.topbar-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 4px; padding-right: 12px;
    background: var(--black); border-radius: var(--radius-pill);
    font-size: 14px; font-weight: 600;
    transition: background var(--transition);
    border: none; cursor: pointer; color: var(--text-base); font-family: inherit;
}
.topbar-profile:hover { background: var(--bg-highlight); }
.topbar-profile img {
    width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0;
}
.topbar-profile-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.sidebar-toggle {
    display: none; background: none; border: none;
    color: var(--text-base); font-size: 20px; cursor: pointer; padding: 8px;
}

.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6); z-index: 150;
}

.app-content {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 0 24px 32px;
    background:
        linear-gradient(180deg, rgba(80, 80, 120, 0.15) 0%, var(--bg-base) 340px);
}

.app-content-inner { max-width: 100%; }

/* ─── Greeting / Home Hero ─── */
.home-greeting {
    padding: 24px 0 8px;
}
.home-greeting h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900; letter-spacing: -0.02em;
}

.quick-picks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px; margin-bottom: 40px;
}
.quick-pick {
    display: flex; align-items: center; gap: 0;
    background: var(--bg-highlight); border-radius: var(--radius-sm);
    overflow: hidden; cursor: pointer;
    transition: background var(--transition);
    min-height: 64px;
}
.quick-pick:hover { background: var(--bg-press); }
.quick-pick img, .quick-pick .qp-art {
    width: 64px; height: 64px; object-fit: cover; flex-shrink: 0;
    background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--green);
}
.quick-pick span {
    padding: 0 20px; font-size: 14px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.quick-pick { cursor: pointer; }
.quick-pick:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ─── Content Sections ─── */
.page-header { padding: 24px 0 32px; }
.page-header h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 8px; }
.page-header p { color: var(--text-subdued); font-size: 15px; }

.content-section { margin-bottom: 48px; }

.section-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 20px;
}
.section-header h2 {
    font-size: 24px; font-weight: 800; letter-spacing: -0.01em;
}
.section-header a {
    color: var(--text-subdued); font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.section-header a:hover { color: var(--text-base); text-decoration: underline; }

/* ─── Song Cards ─── */
.song-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.song-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: background var(--transition);
    cursor: pointer;
    position: relative;
}
.song-card:hover { background: var(--bg-card-hover); }

.song-card-cover {
    position: relative; aspect-ratio: 1;
    border-radius: var(--radius-md); overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    background: var(--bg-highlight);
}
.song-card-cover img { width: 100%; height: 100%; object-fit: cover; }

.song-card-title {
    display: block; font-size: 16px; font-weight: 700;
    margin-bottom: 4px; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-card-title:hover { text-decoration: underline; }
.song-card-artist {
    font-size: 14px; color: var(--text-subdued);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.song-card-meta {
    display: flex; align-items: center; gap: 8px; margin-top: 6px;
    font-size: 12px; color: var(--text-muted);
}

.play-btn {
    position: absolute; bottom: 8px; right: 8px;
    width: 48px; height: 48px;
    background: var(--green); color: var(--black);
    border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer;
    opacity: 0; transform: translateY(8px);
    transition: opacity var(--transition), transform var(--transition), background var(--transition), scale var(--transition);
    box-shadow: var(--shadow-play);
}
.play-btn i { margin-left: 2px; }
.song-card-cover:hover .play-btn,
.song-card:hover .play-btn { opacity: 1; transform: translateY(0); }
.play-btn:hover { background: var(--green-hover); transform: scale(1.06) !important; }

.play-btn-sm {
    position: static; width: 32px; height: 32px; font-size: 12px;
    opacity: 0; flex-shrink: 0; transform: none; box-shadow: none;
}
.song-row:hover .play-btn-sm { opacity: 1; }

.play-btn-lg {
    position: static; opacity: 1; transform: none;
    width: 56px; height: 56px; font-size: 22px;
    flex-shrink: 0;
}
.play-btn-lg i { margin-left: 3px; }

.song-detail-actions .play-btn,
.entity-hero-actions .play-btn:not(.play-btn-lg) {
    position: static; opacity: 1; transform: none;
    width: auto; height: auto; padding: 14px 32px;
    border-radius: var(--radius-pill); font-weight: 700; font-size: 14px;
    display: inline-flex; gap: 8px;
}

/* ─── Song List / Table ─── */
.song-list-header {
    display: grid; grid-template-columns: 48px 1fr 80px;
    padding: 8px 16px; border-bottom: 1px solid var(--border-subtle);
    color: var(--text-subdued); font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 4px;
}
.song-list-header.with-album { grid-template-columns: 48px 4fr 2fr 80px; }

.song-list { display: flex; flex-direction: column; }

.song-row {
    display: grid; grid-template-columns: 48px 1fr 80px;
    align-items: center; gap: 16px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    transition: background var(--transition); font-size: 14px;
}
.song-row.with-album { grid-template-columns: 48px 4fr 2fr 80px; }
.song-row:hover { background: rgba(255, 255, 255, 0.08); }
.song-row-index { color: var(--text-subdued); text-align: center; font-variant-numeric: tabular-nums; }
.song-row-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.song-row-cover { width: 40px; height: 40px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.song-row-title { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row-title:hover { text-decoration: underline; }
.song-row-artist { display: block; font-size: 13px; color: var(--text-subdued); }
.song-row-album { color: var(--text-subdued); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row-duration { color: var(--text-subdued); text-align: right; font-variant-numeric: tabular-nums; }
.song-row-wrap { display: flex; align-items: center; gap: 8px; }
.song-row-wrap .song-row { flex: 1; }
.song-row-actions { display: flex; gap: 4px; }

/* ─── Banner Carousel ─── */
.banner-carousel {
    border-radius: var(--radius-lg); overflow: hidden;
    margin-bottom: 32px; box-shadow: var(--shadow-card);
}
.banner-slide {
    height: 320px; background-size: cover; background-position: center;
    background-color: var(--bg-highlight); position: relative;
}
.banner-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
    display: flex; flex-direction: column; justify-content: center;
    padding: 48px;
}
.banner-overlay h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 8px; }
.banner-overlay p { color: var(--text-subdued); font-size: 16px; margin-bottom: 24px; max-width: 480px; }

.banner-carousel .carousel-indicators [data-bs-target] {
    width: 8px; height: 8px; border-radius: 50%; border: none;
    background: rgba(255,255,255,0.4);
}
.banner-carousel .carousel-indicators .active { background: var(--green); }

/* ─── Categories ─── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
.category-grid-lg { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.category-card {
    position: relative; border-radius: var(--radius-md);
    overflow: hidden; aspect-ratio: 1;
    display: block; transition: transform var(--transition);
    cursor: pointer;
}
.category-card:hover { transform: scale(1.02); color: var(--text-base); }
.category-card img {
    position: absolute; right: -10%; bottom: -10%;
    width: 55%; height: 55%; object-fit: cover;
    transform: rotate(25deg); box-shadow: var(--shadow-card);
    border-radius: var(--radius-sm);
}
.category-card > span, .category-card-body h3 {
    position: absolute; top: 16px; left: 16px;
    font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
    z-index: 1; max-width: 80%;
}
.category-card-body {
    position: absolute; inset: 0; padding: 20px;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.category-card-body p { font-size: 13px; color: rgba(255,255,255,0.8); margin-top: 4px; }

.cat-bg-1 { background: linear-gradient(135deg, #e13300 0%, #7358a6 100%); }
.cat-bg-2 { background: linear-gradient(135deg, #f02c22 0%, #148a3f 100%); }
.cat-bg-3 { background: linear-gradient(135deg, #509bf5 0%, #1e3264 100%); }
.cat-bg-4 { background: linear-gradient(135deg, #f59b23 0%, #e91429 100%); }
.cat-bg-5 { background: linear-gradient(135deg, #8d67ab 0%, #4c1d95 100%); }
.cat-bg-6 { background: linear-gradient(135deg, #27856a 0%, #0d3d2e 100%); }
.cat-bg-7 { background: linear-gradient(135deg, #ba5d07 0%, #7f1d1d 100%); }
.cat-bg-8 { background: linear-gradient(135deg, #477d95 0%, #1e3a5f 100%); }

/* ─── Genres ─── */
.genre-list { display: flex; flex-direction: column; gap: 8px; }
.genre-chip {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px; background: var(--bg-elevated);
    border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
    transition: background var(--transition), border-color var(--transition);
}
.genre-chip:hover { background: var(--bg-highlight); border-color: rgba(29,185,84,0.2); color: var(--text-base); }
.genre-chip i { color: var(--green); font-size: 18px; width: 24px; text-align: center; }
.genre-chip span { font-weight: 600; font-size: 15px; flex: 1; }
.genre-chip small { color: var(--text-subdued); font-size: 13px; }

/* ─── Artists ─── */
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
}
.artist-card {
    text-align: center; padding: 20px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: background var(--transition);
}
.artist-card:hover { background: var(--bg-card-hover); color: var(--text-base); }
.artist-card img {
    width: 140px; height: 140px; border-radius: 50%;
    object-fit: cover; margin: 0 auto 16px;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition);
}
.artist-card:hover img { transform: scale(1.04); }
.artist-card span { font-weight: 700; font-size: 15px; display: block; }

/* ─── Albums ─── */
.album-card { display: block; background: var(--bg-card); border-radius: var(--radius-md); padding: 16px; transition: background var(--transition); }
.album-card:hover { background: var(--bg-card-hover); color: var(--text-base); }
.album-card img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: var(--radius-md); margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition);
}
.album-card:hover img { transform: scale(1.02); }
.album-card-title { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-card-artist { font-size: 14px; color: var(--text-subdued); }

/* ─── Profile / Entity Hero ─── */
.entity-hero {
    display: flex; align-items: flex-end; gap: 24px;
    padding: 40px 24px; margin: 0 -24px 32px;
    background: linear-gradient(180deg, rgba(80, 80, 120, 0.4) 0%, var(--bg-base) 100%);
    min-height: 340px;
}
.entity-hero.compact { min-height: auto; padding: 32px 24px; }

.entity-hero-image {
    width: 232px; height: 232px; flex-shrink: 0;
    border-radius: var(--radius-md); object-fit: cover;
    box-shadow: var(--shadow-card);
}
.entity-hero-image.round { border-radius: 50%; }
.entity-hero-image.album-cover { border-radius: var(--radius-md); }

.entity-type {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-base); margin-bottom: 8px;
}
.entity-hero-info h1 {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900; letter-spacing: -0.03em; line-height: 1.1;
    margin-bottom: 12px;
}
.entity-hero-meta { color: var(--text-subdued); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entity-hero-meta a { color: var(--text-base); font-weight: 600; }
.entity-hero-meta a:hover { text-decoration: underline; }
.entity-hero-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-subdued); }

.entity-hero-actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }

/* Song detail hero */
.song-hero-desc {
    color: var(--text-subdued);
    font-size: 14px;
    line-height: 1.6;
    margin-top: 12px;
    max-width: 640px;
}
.song-hero-rating i { color: #f59b23; margin-right: 4px; }

.entity-action-bar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
    width: 100%;
}
.entity-action-primary {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.entity-action-secondary {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}

.btn-icon-lg {
    background: none;
    border: none;
    color: var(--text-subdued);
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: color var(--transition), transform var(--transition), background var(--transition);
}
.btn-icon-lg:hover {
    color: var(--text-base);
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}
.btn-icon-lg .is-liked,
.btn-icon-lg i.is-liked {
    color: var(--green);
}

.add-to-playlist { min-width: 0; flex: 1; max-width: 280px; }
.add-to-playlist select {
    width: 100%;
    min-width: 0;
}

.detail-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 520px;
}
.detail-chip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: background var(--transition), border-color var(--transition);
}
.detail-chip:hover {
    background: var(--bg-highlight);
    border-color: rgba(29, 185, 84, 0.2);
}
.detail-chip-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--green-dim);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.detail-chip-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.detail-chip-body strong {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.detail-chip-body small {
    color: var(--text-subdued);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.song-details-section { margin-bottom: 32px; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Legacy class aliases */
.profile-hero { display: flex; align-items: flex-end; gap: 24px; padding: 40px 24px; margin: 0 -24px 32px; background: linear-gradient(180deg, rgba(80, 80, 120, 0.4) 0%, var(--bg-base) 100%); min-height: 340px; }
.profile-hero-image { width: 232px; height: 232px; flex-shrink: 0; border-radius: var(--radius-md); object-fit: cover; box-shadow: var(--shadow-card); }
.profile-hero-image:not(.album-cover) { border-radius: 50%; }
.profile-type { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-base); margin-bottom: 8px; display: block; }
.profile-hero-info h1 { font-size: clamp(2rem, 6vw, 4.5rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 12px; }

.playlist-hero-icon {
    width: 232px; height: 232px; flex-shrink: 0;
    background: var(--bg-highlight); border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 80px; color: var(--text-subdued);
    box-shadow: var(--shadow-card);
}

/* Song Detail */
.song-detail {
    display: flex; gap: 32px; margin-bottom: 40px; flex-wrap: wrap;
}
.song-detail-cover img {
    width: 280px; height: 280px; border-radius: var(--radius-md);
    object-fit: cover; box-shadow: var(--shadow-card);
}
.song-detail-info { flex: 1; min-width: 280px; }
.song-detail-info h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; letter-spacing: -0.02em; margin: 8px 0; }
.song-detail-artist { font-size: 18px; margin-bottom: 16px; }
.song-detail-artist a { color: var(--text-subdued); font-weight: 600; }
.song-detail-artist a:hover { color: var(--text-base); text-decoration: underline; }
.song-detail-meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-subdued); font-size: 14px; }
.song-detail-meta i { color: var(--green); margin-right: 4px; }
.song-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 24px; }

.rating-widget { display: flex; align-items: center; gap: 4px; }
.rating-widget span { font-size: 14px; color: var(--text-subdued); margin-right: 4px; }
.rate-star {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 18px; padding: 2px; transition: color var(--transition), transform var(--transition);
}
.rate-star.active, .rate-star:hover { color: #f59b23; transform: scale(1.1); }

.add-to-playlist select { min-width: 200px; }

/* ─── Playlists ─── */
.playlist-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.playlist-card {
    position: relative; background: var(--bg-card);
    border-radius: var(--radius-md); padding: 20px;
    transition: background var(--transition);
}
.playlist-card:hover { background: var(--bg-card-hover); }
.playlist-card-link { display: block; color: var(--text-base); }
.playlist-card-icon {
    width: 64px; height: 64px; background: var(--bg-highlight);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--text-subdued); margin-bottom: 16px;
}
.playlist-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.playlist-card p { font-size: 13px; color: var(--text-subdued); }
.playlist-card small { font-size: 12px; color: var(--text-muted); }
.playlist-delete-form { position: absolute; top: 12px; right: 12px; }

.profile-edit-avatar { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-card); }
.profile-stats { display: flex; flex-wrap: wrap; gap: 24px; margin: 16px 0; }
.profile-stat { text-align: center; }
.profile-stat strong { display: block; font-size: 24px; font-weight: 800; color: var(--green); }
.profile-stat span { font-size: 12px; color: var(--text-subdued); text-transform: uppercase; letter-spacing: 0.05em; }

/* ─── Search Empty / Browse ─── */
.search-browse { padding: 24px 0; }
.search-browse h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.browse-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.browse-chip {
    padding: 20px; border-radius: var(--radius-md);
    font-size: 16px; font-weight: 700;
    transition: transform var(--transition);
    display: block; color: var(--text-base);
}
.browse-chip:hover { transform: scale(1.02); color: var(--text-base); }

/* ─── Empty State ─── */
.empty-state {
    text-align: center; padding: 80px 24px; color: var(--text-subdued);
}
.empty-state-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--bg-highlight);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: var(--text-muted);
    margin: 0 auto 24px;
}
.empty-state h3 { color: var(--text-base); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty-state p { margin-bottom: 24px; font-size: 15px; max-width: 360px; margin-left: auto; margin-right: auto; }
.empty-state i { /* legacy */ font-size: 48px; color: var(--text-muted); margin-bottom: 16px; }

/* ─── Pagination ─── */
.pagination-nav { margin-top: 40px; }
.pagination .page-link {
    background: var(--bg-elevated); border-color: var(--border-subtle);
    color: var(--text-subdued); border-radius: var(--radius-sm); margin: 0 2px;
}
.pagination .page-item.active .page-link {
    background: var(--green); border-color: var(--green); color: var(--black);
}
.pagination .page-link:hover { background: var(--bg-highlight); color: var(--text-base); }

/* ═══════════════════════════════════════
   MUSIC PLAYER — Spotify production bar
   ═══════════════════════════════════════ */
.music-player {
    grid-column: 1 / -1;
    grid-row: 2;
    height: var(--player-h);
    min-height: var(--player-h);
    background: linear-gradient(180deg, #181818 0%, var(--bg-highlight) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.45);
    display: grid;
    grid-template-columns: minmax(180px, 30%) minmax(400px, 40%) minmax(180px, 30%);
    align-items: center;
    padding: 0 16px;
    z-index: 300;
    gap: 12px;
    position: relative;
}

.music-player.is-playing .player-cover {
    box-shadow: 0 0 0 1px rgba(240, 44, 34, 0.35), 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Left — track info */
.player-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-cover-link {
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    line-height: 0;
}

.player-cover {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-elevated);
    display: block;
    transition: transform var(--transition), box-shadow var(--transition);
}

.player-cover-link:hover .player-cover {
    transform: scale(1.04);
}

.player-track-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.player-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-base);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}

.player-title:hover {
    text-decoration: underline;
}

.player-artist {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-subdued);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}

.player-artist:hover {
    color: var(--text-base);
    text-decoration: underline;
}

.player-like {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-subdued);
    cursor: pointer;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), transform var(--transition), background var(--transition);
}

.player-like:hover {
    color: var(--text-base);
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.player-like.active {
    color: var(--green);
}

.player-like.active:hover {
    color: var(--green-hover);
}

/* Center — controls + timeline */
.player-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 722px;
    width: 100%;
    margin: 0 auto;
    min-width: 0;
}

.player-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.player-btn {
    background: none;
    border: none;
    color: var(--text-subdued);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: color var(--transition), transform var(--transition), background var(--transition);
}

.player-btn-sm {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.player-btn:hover {
    color: var(--text-base);
    transform: scale(1.06);
}

.player-btn.active {
    color: var(--green);
}

.player-btn.active:hover {
    color: var(--green-hover);
}

.player-btn-main {
    width: 32px;
    height: 32px;
    background: var(--text-base);
    color: var(--black);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.player-btn-main i {
    margin-left: 2px;
}

.player-btn-main:hover {
    transform: scale(1.08);
    background: var(--text-base);
    color: var(--black);
}

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

/* Timeline / scrubber */
.player-timeline {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.player-time {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-subdued);
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    user-select: none;
    flex-shrink: 0;
}

.player-scrubber,
.player-volume-scrubber {
    position: relative;
    flex: 1;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    min-width: 0;
}

.player-volume-scrubber {
    flex: none;
    width: 100px;
}

.player-scrubber-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    overflow: visible;
    pointer-events: none;
    transition: height 0.15s var(--ease);
}

.player-scrubber:hover .player-scrubber-track,
.player-scrubber.is-dragging .player-scrubber-track,
.player-volume-scrubber:hover .player-scrubber-track {
    height: 6px;
}

.player-scrubber-fill {
    height: 100%;
    width: 0%;
    background: var(--text-base);
    border-radius: 2px;
    position: relative;
    transition: width 0.05s linear;
    pointer-events: none;
}

.player-volume-fill {
    background: var(--text-base);
}

.player-scrubber-fill::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--text-base);
    border-radius: 50%;
    transform: translateY(-50%) scale(0);
    opacity: 0;
    transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.player-scrubber:hover .player-scrubber-fill::after,
.player-scrubber.is-dragging .player-scrubber-fill::after,
.player-volume-scrubber:hover .player-scrubber-fill::after {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.player-scrubber-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    outline: none;
}

.player-scrubber-input::-webkit-slider-runnable-track {
    height: 16px;
    background: transparent;
    border: none;
}

.player-scrubber-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.player-scrubber-input::-moz-range-track {
    height: 16px;
    background: transparent;
    border: none;
}

.player-scrubber-input::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.player-scrubber-input:focus {
    outline: none;
}

.player-scrubber-input:focus-visible ~ .player-scrubber-track,
.player-scrubber:focus-within .player-scrubber-track,
.player-volume-scrubber:focus-within .player-scrubber-track {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* Right — volume */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 140px;
    width: 100%;
    justify-content: flex-end;
}

/* Legacy class aliases */
.player-track { display: contents; }
.player-track-actions { display: contents; }
.player-controls { display: contents; }
.player-progress-wrap { display: contents; }
.player-extras { display: contents; }
.player-volume-wrap { display: contents; }
.player-progress,
.player-volume { display: none; }

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 1100px) {
    .music-player {
        grid-template-columns: minmax(140px, 28%) 1fr minmax(120px, 22%);
    }
    .player-volume-scrubber { width: 80px; }
}

@media (max-width: 992px) {
    .app-wrapper { grid-template-columns: 1fr; }
    .app-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: var(--sidebar-w); transform: translateX(-100%);
        transition: transform 0.3s var(--ease-out);
        grid-row: auto;
    }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .app-main { grid-column: 1; border-radius: 0; }
    .sidebar-toggle { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .nav-arrows { display: none; }
    .auth-body { grid-template-columns: 1fr; }
    .auth-panel-left { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .entity-hero:not(.song-hero) {
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: auto;
    }
    .entity-hero-image { width: 180px; height: 180px; }
    .song-hero {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .song-hero-cover {
        align-self: center;
    }
}

@media (max-width: 768px) {
    :root { --player-h: 72px; }

    .app-wrapper { grid-template-rows: 1fr auto; }
    .app-content { padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
    .app-topbar {
        padding: 0 12px;
        gap: 10px;
        height: 56px;
    }
    .topbar-search { display: none; }
    .topbar-search-mobile { display: inline-flex; }
    .topbar-profile-name { display: none; }
    .topbar-profile {
        padding: 4px;
        flex-shrink: 0;
    }
    .topbar-actions {
        gap: 8px;
        margin-left: 0;
        flex-shrink: 0;
    }

    .landing-nav, .landing-hero, .landing-features, .landing-showcase, .landing-cta, .landing-footer {
        padding-left: 24px; padding-right: 24px;
    }

    /* Compact mobile player — Spotify mini bar */
    .music-player {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "timeline timeline"
            "track controls";
        height: auto;
        min-height: var(--player-h);
        padding: 0;
        gap: 0;
        box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08), 0 -8px 24px rgba(0, 0, 0, 0.5);
    }

    .player-center { display: contents; }

    .player-timeline {
        grid-area: timeline;
        width: 100%;
        padding: 8px 12px 4px;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .player-buttons {
        grid-area: controls;
        gap: 12px;
        padding: 0 12px 10px 0;
        align-self: center;
    }

    .player-left {
        grid-area: track;
        padding: 6px 0 10px 12px;
        gap: 10px;
        min-width: 0;
    }

    .player-right { display: none; }

    .player-like {
        display: none !important;
    }

    .player-cover {
        width: 42px;
        height: 42px;
    }

    .player-title { font-size: 13px; }
    .player-artist { font-size: 11px; }

    .player-btn-sm {
        display: none;
    }

    .player-btn-main {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .player-time {
        min-width: 36px;
        font-size: 10px;
    }

    .player-scrubber {
        height: 12px;
    }

    .entity-hero,
    .entity-hero.compact,
    .song-hero {
        padding: 20px 0 24px;
        margin: 0 0 20px;
        min-height: auto;
        gap: 20px;
    }

    .entity-hero-image,
    .song-hero-cover {
        width: min(240px, 72vw);
        height: auto;
        aspect-ratio: 1;
    }

    .entity-hero-info h1 {
        font-size: clamp(1.75rem, 9vw, 2.25rem);
        word-break: break-word;
    }

    .entity-hero-meta,
    .song-hero-meta {
        justify-content: flex-start;
        font-size: 13px;
        line-height: 1.5;
    }

    .entity-action-bar {
        margin-top: 16px;
        gap: 14px;
    }

    .entity-action-secondary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .add-to-playlist {
        max-width: none;
        width: 100%;
    }

    .content-section { margin-bottom: 32px; }
    .section-header h2 { font-size: 20px; }

    .song-row { grid-template-columns: 32px 1fr 60px; }
    .song-row-album, .song-list-header span:nth-child(3) { display: none; }
    .quick-picks { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .banner-slide { height: 220px; }
    .banner-overlay { padding: 24px; }
}

@media (max-width: 480px) {
    .song-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .song-card { padding: 12px; }
    .topbar-search-mobile { width: 36px; height: 36px; font-size: 14px; }
    .entity-action-primary { gap: 14px; }
    .play-btn-lg {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }
    .btn-icon-lg {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    .player-buttons { gap: 16px; }
}

/* Stability: avoid continuous transforms that can look like page flicker on some GPUs. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; } }
