/* ══════════════════════════════════════════════════════
   historical.css — Historical Stats page only
   Requires /css/theme.css to be loaded first
   ══════════════════════════════════════════════════════ */

/* ── Loading State ── */
#loadingState {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50vh;
    color: var(--text-muted);
    font-family: var(--font-display);
    letter-spacing: 1px;
}

/* ── Search Row ── */
.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-wrap input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    font-size: 13px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gold-dim);
    font-size: 13px;
    pointer-events: none;
}

.filter-count {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--font-display);
    letter-spacing: 1px;
}

.search-clear {
    padding: 9px 14px;
    background: rgba(201,151,58,0.08);
    color: var(--gold-dim);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition);
    display: none;
}
.search-clear:hover  { background: rgba(201,151,58,0.16); color: var(--gold-light); }
.search-clear.visible { display: inline-flex; }

/* ── Table Container ── */
.table-container {
    max-height: 800px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.table-container::-webkit-scrollbar       { width: 6px; height: 6px; }
.table-container::-webkit-scrollbar-track { background: var(--bg-card); }
.table-container::-webkit-scrollbar-thumb { background: rgba(201,151,58,0.3); border-radius: 3px; }
.table-container::-webkit-scrollbar-thumb:hover { background: rgba(201,151,58,0.6); }

/* ── Stats Table ── */
#statsTable {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

#statsTable th {
    background: var(--bg-header);
    color: var(--gold);
    font-weight: 700;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--gold-border);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-family: var(--font-display);
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}
#statsTable th:hover { color: var(--gold-light); }

#statsTable td {
    padding: 13px 20px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
}

#statsTable tr:hover td  { background-color: rgba(201,151,58,0.04); }
#statsTable tr:last-child td { border-bottom: none; }

#statsTable td:first-child  { font-weight: 700; color: #fff; }
#statsTable td:nth-child(2) { color: var(--text-muted); font-size: 12px; }

#statsTable th:nth-child(n+3),
#statsTable td:nth-child(n+3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Sort Icon ── */
.sort-icon {
    display: inline-block;
    margin-left: 4px;
    color: var(--gold-light);
}

/* ── Search Highlight ── */
.highlight {
    background: rgba(201,151,58,0.2);
    border-radius: 2px;
    padding: 0 2px;
    color: var(--gold-light);
}

/* ── Top 3 Rank Colors ── */
.rank-1 { color: #ffd700 !important; }
.rank-2 { color: #c0c0c0 !important; }
.rank-3 { color: #cd7f32 !important; }
