/* Deejayfvse — Global Player Stylesheet
 * Floating vinyl FAB · Mini-panel · Sticky player bar
 * Uses design tokens from tokens.css
 * BEM naming · Logical properties · Mobile-first
 * Loaded on all pages EXCEPT mixtapes archive
 */

/* ═══════════════════════════════════════════════
   §1 — FLOATING VINYL FAB
   Fixed bottom-right button, spinning vinyl disc
   ═══════════════════════════════════════════════ */

.fab-player {
    position: fixed;
    inset-block-end: var(--space-8);
    inset-inline-end: var(--space-6);
    z-index: 44;
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 3.5rem;
    block-size: 3.5rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    cursor: pointer;
    transition: inset-block-end 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-player:hover {
    transform: scale(1.08);
}

.fab-player:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

/* Shift up when player bar is visible */
.fab-player.has-player {
    inset-block-end: calc(4.5rem + var(--space-8));
}

/* Vinyl disc */
.fab-player__disc {
    position: relative;
    display: block;
    inline-size: 100%;
    block-size: 100%;
    border-radius: var(--radius-full);
    background:
        radial-gradient(circle, transparent 28%, rgba(40, 30, 15, 0.6) 29%, transparent 30%),
        radial-gradient(circle, transparent 44%, rgba(40, 30, 15, 0.4) 45%, transparent 46%),
        radial-gradient(circle, transparent 59%, rgba(40, 30, 15, 0.3) 60%, transparent 61%),
        conic-gradient(from 0deg, rgba(255, 255, 255, 0.03) 0deg, transparent 30deg, rgba(255, 255, 255, 0.02) 90deg, transparent 120deg, rgba(255, 255, 255, 0.03) 180deg, transparent 210deg, rgba(255, 255, 255, 0.02) 270deg, transparent 300deg),
        radial-gradient(circle, #1a1410 0%, #0d0a07 40%, #080604 100%);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(240, 187, 59, 0.15);
    animation: fab-pulse 3s ease-in-out infinite;
}

.fab-player:hover .fab-player__disc {
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(240, 187, 59, 0.3),
        0 0 20px rgba(240, 187, 59, 0.15);
}

/* Spin when playing */
.fab-player.is-spinning .fab-player__disc {
    animation: vinyl-spin 3s linear infinite;
}

/* Grooves */
.fab-player__groove {
    display: block;
    position: absolute;
    border-radius: var(--radius-full);
    border: 1px solid rgba(200, 180, 140, 0.07);
}

.fab-player__groove--1 { inset: 12%; }
.fab-player__groove--2 { inset: 25%; }

/* Label */
.fab-player__label {
    display: block;
    position: absolute;
    inset: 30%;
    border-radius: var(--radius-full);
    background:
        radial-gradient(circle, transparent 18%, rgba(180, 140, 50, 0.15) 19%, transparent 20%),
        radial-gradient(circle, rgba(240, 187, 59, 0.9) 0%, rgba(176, 121, 50, 0.85) 60%, rgba(140, 95, 30, 0.8) 100%);
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.3);
}

/* Spindle */
.fab-player__spindle {
    display: block;
    position: absolute;
    inset: 44%;
    border-radius: var(--radius-full);
    background: radial-gradient(circle, #1a1410 40%, #0d0a07 100%);
    box-shadow: 0 0 0 1px rgba(240, 187, 59, 0.2);
}

/* Idle pulse glow */
@keyframes fab-pulse {
    0%, 100% {
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(240, 187, 59, 0.15);
    }
    50% {
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(240, 187, 59, 0.25),
            0 0 16px rgba(240, 187, 59, 0.1);
    }
}

/* ═══════════════════════════════════════════════
   §2 — MINI-PANEL
   Slide-up glassmorphic panel with mixtape list
   ═══════════════════════════════════════════════ */

.fab-panel {
    position: fixed;
    inset-block-end: calc(3.5rem + var(--space-8) + var(--space-4));
    inset-inline-end: var(--space-6);
    z-index: 46;
    inline-size: 20rem;
    max-block-size: 28rem;
    display: flex;
    flex-direction: column;
    background: rgba(5, 3, 1, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(240, 187, 59, 0.12);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.04);
    transform: translateY(1rem) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-panel[hidden] {
    display: flex;
}

.fab-panel.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

/* Shift up when player bar is visible */
.fab-panel.has-player {
    inset-block-end: calc(3.5rem + 4.5rem + var(--space-8) + var(--space-4));
}

/* Panel header */
.fab-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-4) var(--space-3);
    border-block-end: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.fab-panel__title {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fab-panel__close {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.75rem;
    block-size: 1.75rem;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-muted-foreground);
    cursor: pointer;
    transition: color var(--transition-fast),
                background-color var(--transition-fast);
}

.fab-panel__close:hover {
    color: var(--color-foreground);
    background-color: rgba(255, 255, 255, 0.06);
}

.fab-panel__close:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

/* Panel list */
.fab-panel__list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(240, 187, 59, 0.2) transparent;
}

.fab-panel__list::-webkit-scrollbar {
    inline-size: 4px;
}

.fab-panel__list::-webkit-scrollbar-track {
    background: transparent;
}

.fab-panel__list::-webkit-scrollbar-thumb {
    background: rgba(240, 187, 59, 0.2);
    border-radius: 2px;
}

/* Loading state */
.fab-panel__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    color: var(--color-muted-foreground);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

/* Empty state */
.fab-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--color-muted-foreground);
    font-size: var(--text-sm);
}

