h1:focus {
    outline: none;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Error toasts (Shared/Toasts.razor), top-right under the header */
.toast-stack {
    position: fixed;
    top: 52px;
    right: 16px;
    z-index: 3000; /* above the queue panel and player bar */
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 360px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #181818;
    color: #fff;
    border-left: 4px solid #e22134;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: toast-in 0.2s ease-out;
}

    .app-toast.warning {
        border-left-color: #f59b23;
    }

.app-toast-body {
    flex: 1;
    min-width: 0;
}

.app-toast-title {
    font-weight: 700;
    font-size: 0.9rem;
}

.app-toast-count {
    margin-left: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0 8px;
    font-size: 0.75rem;
}

.app-toast-retry {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.app-toast-message {
    color: #b3b3b3;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.app-toast-close {
    background: none;
    border: none;
    color: #b3b3b3;
    line-height: 1;
    padding: 0 2px;
}

    .app-toast-close:hover {
        color: #fff;
    }

/* Slide only (no fade) so a toast is never left invisible if animations are paused */
@keyframes toast-in {
    from {
        transform: translateY(-8px);
    }

    to {
        transform: translateY(0);
    }
}

/* Boot screen shown in index.html while the app downloads */
.app-loading {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
    font-weight: 600;
}

.app-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #1db954;
    border-radius: 50%;
    animation: app-loading-spin 0.8s linear infinite;
}

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

.playerbar-art {
    max-width: 50px;
    max-height: 50px;
    width: auto;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.layout-root {
    display: flex;
    min-height: 100vh;
}

.progress-bar {
    background-color: aqua;
}

.layout-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0; /* let it shrink to the screen; otherwise long one-line titles widen the whole page on phones */
}

.content-root {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* slightly larger than footer height */
}

.playerbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: grey;
    border-top: 1px solid #333;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000; /* stays above content */
}

.loginheader {
    background: white;
}

a {
    color: #81b3a1;
}

    a:hover {
        color: #a8d5c2;
    }

.nav-link {
    color: #81b3a1;
}

/* Track text in the player bar */
.track-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.track-title {
    font-weight: bold;
}

.track-artist {
    opacity: 0.7;
}

.playerbar-progress {
    margin-top: 10px;
}

.progress-bg {
    width: 100%;
    height: 8px;
    background-color: #333;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #1db954;
    transition: width 0.2s linear;
}

/* Make the entire playerbar breathe more */
.playerbar {
    width: 100%;
    padding: 12px 20px;
}

/* Widen the control buttons */
.player-controls button {
    width: 38px;
    height: 38px;
    font-size: 16px;
    border-radius: 8px;
}

/* Add spacing between controls */
.player-controls {
    gap: 16px !important;
}

/* Make the progress bar taller and wider */
.playerbar-progress {
    width: 100%;
    max-width: 600px; /* expand this to whatever you want */
}

