/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #22263a;
    --border: #2a2e3e;
    --text: #e4e6ed;
    --text-muted: #8b8fa3;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --green: #00b894;
    --green-bg: rgba(0, 184, 148, 0.12);
    --red: #e17055;
    --red-bg: rgba(225, 112, 85, 0.12);
    --yellow: #fdcb6e;
    --home-color: #74b9ff;
    --away-color: #fd79a8;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}

html { font-size: 15px; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.container-fluid { max-width: 100%; margin: 0 auto; padding: 0 2rem; width: 100%; }

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.nav-brand:hover { text-decoration: none; color: var(--accent-light); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent-light); border-bottom-color: var(--accent-light); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* ── Page Header ─────────────────────────────────────────────────────────── */
.page-header { margin: 2rem 0 1.5rem; }
.page-header h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.02em; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.25rem; }

/* ── Section Titles ──────────────────────────────────────────────────────── */
.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-title .icon { color: var(--yellow); font-size: 1.2rem; }
.section-subtitle { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1rem; }

/* ── Sport Tabs ──────────────────────────────────────────────────────────── */
.sport-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.sport-tab {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.sport-tab:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.sport-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Model Selector ──────────────────────────────────────────────────────── */
.model-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
.model-selector-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.25rem;
}
.model-pill {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.model-pill:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.model-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ── Best Bets ───────────────────────────────────────────────────────────── */
.best-bets-section { margin-bottom: 2.5rem; }
.best-bets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.best-bet-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    transition: transform 0.15s, box-shadow 0.15s;
}
.best-bet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.best-bet-badge {
    display: inline-block;
    background: var(--green-bg);
    color: var(--green);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}
.best-bet-teams { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.home-team { color: var(--home-color); }
.away-team { color: var(--away-color); }
.at-symbol { color: var(--text-muted); margin: 0 0.3rem; font-weight: 400; }
.best-bet-time { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.best-bet-pick { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.best-bet-probs { font-size: 0.85rem; color: var(--text-muted); }
.best-bet-confidence { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.5rem; }

/* Market info in best bet cards */
.best-bet-market {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
}
.market-line-label {
    color: var(--yellow);
    font-weight: 600;
}
.market-detail-label {
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* Market odds in table */
.cell-line {
    white-space: nowrap;
    font-size: 0.85rem;
}
.line-value {
    font-weight: 700;
    color: var(--yellow);
}
.line-detail {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 1px;
}
.line-arrow {
    display: inline-block;
    font-size: 0.7rem;
    margin-left: 3px;
    vertical-align: middle;
}
.line-arrow-up {
    color: var(--green);
}
.line-arrow-down {
    color: var(--red);
}

/* Probability bars */
.prob-bar-container {
    display: flex;
    gap: 2px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
    height: 24px;
    font-size: 0.75rem;
    font-weight: 600;
}
.prob-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    color: #fff;
    transition: width 0.3s ease;
}
.home-bar { background: var(--home-color); }
.away-bar { background: var(--away-color); }

/* ── Predictions Table ───────────────────────────────────────────────────── */
.predictions-section { margin-bottom: 2.5rem; }
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.predictions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.predictions-table th {
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.predictions-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.predictions-table tbody tr { background: var(--surface); transition: background 0.15s; }
.predictions-table tbody tr:hover { background: var(--surface-hover); }
.predictions-table .text-right { text-align: right; }

.cell-time { white-space: nowrap; color: var(--text-muted); font-size: 0.82rem; }
.cell-matchup { white-space: nowrap; font-weight: 500; }
.cell-model .tag { font-size: 0.72rem; }

/* Inline probability bars in table */
.inline-bar {
    position: relative;
    background: var(--bg);
    border-radius: 4px;
    height: 22px;
    min-width: 80px;
    overflow: hidden;
}
.inline-bar-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    border-radius: 4px;
    transition: width 0.3s ease;
}
.home-fill { background: rgba(116, 185, 255, 0.3); }
.away-fill { background: rgba(253, 121, 168, 0.3); }
.inline-bar-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tags & Pills */

/* ── Today's Results ─────────────────────────────────────────────────────── */
.results-section { margin-bottom: 2.5rem; }
.result-correct { border-left: 3px solid var(--green); }
.result-wrong { border-left: 3px solid var(--red); }

/* ── Date Navigator ──────────────────────────────────────────────────────── */
.date-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}
.date-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.15s;
}
.date-nav-btn:hover { background: var(--accent); color: #fff; }
.date-nav-disabled {
    opacity: 0.3;
    pointer-events: none;
}
.date-nav-center {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.date-picker {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    cursor: pointer;
    z-index: 1;
}
.date-nav-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.25rem 0.75rem;
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
}
.date-nav-today {
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.25rem;
}
.date-nav-today:hover { text-decoration: underline; }

/* ── Live Game Indicators ────────────────────────────────────────────────── */
.live-badge {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    line-height: 1.2;
    vertical-align: middle;
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.row-live {
    border-left: 3px solid var(--red);
    background: rgba(225, 112, 85, 0.05) !important;
}
.row-live:hover {
    background: rgba(225, 112, 85, 0.10) !important;
}
.best-bet-live {
    border-color: var(--red);
    box-shadow: 0 0 0 1px rgba(225, 112, 85, 0.3);
}
.cell-score {
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 700;
}
.result-hit {
    background: var(--green-bg);
    color: var(--green);
}
.result-miss {
    background: var(--red-bg);
    color: var(--red);
}
.predictions-table .text-center { text-align: center; }

.tag {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.confidence-pill {
    font-weight: 600;
    font-size: 0.82rem;
}

/* Bet pick pills */
.cell-pick { white-space: nowrap; }
.pick-pill {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}
.pick-home { background: rgba(116, 185, 255, 0.18); color: var(--home-color); }
.pick-away { background: rgba(253, 121, 168, 0.18); color: var(--away-color); }
.pick-spread { background: rgba(162, 155, 254, 0.18); color: var(--accent-light); }
.pick-over { background: var(--green-bg); color: var(--green); }
.pick-under { background: var(--red-bg); color: var(--red); }

/* Bet type labels */
.bet-type-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.bet-type-ml { background: rgba(116, 185, 255, 0.18); color: var(--home-color); }
.bet-type-spread { background: rgba(162, 155, 254, 0.18); color: var(--accent-light); }
.bet-type-ou { background: rgba(253, 203, 110, 0.18); color: var(--yellow); }

.edge-pill {
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}
.edge-positive { background: var(--green-bg); color: var(--green); }
.edge-negative { background: var(--red-bg); color: var(--red); }

/* ── Stats Grid ──────────────────────────────────────────────────────────── */
.stats-section { margin-bottom: 2.5rem; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
}
.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-light);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ── Models Grid ─────────────────────────────────────────────────────────── */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.model-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.model-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.model-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.25rem; }
.model-name { font-size: 1rem; font-weight: 600; }
.model-sport { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 1rem; }
.model-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.metric { text-align: center; }
.metric-value { display: block; font-size: 1.15rem; font-weight: 700; color: var(--accent-light); }
.metric-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.model-samples { font-size: 0.8rem; color: var(--text-muted); }

/* ── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.empty-state p { margin-bottom: 0.5rem; }
.empty-hint { font-size: 0.85rem; }
.empty-state code {
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.82rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .container-fluid { padding: 0 1rem; }
    .page-header h1 { font-size: 1.4rem; }
    .best-bets-grid { grid-template-columns: 1fr; }
    .models-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .predictions-table { font-size: 0.78rem; }
    .predictions-table th, .predictions-table td { padding: 0.5rem 0.6rem; }
}
