/* Training Timeline — Dark theme */
:root {
    --bg: #0a0a1a;
    --bg-card: #111128;
    --bg-row: #0e0e24;
    --bg-row-alt: #12122a;
    --border: rgba(255,255,255,0.06);
    --text: #e0e0e0;
    --text-dim: #8892a4;
    --accent: #00e5ff;
    --accent-dim: rgba(0,229,255,0.15);
    --font: 'Segoe UI', 'Roboto', sans-serif;
    --font-mono: 'Cascadia Code', 'Fira Code', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.tl-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(14,14,40,0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.tl-back {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.tl-back:hover { text-decoration: underline; }

.tl-titles { display: flex; flex-direction: column; }

.tl-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.tl-subtitle {
    font-size: 0.75rem;
    color: var(--text-dim);
    line-height: 1.2;
}

/* Main content */
.tl-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Stats bar */
.tl-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tl-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    transition: border-color 0.2s;
}
.tl-stat-card:hover {
    border-color: var(--accent-dim);
}

.tl-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

.tl-stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Canvas container */
.tl-canvas-wrap {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

#timeline-canvas {
    width: 100%;
    height: 400px;
    display: block;
}

/* Tooltip */
.tl-tooltip {
    position: absolute;
    background: rgba(10,10,26,0.95);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    font-size: 0.78rem;
    color: var(--text);
    pointer-events: none;
    z-index: 20;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: opacity 0.12s;
}

.tl-tooltip[hidden] { display: block; opacity: 0; }

.tl-tooltip-name {
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.tl-tooltip-cat {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.tl-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.tl-tooltip-label { color: var(--text-dim); }
.tl-tooltip-val { color: var(--accent); font-family: var(--font-mono); }

/* Category filter chips */
.tl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    font-size: 0.7rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    transition: all 0.15s;
    user-select: none;
}
.tl-chip:hover {
    border-color: rgba(255,255,255,0.15);
    color: var(--text);
}
.tl-chip.active {
    border-color: var(--accent-dim);
    background: rgba(0,229,255,0.08);
    color: var(--accent);
}

.tl-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Table */
.tl-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
}

.tl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.tl-table thead th {
    padding: 0.75rem 0.85rem;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    position: relative;
}
.tl-table thead th:hover { color: var(--text); }

.tl-table thead th.sorted-asc::after,
.tl-table thead th.sorted-desc::after {
    margin-left: 0.3rem;
    font-size: 0.6rem;
}
.tl-table thead th.sorted-asc::after { content: '\25B2'; color: var(--accent); }
.tl-table thead th.sorted-desc::after { content: '\25BC'; color: var(--accent); }

.tl-bar-col { width: 180px; min-width: 120px; }

.tl-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.12s;
}
.tl-table tbody tr:nth-child(odd) { background: var(--bg-row); }
.tl-table tbody tr:nth-child(even) { background: var(--bg-row-alt); }
.tl-table tbody tr:hover { background: rgba(0,229,255,0.04); }

.tl-table tbody td {
    padding: 0.6rem 0.85rem;
    vertical-align: middle;
}

.tl-rank {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.75rem;
}

.tl-bot-name {
    font-weight: 600;
    color: #fff;
}

.tl-bot-cat {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
}

.tl-cat-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tl-num {
    font-family: var(--font-mono);
    color: var(--text);
    font-size: 0.8rem;
}

/* Inline bar chart in table */
.tl-bar-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tl-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: hidden;
}

.tl-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .tl-header { gap: 0.75rem; padding: 0.6rem 1rem; }
    .tl-main { padding: 1rem; }
    .tl-stats { grid-template-columns: 1fr; gap: 0.6rem; }
    .tl-stat-card { flex-direction: row; justify-content: space-between; padding: 0.85rem 1rem; }
    .tl-stat-value { font-size: 1.3rem; }
    #timeline-canvas { height: 280px; }
    .tl-bar-col { width: 100px; min-width: 80px; }
    .tl-table { font-size: 0.75rem; }
    .tl-table thead th { padding: 0.6rem; }
    .tl-table tbody td { padding: 0.45rem 0.6rem; }
}

@media (max-width: 480px) {
    .tl-stats { gap: 0.4rem; }
    #timeline-canvas { height: 220px; }
    .tl-title { font-size: 0.95rem; }
    .tl-filters { gap: 0.3rem; }
    .tl-chip { font-size: 0.6rem; padding: 0.25rem 0.55rem; }
}
