/* epk-timeline.css: styles for the shared "Decades In Our Set" river timeline
   (epk-timeline.js). Loaded by index.html (EPK popup Repertoire tab) and by
   bb.html (admin EPK tab live preview). Self-contained: every color and font
   resolves through the --tl-* tokens below, which pass through the public
   design tokens when they exist (index.html) and fall back to the same values
   in the admin, where styles.css is not loaded. Track geometry (width,
   height, marker x/y) is set by epk-timeline.js via CSS custom properties. */

.rc-tl,
.rc-tl-switch {
    --tl-gold: var(--accent-gold, #DAA520);
    --tl-gold-light: var(--accent-gold-light, #F0C75E);
    --tl-blue: var(--accent-blue, #4d8bff);
    --tl-blue-light: var(--light-blue, #93c5fd);
    --tl-text: var(--text-primary, #f0f0f0);
    --tl-text-2: var(--text-secondary, #a8a8b3);
    --tl-muted: var(--text-muted, #8a8a96);
    --tl-border: var(--border-color, #222228);
    --tl-font-display: var(--font-primary, 'Cinzel', serif);
    --tl-font-body: var(--font-secondary, 'Inter', sans-serif);
}

/* View toggle: animated timeline vs plain artist list (public popup only;
   the admin preview builds its own smaller switch). */
.rc-tl-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 2px 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(77, 139, 255, 0.18);
}

.rc-tl-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--tl-muted);
    font-family: var(--tl-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.rc-tl-switch-btn i {
    font-size: 10.5px;
    color: var(--tl-gold);
}

.rc-tl-switch-btn:hover {
    color: var(--tl-text);
}

.rc-tl-switch-btn.is-active {
    background: rgba(30, 64, 175, 0.35);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(77, 139, 255, 0.4);
}

.rc-tl[hidden] {
    display: none !important;
}

.rc-tl {
    margin: 4px 0 22px;
}

.rc-tl-readout {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.rc-tl-year {
    font-family: var(--tl-font-display);
    font-size: clamp(38px, 8vw, 58px);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 0%, var(--tl-gold-light) 55%, var(--tl-gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px rgba(218, 165, 32, 0.16);
}

.rc-tl-stage {
    position: relative;
    border: 1px solid rgba(77, 139, 255, 0.16);
    border-radius: 16px;
    background:
        radial-gradient(90% 120% at 15% 0%, rgba(30, 64, 175, 0.22) 0%, transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(6, 6, 8, 0.35) 100%);
    overflow: hidden;
}

.rc-tl-fx {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.9;
    z-index: 0;
}

.rc-tl-scroll {
    position: relative;
    z-index: 1;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(77, 139, 255, 0.35) transparent;
    padding: 18px 0 14px;
    cursor: grab;
}

.rc-tl-scroll.is-dragging {
    cursor: grabbing;
}

.rc-tl-scroll::-webkit-scrollbar {
    height: 8px;
}

.rc-tl-scroll::-webkit-scrollbar-thumb {
    background: rgba(77, 139, 255, 0.3);
    border-radius: 8px;
}

.rc-tl-track {
    position: relative;
    width: var(--tl-width, 100%);
    height: var(--tl-height, 240px);
    min-width: 100%;
}

.rc-tl-baseline {
    position: absolute;
    left: 0;
    right: 0;
    top: var(--tl-line, 200px);
    height: 2px;
    background: linear-gradient(90deg, rgba(77, 139, 255, 0.15) 0%, rgba(77, 139, 255, 0.4) 50%, rgba(218, 165, 32, 0.5) 100%);
    border-radius: 2px;
}

.rc-tl-progress {
    position: absolute;
    left: 0;
    top: var(--tl-line, 200px);
    height: 2px;
    width: var(--tl-progress, 0px);
    background: linear-gradient(90deg, rgba(218, 165, 32, 0.5), var(--tl-gold-light));
    box-shadow: 0 0 12px rgba(240, 199, 94, 0.5);
    border-radius: 2px;
    transition: width 0.08s linear;
}

.rc-tl-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    transform: translateX(var(--tl-head, 0px));
    background: linear-gradient(180deg, transparent 0%, rgba(240, 199, 94, 0.15) 30%, var(--tl-gold-light) 100%);
    box-shadow: 0 0 18px rgba(240, 199, 94, 0.55);
    transition: transform 0.08s linear;
    z-index: 4;
}

.rc-tl-playhead::after {
    content: "";
    position: absolute;
    left: 50%;
    top: var(--tl-line, 200px);
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--tl-gold-light);
    box-shadow: 0 0 16px 4px rgba(240, 199, 94, 0.6);
}

.rc-tl-decade {
    position: absolute;
    top: 8px;
    transform: translateX(var(--x, 0px));
    font-family: var(--tl-font-display);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.05);
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

.rc-tl-tick {
    position: absolute;
    top: var(--tl-line, 200px);
    left: 0;
    transform: translate(var(--x, 0px), -50%);
    width: 1px;
    height: 12px;
    background: rgba(77, 139, 255, 0.3);
}

.rc-tl-tick span {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--tl-muted);
    white-space: nowrap;
}

/* Marker: a stalk from the baseline up to the artist label */
.rc-tl-node {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(var(--x, 0px), var(--y, 0px));
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    z-index: 3;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--tl-font-body);
}

.rc-tl-node-stalk {
    position: absolute;
    left: 6px;
    top: 20px;
    width: 1px;
    height: var(--stalk, 0px);
    background: linear-gradient(180deg, rgba(77, 139, 255, 0.45), rgba(77, 139, 255, 0.05));
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Chips start "underwater": sunk to the baseline, invisible, inert. When the
   sweep reaches their year they surface with a springy overshoot, like
   breaking out of the river. */
.rc-tl-node:not(.is-lit) {
    pointer-events: none;
}

.rc-tl-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 9px;
    border-radius: 999px;
    background: rgba(20, 22, 30, 0.72);
    border: 1px solid rgba(77, 139, 255, 0.22);
    color: var(--tl-text-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(var(--rise, 60px)) scale(0.55);
    transition: opacity 0.5s ease, visibility 0s linear 0.5s,
                transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.rc-tl-dot {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(77, 139, 255, 0.5);
    box-shadow: inset 0 0 0 2px rgba(6, 6, 8, 0.6);
}

.rc-tl-node-year {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: var(--tl-muted);
    opacity: 0.75;
}

/* Lit: the river has reached this year and the chip has surfaced */
.rc-tl-node.is-lit .rc-tl-chip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s ease, visibility 0s,
                transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    border-color: rgba(77, 139, 255, 0.55);
    background: rgba(30, 64, 175, 0.32);
    color: var(--tl-text);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.rc-tl-node.is-lit .rc-tl-dot {
    background: var(--tl-blue);
    box-shadow: 0 0 12px rgba(77, 139, 255, 0.7), inset 0 0 0 2px rgba(6, 6, 8, 0.5);
}

.rc-tl-node.is-lit .rc-tl-node-stalk {
    opacity: 1;
}

/* Originals get the gold treatment + an OG badge */
.rc-tl-node.is-original .rc-tl-dot {
    background: rgba(218, 165, 32, 0.6);
}

.rc-tl-node.is-original.is-lit .rc-tl-chip {
    border-color: rgba(240, 199, 94, 0.6);
    background: linear-gradient(135deg, rgba(218, 165, 32, 0.3) 0%, rgba(30, 64, 175, 0.22) 100%);
    color: #fff;
}

.rc-tl-node.is-original.is-lit .rc-tl-dot {
    background: var(--tl-gold-light);
    box-shadow: 0 0 14px rgba(240, 199, 94, 0.75), inset 0 0 0 2px rgba(6, 6, 8, 0.5);
}

.rc-tl-og {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #0c0c0e;
    background: linear-gradient(135deg, var(--tl-gold-light), var(--tl-gold));
}

/* Ignition burst when a marker surfaces during the sweep */
.rc-tl-node.just-lit .rc-tl-dot {
    animation: rcTlPop 0.6s ease;
}

@keyframes rcTlPop {
    0% { transform: scale(1); }
    35% { transform: scale(1.9); box-shadow: 0 0 22px 8px rgba(240, 199, 94, 0.6); }
    100% { transform: scale(1); }
}

.rc-tl-node.is-lit:focus-visible .rc-tl-chip,
.rc-tl-node.is-lit:hover .rc-tl-chip {
    transform: translateY(-3px) scale(1.03);
    border-color: rgba(240, 199, 94, 0.6);
}

.rc-tl-node.is-active .rc-tl-chip {
    border-color: var(--tl-gold-light);
    box-shadow: 0 0 0 1px rgba(240, 199, 94, 0.5), 0 8px 22px rgba(0, 0, 0, 0.4);
}

/* Controls: play/pause + scrubber */
.rc-tl-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.rc-tl-play {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(240, 199, 94, 0.4);
    background: rgba(218, 165, 32, 0.14);
    color: var(--tl-gold-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.rc-tl-play:hover {
    transform: scale(1.08);
    background: rgba(218, 165, 32, 0.22);
    border-color: var(--tl-gold-light);
}

.rc-tl-scrub {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--tl-gold) 0%, var(--tl-gold) var(--fill, 0%), rgba(77, 139, 255, 0.18) var(--fill, 0%), rgba(77, 139, 255, 0.18) 100%);
    cursor: pointer;
}

.rc-tl-scrub::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tl-gold-light);
    border: 2px solid #0c0c0e;
    box-shadow: 0 0 10px rgba(240, 199, 94, 0.6);
    cursor: pointer;
}

.rc-tl-scrub::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tl-gold-light);
    border: 2px solid #0c0c0e;
    box-shadow: 0 0 10px rgba(240, 199, 94, 0.6);
    cursor: pointer;
}

.rc-tl-hint {
    flex-shrink: 0;
    font-size: 10.5px;
    letter-spacing: 0.4px;
    color: var(--tl-muted);
    white-space: nowrap;
    font-family: var(--tl-font-body);
}

/* HUD: the songs for the clicked artist/year */
.rc-tl-hud {
    position: absolute;
    top: 14px;
    right: 14px;
    width: min(300px, calc(100% - 28px));
    z-index: 6;
    background: rgba(12, 13, 18, 0.94);
    border: 1px solid rgba(240, 199, 94, 0.35);
    border-radius: 14px;
    padding: 16px 18px 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    font-family: var(--tl-font-body);
}

.rc-tl-hud.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.rc-tl-hud-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--tl-border);
    background: rgba(0, 0, 0, 0.4);
    color: var(--tl-text-2);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease;
}

.rc-tl-hud-close:hover {
    background: rgba(30, 64, 175, 0.4);
    color: #fff;
}

.rc-tl-hud-year {
    font-family: var(--tl-font-display);
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
    color: var(--tl-gold-light);
    font-variant-numeric: tabular-nums;
}

.rc-tl-hud-artist {
    margin-top: 3px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--tl-text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rc-tl-hud-eyebrow {
    margin-top: 12px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--tl-muted);
}

.rc-tl-hud-songs {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 180px;
    overflow-y: auto;
}

.rc-tl-hud-songs li {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    color: var(--tl-text-2);
}

.rc-tl-hud-songs li::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tl-gold);
}

.rc-tl-empty {
    padding: 26px 20px;
    text-align: center;
    color: var(--tl-muted);
    font-size: 13px;
}

@media (max-width: 640px) {
    .rc-tl-year {
        font-size: 40px;
    }

    /* Bottom-sheet HUD on phones. */
    .rc-tl-hud {
        top: auto;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rc-tl-chip,
    .rc-tl-progress,
    .rc-tl-playhead,
    .rc-tl-node-stalk,
    .rc-tl-hud {
        transition: none;
    }

    .rc-tl-node.just-lit .rc-tl-dot {
        animation: none;
    }
}