/* Panel item */
.fab-panel__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: none;
    border-block-end: 1px solid rgba(255, 255, 255, 0.03);
    background: transparent;
    inline-size: 100%;
    text-align: start;
    cursor: pointer;
    transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-panel__item:hover {
    background-color: rgba(240, 187, 59, 0.05);
}

.fab-panel__item:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: -2px;
}

.fab-panel__item:last-child {
    border-block-end: none;
}

/* Currently playing highlight */
.fab-panel__item.is-playing {
    background-color: rgba(240, 187, 59, 0.08);
}

.fab-panel__item.is-playing .fab-panel__item-title {
    color: var(--color-primary);
}

/* Item cover */
.fab-panel__item-cover {
    inline-size: 2.5rem;
    block-size: 2.5rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    object-fit: cover;
}

.fab-panel__item-cover--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    opacity: 0.6;
}

.fab-panel__item-cover--fallback-1 { background: linear-gradient(135deg, #2a1a06, #4a3820); }
.fab-panel__item-cover--fallback-2 { background: linear-gradient(135deg, #1a1006, #3a2a15); }
.fab-panel__item-cover--fallback-3 { background: linear-gradient(135deg, #15100a, #2a2010); }
.fab-panel__item-cover--fallback-4 { background: linear-gradient(135deg, #1a0d02, #2a1a08); }

/* Item text */
.fab-panel__item-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-inline-size: 0;
    flex: 1;
}

.fab-panel__item-title {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}

.fab-panel__item:hover .fab-panel__item-title {
    color: var(--color-primary);
}

.fab-panel__item-genre {
    font-size: var(--text-xs);
    color: var(--color-muted-foreground);
}

/* Item play icon */
.fab-panel__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 1.5rem;
    block-size: 1.5rem;
    flex-shrink: 0;
    color: var(--color-muted-foreground);
    transition: color var(--transition-fast);
}

.fab-panel__item:hover .fab-panel__item-icon,
.fab-panel__item.is-playing .fab-panel__item-icon {
    color: var(--color-primary);
}

.fab-panel__item-icon-pause {
    display: none;
}

.fab-panel__item.is-playing .fab-panel__item-icon-play {
    display: none;
}

.fab-panel__item.is-playing .fab-panel__item-icon-pause {
    display: block;
}

/* View all link */
.fab-panel__view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-block-start: 1px solid rgba(255, 255, 255, 0.06);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
}

.fab-panel__view-all:hover {
    color: var(--color-primary);
    background-color: rgba(240, 187, 59, 0.05);
}

.fab-panel__view-all:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: -2px;
}

/* ═══════════════════════════════════════════════
   §3 — GLOBAL PLAYER BAR
   Glassmorphic bottom bar (mirrors mixtapes page)
   ═══════════════════════════════════════════════ */

.gplayer {
    position: fixed;
    inset-block-end: 0;
    inset-inline: 0;
    z-index: 45;
    block-size: 4.5rem;
    background: rgba(5, 3, 1, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-block-start: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gplayer.is-visible {
    transform: translateY(0);
}

/* Mobile thin progress at top of player */
.gplayer__progress-mobile {
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    block-size: 2px;
    background: rgba(255, 255, 255, 0.06);
}

.gplayer__progress-mobile-fill {
    block-size: 100%;
    inline-size: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-orange));
    transition: inline-size 0.1s linear;
}

.gplayer__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    block-size: 100%;
    padding-inline: var(--space-4);
    max-inline-size: var(--container-xl);
    margin-inline: auto;
}

/* Track info */
.gplayer__track-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-inline-size: 0;
    flex: 0 0 auto;
}

.gplayer__cover {
    inline-size: 3rem;
    block-size: 3rem;
    border-radius: var(--radius-sm);
    background-color: var(--color-card);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.gplayer__meta {
    display: flex;
    flex-direction: column;
    min-inline-size: 0;
}

.gplayer__title {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-inline-size: 10rem;
}

.gplayer__genre {
    font-size: var(--text-xs);
    color: var(--color-muted-foreground);
}

/* Player controls */
.gplayer__controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.gplayer__skip {
    display: none;
    align-items: center;
    justify-content: center;
    inline-size: 2rem;
    block-size: 2rem;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-muted-foreground);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.gplayer__skip:hover {
    color: var(--color-foreground);
}

.gplayer__skip:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

.gplayer__play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    inline-size: 2.5rem;
    block-size: 2.5rem;
    border-radius: var(--radius-full);
    border: none;
    background-color: var(--color-primary);
    color: var(--color-background);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gplayer__play-btn:hover {
    box-shadow: 0 0 20px rgba(240, 187, 59, 0.4);
    transform: scale(1.05);
}

.gplayer__play-btn:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

/* Toggle play/pause icons */
.gplayer__icon-pause {
    display: none;
}

.gplayer.is-playing .gplayer__icon-play {
    display: none;
}

.gplayer.is-playing .gplayer__icon-pause {
    display: block;
}

/* Progress bar — hidden on mobile */
.gplayer__progress {
    display: none;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-inline-size: 0;
}

.gplayer__time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-muted-foreground);
    flex-shrink: 0;
    min-inline-size: 2.5rem;
    text-align: center;
}

.gplayer__scrubber {
    position: relative;
    flex: 1;
    block-size: 2rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.gplayer__scrubber:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 4px;
    border-radius: 2px;
}

.gplayer__scrubber-track {
    inline-size: 100%;
    block-size: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    transition: block-size 0.2s ease;
}

.gplayer__scrubber:hover .gplayer__scrubber-track {
    block-size: 6px;
}

.gplayer__scrubber-fill {
    block-size: 100%;
    inline-size: 0%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-orange));
    border-radius: 2px;
    transition: inline-size 0.1s linear;
}

