/* The game log panel shared by the Player Stats page and a player's page:
 * stat cards over a chart and a game log, side by side (game_log_panel.jsx). */

/* --- Stat cards ----------------------------------------------------------- */

.lc-glp-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.lc-glp-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.lc-glp-card-value {
    font-size: 2.8rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #f5f5f5;
    line-height: 1.2;
    font-family: "JetBrains Mono", monospace;
}

.lc-glp-card-label {
    font-size: 0.92rem;
    color: #8b8fa8;
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: Outfit, sans-serif;
}

/* --- Layout: chart narrow, game log wide ----------------------------------- */

.lc-glp-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 16px;
}

.lc-glp-loading {
    padding: 32px 0;
    text-align: center;
    color: #8b8fa8;
    font-size: 0.95rem;
}

/* --- Tabs: the chart's stat tabs and the log's Basic/Advanced toggle ------ */

.lc-glp-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 3px;
}

.lc-glp-tab {
    padding: 5px 14px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #8b8fa8;
    font-family: Outfit, sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
}

.lc-glp-tab:hover {
    color: #c5cad3;
    background: rgba(255, 255, 255, 0.04);
}

.lc-glp-tab.active {
    background: rgba(79, 143, 255, 0.15);
    color: #4f8fff;
}

.lc-glp-tab:focus-visible {
    outline: 2px solid #4f8fff;
    outline-offset: 1px;
}

/* --- Chart ------------------------------------------------------------------ */

.lc-glp-chart {
    min-width: 0;
    background: #0f1923;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 16px;
}

.lc-glp-chart-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.lc-glp-chart-mode {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8b8fa8;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2px 8px;
    font-family: "JetBrains Mono", monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lc-glp-empty {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b8fa8;
    font-size: 0.9rem;
}

/* --- Game log ---------------------------------------------------------------- */

.lc-glp-log {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #0f1923;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 16px;
}

.lc-glp-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.lc-glp-log-title {
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    font-family: Outfit, sans-serif;
    white-space: nowrap;
}

.lc-glp-log-header .lc-glp-tab { padding: 3px 12px; font-size: 0.9rem; }

/* Scrolls on both axes, so the Advanced columns slide rather than squeeze. */
.lc-glp-scroll {
    flex: 1;
    max-height: 260px;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #2a2d42 transparent;
}

.lc-glp-scroll::-webkit-scrollbar         { width: 6px; height: 6px; }
.lc-glp-scroll::-webkit-scrollbar-track    { background: transparent; }
.lc-glp-scroll::-webkit-scrollbar-thumb    { background: #2a2d42; border-radius: 3px; }
.lc-glp-scroll::-webkit-scrollbar-corner   { background: transparent; }

.lc-glp-table {
    min-width: 100%;
    width: max-content;
    border-collapse: collapse;
}

.lc-glp-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f1923;
    text-align: right;
}

/* Sort buttons that read as the header text. */
.lc-glp-table th > button {
    width: 100%;
    padding: 4px 8px;
    border: 0;
    background: none;
    color: #8b8fa8;
    font-family: Outfit, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-align: inherit;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.lc-glp-table th > button:hover { color: #c7cdd9; }
.lc-glp-table th > button:focus-visible { outline: 2px solid #4f8fff; outline-offset: -2px; }
.lc-glp-table th.lc-glp-sorted > button { color: #4f8fff; }

.lc-glp-table td {
    padding: 9px 12px;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    font-family: "JetBrains Mono", monospace;
    text-align: right;
    color: #e2e8f0;
    white-space: nowrap;
}

/* Week (or year) left, opponent centred, the numbers right. */
.lc-glp-table th:first-child,
.lc-glp-table td:first-child { text-align: left; }

.lc-glp-table tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.02); }
.lc-glp-table tbody tr:hover td { background: rgba(79, 143, 255, 0.06); }

a.lc-glp-badge { text-decoration: none; }

.lc-glp-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: Outfit, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.lc-glp-totals td {
    border-top: 2px solid rgba(79, 143, 255, 0.25);
    background: rgba(79, 143, 255, 0.04);
    font-weight: 700;
    color: #c8ccd8;
}

.lc-glp-totals td:first-child {
    color: #4f8fff;
    font-weight: 800;
    letter-spacing: 0.06em;
}

/* Header tooltips: what an abbreviation means, on hover. Anchored to the
   header's right edge, since the log can be wider than its box. */
.lc-glp-table th[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 100;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: #1e2030;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #c7cdd9;
    font-family: Outfit, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    white-space: nowrap;
    pointer-events: none;
}

/* --- Narrow screens: stacked ------------------------------------------------ */

@media (max-width: 900px) {
    .lc-glp-cards { grid-template-columns: repeat(2, 1fr); }
    .lc-glp-content { grid-template-columns: minmax(0, 1fr); }
}

/* Phone: one row per game, as sports sites do it. The week and opponent are
   frozen on the left and the stats scroll sideways under them, so a row
   always reads as one game; compact type fits most of the Basic columns on
   screen at once. The log runs its full length rather than scrolling inside
   a box of its own. */
@media (max-width: 600px) {
    .lc-glp-card-value { font-size: 2rem; }
    .lc-glp-chart,
    .lc-glp-log { padding: 10px 8px; }

    .lc-glp-scroll { max-height: none; }
    .lc-glp-chart .lc-glp-tabs { flex-wrap: wrap; }
    .lc-glp-chart .lc-glp-tab { padding: 4px 10px; font-size: 0.9rem; }

    .lc-glp-table td { padding: 7px 7px; font-size: 0.85rem; }
    .lc-glp-table th > button { padding: 4px 7px; font-size: 0.72rem; letter-spacing: 0; }
    .lc-glp-badge { padding: 2px 4px; letter-spacing: 0.02em; }

    /* Frozen identifier columns. Solid backgrounds, so the stats scroll
       beneath them rather than showing through. */
    .lc-glp-table th:nth-child(-n + 2),
    .lc-glp-table td:nth-child(-n + 2) {
        position: sticky;
        z-index: 1;
        background: #0f1923;
    }
    .lc-glp-table th:nth-child(-n + 2) { z-index: 2; }
    .lc-glp-table th:first-child,
    .lc-glp-table td:first-child { left: 0; width: 2.4rem; min-width: 2.4rem; }
    .lc-glp-table th:nth-child(2),
    .lc-glp-table td:nth-child(2) {
        left: 2.4rem;
        box-shadow: 6px 0 6px -4px rgba(0, 0, 0, 0.55);
    }
    .lc-glp-table tbody tr:nth-child(odd) td:nth-child(-n + 2) { background: #131c27; }
    .lc-glp-table tbody tr:hover td:nth-child(-n + 2) { background: #142338; }
    .lc-glp-totals td:nth-child(-n + 2) { background: #111d2e; }

    /* Tooltips have no hover on a phone. */
    .lc-glp-table th[data-tip]:hover::after { display: none; }
}