/* Background bar */
.progress-bg {
    width: 100%;
    height: 12px; /* thicker bar */
    background-color: #333;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

/* Filled portion */
.progress-fill {
    height: 100%;
    background-color: #1db954;
    transition: width 0.2s linear;
}

/* Time labels */
.playerbar-progress .small {
    font-size: 0.85rem;
}

/* Make the controls + progress bar wider */
.player-controls-wrapper {
    width: 100%;
    max-width: 900px; /* increase this number to make it wider */
    margin-left: auto;
    margin-right: auto;
    align-content: center;
}

.device-picker-container {
    position: relative;
    display: inline-block;
}

/* Popup menu positioned ABOVE and LEFT of the button */
.device-menu {
    position: absolute;
    bottom: 40px; /* instead of top: 40px */
    right: 0; /* instead of left: 0 */
    background-color: #222;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    transform-origin: bottom right;
    animation: popup 0.12s ease-out;
}

.device-menu-item {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    text-align: left;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
}

    .device-menu-item:hover {
        background-color: #1db95455;
    }


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

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

/* Ensure the container is the anchor point */
.volume-container {
    position: relative;
    display: inline-block;
}

/* Base vertical slider */
.volume-slider {
    width: 8px;
    height: 120px;
    background: transparent;
    appearance: none;
    writing-mode: vertical-lr; /* Firefox-friendly */
    transform: rotate(180deg); /* match bt-lr direction */
}

    /* Chrome / Edge / Safari */
    .volume-slider::-webkit-slider-runnable-track {
        width: 8px;
        height: 120px;
        background: #444;
        border-radius: 4px;
    }

    .volume-slider::-webkit-slider-thumb {
        appearance: none;
        width: 18px;
        height: 18px;
        background: #1db954;
        border-radius: 50%;
        cursor: pointer;
        margin-left: -5px; /* centers thumb on vertical track */
    }

    /* ⭐ Firefox vertical slider */
    .volume-slider::-moz-range-track {
        width: 8px;
        height: 120px;
        background: #444;
        border-radius: 4px;
    }

    .volume-slider::-moz-range-thumb {
        width: 18px;
        height: 18px;
        background: #1db954;
        border-radius: 50%;
        cursor: pointer;
    }

/* Disabled state */
.volume-unsupported {
    border: 2px solid #ff4d4d !important;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Floating panel */
.volume-popup {
    position: absolute;
    bottom: 45px; /* float upward */
    left: -20px; /* shift left like DevicePicker */
    background: #222;
    padding: 12px;
    border-radius: 8px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    width: auto; /* no layout impact */
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

/* Mobile layout */
@media (max-width: 768px) {

    /* Put album art + track info on one line */
    .playerbar {
        flex-wrap: wrap; /* allow breaking into multiple lines */
    }

    .player-controls-wrapper {
        width: 100%;
        align-items: center !important;
    }

    .playerbar-progress {
        width: 100% !important;
    }

    /* Move Volume + Device buttons under everything */
    .playerbar .volume-container,
    .playerbar .device-picker-container {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 12px;
    }

    /* Make buttons larger on mobile */
    .playerbar .btn {
        padding: 10px 16px;
        font-size: 1.1rem;
    }


    /* Album art stays left */
    .playerbar-art {
        width: 52px;
        height: 52px;
        border-radius: 6px;
    }

    .volume-popup {
        bottom: 55px; /* float a bit higher */
        left: -10px; /* tighter alignment */
        padding: 10px;
        transform: scale(0.95); /* subtle compact feel */
        animation: fadeUp 0.15s ease-out;
    }

    /* shrink the whole progress section */
    .playerbar-progress {
        margin-top: 6px !important;
    }

    /* Make progress bar smaller + tighter */
    .progress-bg,
    .progress-fill {
        height: 6px !important;
        border-radius: 3px !important;
    }

    .playerbar-progress {
        margin-top: 4px !important;
    }

        .playerbar-progress .d-flex {
            margin-top: 2px !important;
            font-size: 0.75rem !important;
        }

    .mobile-tools-toggle {
        padding: 2px 6px !important;
        font-size: 0.65rem !important;
        height: 30px !important;
        width: 80px !important;
        text-align: center;
    }

    /* Track info stays right of album art */
    .track-info {
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-width: calc(100% - 70px); /* prevent overflow */
    }

    .track-title {
        font-size: 0.9rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .track-artist {
        font-size: 0.75rem;
        opacity: 0.85;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* ⭐ Force progress bar to its own full-width line */
    .player-controls-wrapper {
        width: 100%;
        margin-top: 6px;
    }
}

/* Hide desktop tools on mobile */
@media (max-width: 768px) {
    .desktop-tools {
        display: none !important;
    }
}

/* Hide mobile tools on desktop */
@media (min-width: 767pxpx) {
    .mobile-tools-toggle,
    .mobile-tools-panel {
        display: none !important;
    }
}

/* Mobile toggle button */
.mobile-tools-toggle {
    margin-left: auto;
    margin-right: auto;
    margin-top: 10px;
}

/* Floating mobile menu, opening just above the player bar */
.mobile-tools-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    min-width: 240px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

:root {
    --playerbar-height: 0px;
}

.content-root {
    padding-bottom: calc(var(--playerbar-height) + 20px);
}

/* --- Page Fade + Slide Transition --- */

.page-enter {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.page-enter-active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Player Bar Slide-Up --- */

/* --- Persistent Player Bar --- */
.playerbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px; /* adjust as needed */
    background-color: #222;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.5);
    z-index: 1000;
}

/* Fullscreen container: exactly the space between the header (40px login bar + 42px
   search box; none on phones) and the player bar, so the page doesn't scroll. clip, not hidden: a hidden
   overflow can still be scrolled by the browser (e.g. when a button near the bottom gets
   focus), which shoved the cover off the top. */
.np-container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height) - var(--playerbar-height));
    height: calc(100dvh - var(--header-height) - var(--playerbar-height));
    overflow: clip;
}

/* Other pages keep 20px of room above the player bar; Now Playing runs right down to it */
.content-root:has(.np-container) {
    padding-bottom: var(--playerbar-height);
}

/* Background blur */
.np-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.4);
    transform: scale(1.2);
}

