/* ─── Persistent Player Bar ─────────────────────────────────────────────────── */

:root {
    --player-h: 88px;
}

/* Push footer up to sit above player */
#site-footer {
    bottom: var(--player-h);
}

/* ── Player Bar ── */
#persistent-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--player-h);
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 3000;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

/* ── Now Playing (left) ── */
.player-now-playing {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 0;
}
.player-thumb {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    background: var(--surface);
}
.player-thumb-placeholder {
    width: 52px;
    height: 52px;
    background: var(--surface);
    border-radius: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--accent);
    border: 1px solid var(--border);
}
.player-track-info { min-width: 0; }
.player-track-title {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.05em;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-track-artist {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Controls (centre) ── */
.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.player-buttons {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.player-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.3rem;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}
.player-btn:hover { color: var(--text); }
.player-btn.active { color: var(--accent); }
.player-btn--primary {
    width: 38px;
    height: 38px;
    background: var(--accent);
    color: #000;
    font-size: 1.1rem;
    border-radius: 50%;
}
.player-btn--primary:hover { opacity: 0.85; color: #000; }

/* Progress bar */
.player-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 320px;
    max-width: 40vw;
}
.player-time {
    font-size: 0.65rem;
    color: var(--accent);
    min-width: 2.5rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}
.player-time:last-child { text-align: right; }
.progress-track {
    flex: 1;
    height: 4px;
    background: rgba(0,200,255,0.15);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    pointer-events: none;
    transition: width 0.25s linear;
    box-shadow: 0 0 6px rgba(0,200,255,0.6);
    position: relative;
}
/* Playhead cursor dot */
.progress-fill::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,200,255,0.5);
    transition: transform 0.15s;
}
.progress-track:hover .progress-fill::after { transform: translateY(-50%) scale(1.3); }
/* Time display in blue */
.player-time { color: var(--accent) !important; opacity: 0.9; }

/* ── Volume + Queue (right) ── */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
}
.volume-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.volume-wrap .player-btn { font-size: 0.85rem; width: 26px; height: 26px; }
input[type=range].volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    cursor: pointer;
    accent-color: var(--accent);
}
input[type=range].volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
}

#queue-toggle-btn { font-size: 0.75rem; letter-spacing: 0.05em; }

/* ── Queue Drawer ── */
#queue-drawer {
    position: fixed;
    bottom: var(--player-h);
    right: 0;
    width: 320px;
    max-height: 420px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-bottom: none;
    z-index: 2999;
    overflow-y: auto;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
#queue-drawer.open {
    transform: translateY(0);
    opacity: 1;
}
.queue-header {
    padding: 0.8rem 1rem;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg2);
    z-index: 1;
}
.queue-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.queue-item:hover { background: var(--surface); }
.queue-item.is-playing { background: var(--surface); }
.queue-item.is-playing .queue-item-title { color: var(--accent); }
.queue-item-num {
    font-size: 0.7rem;
    color: var(--text-muted);
    min-width: 1.2rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.queue-item-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 2px;
    background: var(--surface);
    flex-shrink: 0;
}
.queue-item-title {
    font-size: 0.78rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* ── SC iframe hidden layer ── */
#sc-iframe-layer {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
}

/* Mobile handled in main.css responsive section */
