/* Backtest Timeline Scrubber
 *
 * Lives under document.body via direct DOM attachment inside the dialog's chart area.
 * All colors derived from design-tokens.css -- no hardcoded hex values except where
 * the canvas paints pixels (those are embedded in backtest-timeline.js).
 */

.bt-timeline-root {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0 0 0;
    outline: none;
    font-family: var(--degen-font-sans, 'Space Grotesk', sans-serif);
    color: var(--degen-text-primary, #E9E9E9);
}

.bt-timeline-root:focus-visible {
    outline: 1px solid var(--degen-color-primary, #B8F84E);
    outline-offset: 2px;
    border-radius: 4px;
}

.bt-timeline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 2px;
    font-family: var(--degen-font-mono, 'Source Code Pro', monospace);
    font-size: 11px;
    color: var(--degen-text-secondary, #A2A2A2);
}

.bt-timeline-btn-group,
.bt-timeline-speed,
.bt-timeline-filter {
    display: inline-flex;
    gap: 2px;
    background: var(--degen-bg-secondary, #0D1215);
    border-radius: 4px;
    padding: 2px;
}

.bt-timeline-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--degen-text-secondary, #A2A2A2);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    min-width: 26px;
    height: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.bt-timeline-btn:hover {
    background: rgba(184, 248, 78, 0.08);
    color: var(--degen-text-primary, #E9E9E9);
}

.bt-timeline-btn.bt-active {
    background: rgba(184, 248, 78, 0.15);
    color: var(--degen-color-primary, #B8F84E);
    border-color: rgba(184, 248, 78, 0.35);
}

/* Vertical hairline separating sub-groups inside a pill cluster:
 * step-arrows | jump-to-latest, and the core lane toggles | EQ toggle. */
.bt-timeline-group-divider {
    width: 1px;
    align-self: stretch;
    margin: 3px 1px;
    background: rgba(184, 248, 78, 0.18);
}

/* Equity-lane toggle. Sits in the lane-toggle cluster next to the Decision/
 * Positions/Trades toggles; tighter letter-spacing + smaller size so the "EQ"
 * abbreviation reads as one unit (the full-word toggles keep the base size). */
.bt-timeline-equity-toggle {
    letter-spacing: 0.05em;
    font-size: 10px;
}

/* Two-line LCD-style timecode readout. Top line: absolute UTC timestamp.
 * Bottom line: relative position (Day i/N · Decision j/M). Inset frame +
 * darker background sells the "DAW transport readout" role and anchors the
 * controls bar's right edge. */
.bt-timeline-readout {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    padding: 3px 8px;
    background: var(--degen-bg-primary, #080809);
    border: 1px solid rgba(184, 248, 78, 0.18);
    border-radius: 4px;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.4);
    font-family: var(--degen-font-mono, 'Source Code Pro', monospace);
    line-height: 1.2;
    letter-spacing: 0.02em;
}

.bt-timeline-readout-time {
    font-size: 11px;
    color: var(--degen-color-primary, #B8F84E);
    font-weight: 600;
}

.bt-timeline-readout-pos {
    font-size: 9px;
    color: var(--degen-text-tertiary, #888);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bt-timeline-canvas-host {
    position: relative;
    width: 100%;
    background: var(--degen-bg-secondary, #0D1215);
    border: 1px solid rgba(184, 248, 78, 0.12);
    border-radius: 4px;
    overflow: hidden;
    touch-action: none;
}

.bt-timeline-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: ew-resize;
}

/* Mobile: controls wrap to a second row, readout gets its own line */
@media (max-width: 768px) {
    .bt-timeline-controls {
        font-size: 10px;
    }
    .bt-timeline-btn {
        min-width: 28px;
        height: 24px;
        padding: 2px 6px;
    }
    .bt-timeline-readout {
        width: 100%;
        align-items: flex-end;
        margin-left: 0;
    }
}