/* Visualizer canvas: above the blurred background, below the content */
.np-visualizer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

/* A toggle button that's switched on */
.np-btn-on {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Foreground content */
.np-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

/* Album art */
.np-art {
    /* Shrinks on short or narrow screens so title and controls still fit below it */
    width: min(320px, 34vh, 70vw);
    height: min(320px, 34vh, 70vw);
    border-radius: 12px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.np-art-loaded {
    opacity: 1;
    transform: scale(1);
}

/* Track info */
/* Long titles (live versions, soundtracks) stop at two lines */
.np-track-info h1 {
    margin-top: 20px;
    padding: 0 16px;
    font-size: clamp(1.3rem, 1rem + 1.6vw, 2.2rem);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Phones: tighter spacing so everything fits above the player bar */
@media (max-width: 768px) {
    .np-track-info h1 {
        margin-top: 12px;
    }

    .np-progress {
        width: 85%;
        margin-top: 16px;
    }

    .np-controls {
        margin-top: 16px;
    }

    /* Start at the top and scroll if it still doesn't fit, rather than centering
       and cutting off the cover */
    .np-content {
        justify-content: flex-start;
        padding-top: 16px;
        overflow-y: auto;
        scrollbar-width: none;
    }

    .np-art {
        width: min(240px, 24vh, 60vw);
        height: min(240px, 24vh, 60vw);
    }

    .np-lyrics-toggle {
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
    }

        .np-lyrics-toggle .np-btn {
            font-size: 0.95rem;
            padding: 6px 10px;
            border-radius: 8px;
            white-space: nowrap;
        }

    .np-links {
        margin-top: 12px;
    }
}

.np-track-info h3 {
    margin-top: 8px;
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Progress bar */
.np-progress {
    width: 60%;
    margin-top: 30px;
}

.np-progress-bar-bg {
    background: rgba(255,255,255,0.2);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.np-progress-bar-fill {
    background: #1db954;
    height: 6px;
    width: 0;
    transition: width 0.3s linear;
}

.np-progress-times {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Controls */
.np-controls {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.np-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

    .np-btn:hover {
        background: rgba(255,255,255,0.25);
    }

/* Links */
.np-links {
    margin-top: 25px;
    display: flex;
    gap: 20px;
}

.np-link {
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.85;
}

    .np-link:hover {
        opacity: 1;
    }


.lyrics-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    padding: 20px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(12px);
    text-align: center;
    overflow-x: hidden; /* the enlarged current line must not add a sideways scrollbar */
    overflow-y: auto; /* ⭐ REQUIRED */
    scrollbar-width: none; /* it scrolls itself to the current line */
    overscroll-behavior: contain; /* ⭐ REQUIRED */
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 50; /* ⭐ REQUIRED */
}

.lyrics-loaded {
    transform: translateY(0);
    opacity: 1;
}

.lyrics-panel::-webkit-scrollbar {
    display: none;
}

/* Room after the last line, so the closing lines can scroll up to the middle too */
.lyrics-panel::after {
    content: "";
    display: block;
    height: 50%;
}

.lyrics-line {
    color: #bbb;
    font-size: 1rem;
    padding: 4px 24px;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Grows from the middle, so with centered text it stays inside the panel */
.active-line {
    color: #fff;
    font-weight: bold;
    transform: scale(1.08);
    transform-origin: center;
}

/* Plain (untimed) lyrics: wrap long lines instead of running off the side */
.lyrics-text {
    white-space: pre-wrap;
    font-family: inherit;
    color: #ddd;
}

/* Inside the scrolling lyrics panel, keep ✕ pinned at the top instead of scrolling away */
.lyrics-panel .lyrics-close {
    position: sticky;
    top: 0;
    float: right;
}

.lyrics-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 40;
}

.lyrics-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.4rem;
    cursor: pointer;
    color: #fff;
    z-index: 60;
}

.np-lyrics-toggle {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Visualizer style picker: a row of on/off chips under the toggles */
.np-style-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    max-width: 560px;
    margin-top: 10px;
}

    .np-style-picker .np-btn {
        font-size: 0.9rem;
        padding: 5px 10px;
        border-radius: 8px;
        opacity: 0.65;
    }

    .np-style-picker .np-btn-on {
        opacity: 1;
    }

/* Music video: dims the page and centers a 16:9 player */
.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 40;
}

.video-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 960px);
    padding: 44px 16px 16px;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    z-index: 50;
}

.video-frame {
    position: relative;
    aspect-ratio: 16 / 9;
}

    .video-frame iframe {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 8px;
    }

.video-blocked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 0 8px;
    color: #fff;
    text-align: center;
}

    .video-blocked a {
        text-decoration: none;
    }

.video-caption {
    color: #bbb;
    font-size: 0.9rem;
    margin-top: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.np-art {
    cursor: pointer;
}

.loginheader {
    background: rgba(0, 0, 0, 0.25); /* subtle, low attention */
    backdrop-filter: blur(4px); /* optional: modern, soft */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    height: 40px;
}


.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.header-text {
    font-size: 0.8rem; /* smaller text */
    line-height: 1; /* tighter vertical spacing */
}

.home-btn {
    border: 1px solid var(--accent);
    background: rgba(0,0,0,0.4);
    color: white;
    padding: 2px 6px; /* smaller button */
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
}

.search-bar {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
}

.search-box {
    width: 100%;
    padding: 8px 12px;
    /* NEW: subtle, low-attention background */
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    /* NEW: thinner, softer border */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    /* Text styling */
    color: white;
    font-size: 1rem;
    /* Make it feel lighter */
    outline: none;
}

    .search-box::placeholder {
        color: rgba(255, 255, 255, 0.45);
    }

.album-row, .show-row {
    transition: transform 0.15s ease, opacity 0.15s ease;
}

    .album-row:hover, .show-row:hover {
        transform: scale(1.02);
        opacity: 0.9;
    }

.playerbar-fav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 4px;
}

    .playerbar-fav-btn i {
        font-size: 18px;
        transition: transform 0.15s ease, color 0.2s ease;
    }

    .playerbar-fav-btn:hover i {
        color: #1DB954;
    }

    .playerbar-fav-btn:active i {
        transform: scale(1.25);
    }

    .playerbar-fav-btn .fa-solid {
        color: #1DB954;
    }

.pb-left {
    flex: 0 1 30;
    max-width: 30;
    overflow: hidden;
}

    .pb-left .track-info {
        min-width: 0; /* critical for ellipsis */
    }

    .pb-left .track-title,
    .pb-left .track-artist {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.playerbar {
    display: flex;
    align-items: center;
    width: 100%;
}

/* LEFT: max 30% */
.pb-left {
    flex: 0 1 30%;
    max-width: 30%;
    overflow: hidden;
}

/* CENTER: true centered block */
.pb-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* RIGHT: mirrors left width */
.pb-right {
    flex: 0 1 30%;
    max-width: 30%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* MOBILE FIX — force PlayerBar into a vertical layout */
@media (max-width: 768px) {

    #playerbar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem;
        padding-bottom: 1rem;
        height: auto; /* size to content: compact when logged out, taller with controls */
    }

    /* All sections become full width */
    .pb-left,
    .pb-center,
    .pb-right {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
        height: 50px;
    }

    /* Left section aligns normally */
    .pb-left {
        justify-content: flex-start !important;
    }

    /* Center controls MUST stay visible */
    .player-controls {
        justify-content: center !important;
        width: 100% !important;
        flex-wrap: nowrap !important;
    }

    /* Progress bar stays full width */
    .playerbar-progress {
        width: 100% !important;
    }

    /* Prevent album art from shrinking too small */
    .playerbar-art {
        width: 64px !important;
        height: 64px !important;
    }

    .mobile-option {
        width: 100%;
        background: #212529;
        border: 1px solid #343a40;
        color: #f8f9fa;
        border-radius: 6px;
        padding: 8px 12px;
        margin-bottom: 8px;
        font-size: 14px;
        text-align: left;
        cursor: pointer;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }

        .mobile-option:hover {
            background: #343a40;
            border-color: #495057;
            color: white;
        }

        .mobile-option:active {
            background: #495057;
        }
}

.queue-button {
    background: #212529;
    border: 1px solid #343a40;
    color: #f8f9fa;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

    .queue-button:hover {
        background: #343a40;
        border-color: #495057;
        color: white;
    }

    .queue-button:active {
        background: #495057;
    }

/* =========================
   Queue Popup
   ========================= */

.queue-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    /* Don't block clicks outside the queue */
    pointer-events: none;
}

.queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: #222;
    color: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    animation: queueSlideIn 0.2s ease-out;
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}

    .queue-header h3 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 600;
    }