/* Volume — hidden on mobile */
.gplayer__volume {
    display: none;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.gplayer__volume-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-muted-foreground);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.gplayer__volume-btn:hover {
    color: var(--color-foreground);
}

.gplayer__volume-btn:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
}

/* Mute toggle */
.gplayer__icon-muted {
    display: none;
}

.gplayer.is-muted .gplayer__icon-vol {
    display: none;
}

.gplayer.is-muted .gplayer__icon-muted {
    display: block;
}

.gplayer__volume-slider {
    position: relative;
    inline-size: 5rem;
    block-size: 2rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.gplayer__volume-slider:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 4px;
    border-radius: 2px;
}

.gplayer__volume-track {
    inline-size: 100%;
    block-size: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.gplayer__volume-fill {
    block-size: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-orange));
    border-radius: 2px;
    transition: inline-size 0.1s linear;
}

/* Body padding when player visible */
body.has-gplayer {
    padding-block-end: 4.5rem;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: md (48em / 768px)
   ═══════════════════════════════════════════════ */

@media (min-width: 48em) {
    .gplayer__skip {
        display: flex;
    }

    .gplayer__progress {
        display: flex;
    }

    .gplayer__progress-mobile {
        display: none;
    }

    .gplayer__title {
        max-inline-size: 14rem;
    }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE: lg (62em / 992px)
   ═══════════════════════════════════════════════ */

@media (min-width: 62em) {
    .gplayer__volume {
        display: flex;
    }

    .gplayer__title {
        max-inline-size: 18rem;
    }
}

/* ═══════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .fab-player__disc {
        animation: none;
    }

    .fab-player.is-spinning .fab-player__disc {
        animation: none;
    }

    .fab-player {
        transition: none;
    }

    .fab-panel {
        transition: none;
    }

    .gplayer {
        transition: none;
    }
}
