/* ============================================================
   Sidebar Player — Hetty Kate EPK (Kurland-style)
   Light theme: #f7f5f3 background, black text
   ============================================================ */

.sb-player {
    --sp-bg:          #f7f5f3;
    --sp-surface:     #f7f5f3;
    --sp-surface-2:   #ede9e4;
    --sp-line:        #d8cfc4;
    --sp-line-2:      #e0d9d0;
    --sp-ink:         #111;
    --sp-ink-2:       #5a5248;
    --sp-ink-3:       #888078;
    --sp-accent:      #c8856a;
    --sp-accent-soft: #f0ebe4;
    font-family: 'HKGrotesk', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* ---- Header ---- */
.sp-header {
    background: var(--sp-bg);
    border: 1px solid var(--sp-line);
    padding: 10px 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.sp-header-text { min-width: 0; }

.sp-artist-name {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sp-ink);
    line-height: 1.1;
    margin-bottom: 2px;
}

.sp-top-tracks {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sp-ink-2);
    font-weight: 400;
}

.sp-spotify-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid var(--sp-line);
    color: var(--sp-ink-2);
    font-family: 'HKGrotesk', Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0 10px;
    height: 22px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
    margin-top: 0;
}

.sp-spotify-btn:hover {
    color: var(--sp-accent);
    border-color: var(--sp-accent);
}

.sp-spotify-btn i { font-size: 13px; }

/* ---- Controls ---- */
.sp-controls {
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-top: none;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sp-ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
}

.sp-btn:hover { color: var(--sp-ink); }
.sp-btn i { font-size: 13px; }

.sp-play-btn {
    background: #f7f5f3;
    color: #111;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--sp-line);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
    padding: 0;
}

.sp-play-btn:hover { background: #ede9e4; }
.sp-play-btn i { font-size: 12px; color: #111; }

.sp-track-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sp-now-playing {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sp-ink-3);
    margin-bottom: 1px;
}

.sp-track-title-wrap {
    overflow: hidden;
    width: 100%;
}

.sp-track-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-ink);
    white-space: nowrap;
    line-height: 1.2;
    display: inline-block;
}

@keyframes sp-scroll-title {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(0); }
    85%  { transform: translateX(var(--scroll-dist)); }
    100% { transform: translateX(var(--scroll-dist)); }
}

.sp-track-title.scrolling {
    animation: sp-scroll-title var(--scroll-duration, 7s) linear infinite alternate;
}

/* ---- Progress bar ---- */
.sp-progress-wrap {
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-top: none;
    padding: 0 14px 10px;
    cursor: pointer;
}

.sp-progress-bar {
    position: relative;
    height: 3px;
    background: var(--sp-line);
}

.sp-progress-fill {
    height: 100%;
    background: var(--sp-accent);
    width: 0%;
    pointer-events: none;
    transition: width 0.25s linear;
}

.sp-time-row {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.sp-time {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: var(--sp-ink-3);
    letter-spacing: 0.04em;
}

.sp-time-current { color: var(--sp-accent); }

/* ---- Tracklist toggle ---- */
.sp-tracklist-toggle {
    background: var(--sp-surface);
    border: 1px solid var(--sp-line);
    border-top: none;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.12s;
}

.sp-tracklist-toggle:hover { background: var(--sp-surface-2); }

.sp-tl-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sp-ink-2);
}

.sp-tl-chev {
    color: var(--sp-ink-3);
    font-size: 10px;
    transition: transform 0.25s;
}

.sp-tracklist-toggle.open .sp-tl-chev {
    transform: rotate(180deg);
}

/* ---- Track list ---- */
.sp-tracklist {
    border: 1px solid var(--sp-line);
    border-top: none;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.sp-tracklist.open {
    max-height: 600px;
    opacity: 1;
}

.sp-track-item {
    display: grid;
    grid-template-columns: 24px 1fr 44px;
    gap: 10px;
    align-items: center;
    padding: 9px 14px;
    border-top: 1px solid var(--sp-line-2);
    cursor: pointer;
    background: var(--sp-surface);
    transition: background 0.12s;
}

.sp-track-item:first-child { border-top: none; }
.sp-track-item:hover { background: var(--sp-surface-2); }
.sp-track-item.active { background: var(--sp-accent-soft); }
.sp-track-item.active:hover { background: #e8e0d6; }

.sp-track-num {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--sp-ink-3);
    text-align: center;
    position: relative;
    width: 24px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-track-num .num-text { display: block; }
.sp-track-num .num-icon { display: none; font-size: 10px; }

/* Show play icon on hover, hide number */
.sp-track-item:hover .sp-track-num .num-text { display: none; }
.sp-track-item:hover .sp-track-num .num-icon { display: block; color: var(--sp-ink); }

/* Active track: show pause icon, hide number */
.sp-track-item.active .sp-track-num .num-text { display: none; }
.sp-track-item.active .sp-track-num .num-icon { display: block; color: var(--sp-accent); }

/* Active track hover: pause icon in ink colour */
.sp-track-item.active:hover .sp-track-num .num-icon { color: var(--sp-ink); }

.sp-track-item-info {
    min-width: 0;
    overflow: hidden;
}

.sp-track-item-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.sp-track-item.active .sp-track-item-title { color: var(--sp-accent); }

.sp-track-item-meta {
    font-size: 10px;
    color: var(--sp-ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    letter-spacing: 0.02em;
}

.sp-track-dur {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--sp-ink-2);
    text-align: right;
}

/* ---- Spotify overlay — covers full player ---- */
.sp-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a2535;
    border: 1px solid #2a3a50;
    z-index: 100;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.sp-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.sp-overlay-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    transition: color 0.15s;
}

.sp-overlay-close:hover { color: #fff; }

.sp-overlay-btn {
   display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    background: #243040;
    border: none;
    color: #fff;
    font-family: 'HKGrotesk', Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 13px 16px;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 8px !important;
    transition: background 0.15s;
    letter-spacing: 0.02em;
    text-align: left;
    box-sizing: border-box;
}

.sp-overlay-btn:last-of-type { margin-bottom: 0; }
.sp-overlay-btn:hover { background: #2e3e52; color: #fff; text-decoration: none; }
.sp-overlay-btn i { font-size: 16px; opacity: 0.85; flex-shrink: 0; }

.sp-copy-confirm {
    font-size: 11px;
    color: #d9c39a;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 10px;
    text-align: center;
    min-height: 16px;
}

/* ---- Full-width mode (below 980px) ---- */
@media (max-width: 980px) {
    .sp-header       { padding: 12px 18px; }
    .sp-artist-name  { font-size: 16px; }
    .sp-top-tracks   { font-size: 12px; }
    .sp-controls     { padding: 12px 18px; gap: 14px; }
    .sp-play-btn     { width: 40px; height: 40px; }
    .sp-play-btn i   { font-size: 14px; }
    .sp-btn          { width: 34px; height: 34px; }
    .sp-btn i        { font-size: 15px; }
    .sp-track-title  { font-size: 15px; }
    .sp-progress-wrap { padding: 0 18px 12px; }
    .sp-track-item {
        grid-template-columns: 28px 1fr 50px;
        padding: 11px 18px;
        gap: 12px;
    }
    .sp-track-item-title { font-size: 13px; }
}