.queue-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

    .queue-close:hover {
        color: #fff;
    }

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

.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .queue-item:hover {
        background-color: #333;
    }

.queue-art {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.queue-track-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-track-artist {
    color: #aaa;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-duration {
    width: 45px;
    flex-shrink: 0;
    color: #aaa;
    font-size: 0.8rem;
    text-align: right;
}

.queue-message {
    padding: 30px 20px;
    text-align: center;
    color: #aaa;
}

@keyframes queueSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

/* =========================================================
   SHARED PAGE COMPONENTS
   Used by every page so they look alike. Text on the page background
   inherits its color; cards are dark with white text.
   ========================================================= */

/* --- Page + section headings --- */
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 8px 0 16px;
}

    .page-title span {
        font-weight: 800;
    }

.page-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.see-all {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.75;
    font-size: 0.85rem;
    font-weight: 600;
}

    .see-all:hover {
        opacity: 1;
        text-decoration: underline;
    }

.text-link {
    cursor: pointer;
}

    .text-link:hover {
        text-decoration: underline;
    }

/* --- Filter chips / tabs (match the translucent header search box) --- */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.chip {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

    .chip:hover {
        background: rgba(0, 0, 0, 0.4);
    }

    .chip.active {
        background: #fff;
        color: #000;
        border-color: #fff;
        font-weight: 600;
    }

/* --- Buttons --- */
.pill-btn {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

    .pill-btn:hover:not(:disabled) {
        background: rgba(0, 0, 0, 0.4);
    }

    .pill-btn:disabled {
        opacity: 0.4;
        cursor: default;
    }

    .pill-btn.primary {
        background: #1db954;
        border-color: #1db954;
        color: #000;
    }

        .pill-btn.primary:hover:not(:disabled) {
            background: #1ed760;
        }

.pager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.pager-text {
    opacity: 0.75;
    font-size: 0.9rem;
}

.like-btn {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

    .like-btn:hover {
        background: rgba(0, 0, 0, 0.2);
        transform: scale(1.1);
    }

/* --- Header for album / artist / playlist / podcast pages --- */
.media-header {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin: 8px 0 32px;
}

.media-header-cover {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

    .media-header-cover.round {
        border-radius: 50%;
    }

.media-header-info {
    min-width: 0;
}

.media-header-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.media-header-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 4px 0 8px;
    overflow-wrap: anywhere;
}

.media-header-meta {
    font-size: 0.9rem;
    opacity: 0.85;
}

.media-header-desc {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0 0 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Track rows (sit on the page background) --- */
.track-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 0;
    margin: 0;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

    .track-row:hover {
        background: rgba(0, 0, 0, 0.15);
    }

.track-row-num {
    width: 24px;
    flex-shrink: 0;
    text-align: right;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
}

/* Number turns into a play icon on hover, like the art overlay on other pages */
.track-row-num-play {
    display: none;
}

.track-row:hover .track-row-num {
    opacity: 1;
}

.track-row:hover .track-row-num-text {
    display: none;
}

.track-row:hover .track-row-num-play {
    display: inline;
}

.track-row-art {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

    .track-row-art img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 4px;
    }

.track-row-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 4px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.track-row:hover .track-row-play {
    opacity: 1;
}

.track-row-info {
    flex: 1;
    min-width: 0;
}

.track-row-name,
.track-row-sub,
.track-row-album {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-row-name {
    font-weight: 600;
}

.track-row-sub,
.track-row-album,
.track-row-meta {
    opacity: 0.75;
    font-size: 0.85rem;
}

.track-row-album {
    flex: 1;
    min-width: 0;
}

.track-row-meta {
    width: 48px;
    flex-shrink: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

    .track-row-meta.wide {
        width: auto;
        white-space: nowrap;
    }

/* --- Cards (artists, albums, playlists, podcasts) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.media-card {
    display: block;
    background: #181818;
    color: #fff;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
    min-width: 0;
}

    .media-card:hover {
        background: #282828;
        color: #fff;
    }

.media-card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
}

    .media-card-image.round {
        border-radius: 50%;
    }

.media-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    font-size: 2.5rem;
}

.media-card-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-subtitle {
    color: #b3b3b3;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Podcast episodes --- */
.episode-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.episode-card {
    background: #181818;
    color: #fff;
    border-radius: 8px;
    padding: 16px;
    transition: background-color 0.2s ease;
}

    .episode-card:hover {
        background: #282828;
    }

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

.episode-date {
    color: #b3b3b3;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.episode-desc {
    color: #b3b3b3;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Empty / loading states --- */
.empty-state {
    text-align: center;
    padding: 64px 16px;
    opacity: 0.85;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.page-message {
    padding: 16px 0;
    opacity: 0.85;
}

.skeleton-row {
    height: 56px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, rgba(0,0,0,0.15) 25%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.15) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

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

/* =========================================================
   SEARCH PAGE
   ========================================================= */

.search-page {
    padding-bottom: 24px;
}

/* Top result + songs preview */
.search-top-row {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) 3fr;
    gap: 24px;
}

.search-top-card {
    position: relative;
    background: #181818;
    color: #fff;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 220px;
}

    .search-top-card:hover {
        background: #282828;
    }

.search-top-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    margin-bottom: 16px;
}

    .search-top-image.round {
        border-radius: 50%;
    }

.search-top-name {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-top-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b3b3b3;
    font-size: 0.9rem;
}

.search-type-pill {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.search-play-btn {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #1db954;
    color: #000;
    font-size: 1.1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
}

.search-top-card:hover .search-play-btn {
    opacity: 1;
    transform: translateY(0);
}

.search-play-btn:hover {
    background: #1ed760;
}

/* Narrow screens */
@media (max-width: 768px) {
    .search-top-row {
        grid-template-columns: 1fr;
    }

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

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .media-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .media-header-cover {
        width: 160px;
        height: 160px;
    }

    .media-header-title {
        font-size: 1.75rem;
    }
}

/* Phones: no header (login bar + search box), so pages get the whole screen. Search,
   home and login are in the player bar's ☰ Menu instead. The breakpoint matches
   Bootstrap's d-md-none, which shows that menu. */
:root {
    --header-height: 82px;
}

@media (max-width: 767.98px) {
    .top-bar {
        display: none;
    }

    :root {
        --header-height: 0px;
    }

    .mobile-search {
        margin-bottom: 4px;
    }

    .mobile-logout {
        color: #ff8a8a !important;
    }
}
