/**
 * LineScout — analyst.css
 * Styles for all Analyst-tier UI:
 *   - Opening line badge on game cards (homepage)
 *   - Dashboard odds panel (market tabs, game picker, comparison table, history)
 *   - Sparkline chart container
 */

/* ═══════════════════════════════════════════════════════════════════════════
   OPENING LINE BADGE — game cards
   ═══════════════════════════════════════════════════════════════════════════ */

.opening-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-top: 0.5px solid var(--bd1);
    font-size: 10px;
}

.ob-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--txt-3);
}

.ob-val {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--txt-2);
}

.ob-arrow {
    font-size: 9px;
    color: var(--txt-3);
}

.ob-current {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--txt-1);
}

.ob-current.line-up   { color: #22c55e; }   /* line moved up (toward home) */
.ob-current.line-down { color: #f16b72; }   /* line moved down */

/* ═══════════════════════════════════════════════════════════════════════════
   ODDS PANEL — dashboard layout wrapper
   ═══════════════════════════════════════════════════════════════════════════ */

.odds-ui {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Market tab bar ──────────────────────────────────────────────────────── */

.odds-market-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 8px 14px;
    border-bottom: 0.5px solid var(--bd1);
    background: var(--s2);
    flex-shrink: 0;
}

.omt {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 13px;
    border-radius: 5px;
    border: 0.5px solid transparent;
    background: transparent;
    color: var(--txt-3);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.omt:hover            { color: var(--txt-1); background: var(--s3); }
.omt.active           { background: var(--s3); color: var(--txt-1); border-color: var(--bd2); }

/* ── Two-column body ─────────────────────────────────────────────────────── */

.odds-columns {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GAME PICKER — left column
   ═══════════════════════════════════════════════════════════════════════════ */

.game-picker {
    width: 216px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 0.5px solid var(--bd1);
    background: var(--s2);
}

.game-picker::-webkit-scrollbar       { width: 3px; }
.game-picker::-webkit-scrollbar-track { background: transparent; }
.game-picker::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 2px; }

.gp-sport-label {
    padding: 10px 12px 3px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--txt-3);
}

.gp-game {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 0.5px solid var(--bd1);
    border-left: 2px solid transparent;
    cursor: pointer;
    transition: background 0.12s;
}

.gp-game:hover  { background: var(--s3); }
.gp-game.active { background: var(--s3); border-left-color: var(--blue, #3b82f6); }

.gp-teams      { flex: 1; min-width: 0; }

.gp-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--txt-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.gp-score {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--txt-1);
    flex-shrink: 0;
    margin-left: 4px;
}

.gp-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    white-space: nowrap;
}

.gp-badge.live     { background: rgba(34,197,94,0.12); color: #22c55e; }
.gp-badge.final    { background: rgba(255,255,255,0.05); color: var(--txt-3); font-weight: 400; }
.gp-badge.upcoming { color: var(--txt-3); font-weight: 400; }

.gp-empty,
.gp-loading {
    padding: 28px 12px;
    text-align: center;
    font-size: 11px;
    color: var(--txt-3);
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ODDS DETAIL — right column (now full-width, no game picker column)
   ═══════════════════════════════════════════════════════════════════════════ */

.odds-detail {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
    min-width: 0;
}

.odds-detail::-webkit-scrollbar       { width: 3px; }
.odds-detail::-webkit-scrollbar-track { background: transparent; }
.odds-detail::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 2px; }

/* States */

.od-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    font-size: 12px;
    color: var(--txt-3);
    text-align: center;
    line-height: 1.6;
}

.od-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 0;
    font-size: 12px;
    color: var(--txt-3);
}

.od-error,
.od-no-data {
    padding: 28px 0;
    text-align: center;
    font-size: 12px;
    color: var(--txt-3);
    line-height: 1.8;
}

.od-error { color: var(--red, #f16b72); }

/* Header */

.od-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 0.5px solid var(--bd1);
}

.od-game-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--txt-1);
    margin-bottom: 5px;
}

.od-at { color: var(--txt-3); font-weight: 400; }

.od-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.od-market-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--txt-3);
}

.od-delta {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 3px;
}

.od-delta.positive { background: rgba(34,197,94,0.10);  color: #22c55e; }
.od-delta.negative { background: rgba(241,107,114,0.10); color: #f16b72; }

/* Section labels */

.od-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--txt-3);
}

.od-snap-count {
    font-size: 9px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    background: var(--s3);
    color: var(--txt-3);
    padding: 1px 6px;
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPARISON & HISTORY TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

.compare-table,
.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.compare-table th,
.history-table th {
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--txt-3);
    text-align: left;
    border-bottom: 0.5px solid var(--bd1);
    white-space: nowrap;
}

.compare-table td,
.history-table td {
    padding: 8px 8px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--txt-2);
    border-bottom: 0.5px solid var(--bd1);
}

.compare-table tr:last-child td,
.history-table tr:last-child td { border-bottom: none; }

.compare-table tbody tr:hover td,
.history-table tbody tr:hover td { background: var(--s3); }

/* Book name column — override monospace */
.ct-book {
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--txt-1) !important;
}

/* Timestamp column */
.ct-time {
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-size: 10px !important;
    color: var(--txt-3) !important;
    white-space: nowrap;
}

/* Best available price highlight */
.best-price {
    color: #22c55e !important;
    font-weight: 600 !important;
}

/* Best price pills below table */
.ct-best-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 18px;
}

.ct-best-pill {
    font-size: 10px;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(34,197,94,0.08);
    color: #22c55e;
    border: 0.5px solid rgba(34,197,94,0.2);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPARKLINE CHART
   ═══════════════════════════════════════════════════════════════════════════ */

.odds-sparkline {
    display: block;
    width: 100%;
    height: 52px;
    border-radius: 6px;
    background: var(--s3);
    margin-bottom: 10px;
}

/* ── Opening line row highlight in history table ──────────────────────────── */

.opening-row td {
    background: rgba(59,130,246,0.05) !important;
}

.open-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(59,130,246,0.12);
    color: #3b82f6;
    border: .5px solid rgba(59,130,246,0.25);
    margin-left: 5px;
    font-family: 'DM Sans', sans-serif;
    vertical-align: middle;
}

/* ── Single snapshot state ───────────────────────────────────────────────── */

.od-single-snap {
    padding: 10px 12px;
    border-radius: 6px;
    border: .5px solid var(--bd1);
    font-size: 11px;
    color: var(--txt-3);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Spread team labels in opening badge ──────────────────────────────────── */

.ob-team-line {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ob-abbr {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--txt-3);
}

.ob-sep {
    color: var(--txt-3);
    margin: 0 4px;
    font-size: 10px;
}