/* =========================================================
   SlowscanTV — Dynamic Network Statistics
   /css/stats.css
========================================================= */

:root {
    --stats-green: #00ff55;
    --stats-green-dark: #008f3a;
    --stats-bg: #080808;
    --stats-panel: #111111;
    --stats-panel-2: #151515;
    --stats-border: #303030;
    --stats-text: #f3f3f3;
    --stats-muted: #a8a8a8;
}

body {
    background: var(--stats-bg);
    color: var(--stats-text);
}

.stats-home {
    padding-bottom: 0;
}

.stats-banner-home {
    display: block;
}

.stats-topbar {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.stats-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.network-stats-page {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto 60px;
}

.stats-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 32px;
    align-items: end;
    margin-bottom: 28px;
    padding: 30px;
    background: linear-gradient(145deg, #151515, #0b0b0b);
    border: 1px solid var(--stats-border);
    border-radius: 16px;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.35);
}

.stats-kicker,
.stats-section-label {
    color: var(--stats-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.stats-hero h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.stats-hero p {
    max-width: 820px;
    margin: 0;
    color: #c3c3c3;
    font-size: 1.04rem;
    line-height: 1.7;
}

.stats-updated {
    min-width: 230px;
    padding: 18px 20px;
    background: #0c160f;
    border: 1px solid #245d36;
    border-radius: 12px;
    text-align: right;
}

.stats-updated span,
.stats-updated small {
    display: block;
    color: var(--stats-muted);
}

.stats-updated strong {
    display: block;
    margin: 5px 0;
    color: var(--stats-green);
    font-size: 1.15rem;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.stats-summary-card,
.stats-record-card {
    padding: 20px;
    background: var(--stats-panel);
    border: 1px solid var(--stats-border);
    border-radius: 13px;
}

.stats-summary-card span,
.stats-record-card span {
    display: block;
    color: var(--stats-muted);
    font-size: 0.86rem;
}

.stats-summary-card strong {
    display: block;
    margin: 8px 0 4px;
    color: var(--stats-green);
    font-size: 2rem;
    line-height: 1;
}

.stats-summary-card small,
.stats-record-card small {
    color: #888;
}

.stats-period-section,
.stats-panel {
    margin-bottom: 28px;
    padding: 26px;
    background: linear-gradient(145deg, var(--stats-panel-2), #0b0b0b);
    border: 1px solid var(--stats-border);
    border-radius: 16px;
}

.stats-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.stats-section-heading.compact {
    align-items: center;
}

.stats-section-heading h2 {
    margin: 5px 0 0;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.stats-period-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-period-button {
    padding: 10px 14px;
    color: #ddd;
    background: #151515;
    border: 1px solid #383838;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 700;
}

.stats-period-button:hover,
.stats-period-button.active {
    color: var(--stats-green);
    border-color: var(--stats-green);
    background: #0c160f;
}

.stats-period-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stats-period-summary div {
    padding: 18px;
    background: #0d0d0d;
    border: 1px solid #282828;
    border-radius: 10px;
}

.stats-period-summary strong,
.stats-period-summary span {
    display: block;
}

.stats-period-summary strong {
    color: #fff;
    font-size: 1.65rem;
}

.stats-period-summary span {
    margin-top: 4px;
    color: var(--stats-muted);
}

.stats-highlight,
.stats-panel-note {
    color: var(--stats-muted);
    font-size: 0.9rem;
}

.stats-highlight strong {
    color: var(--stats-green);
}

.stats-daily-chart {
    height: 300px;
    display: grid;
    grid-template-columns: repeat(30, minmax(0, 1fr));
    align-items: end;
    gap: 5px;
    padding-top: 14px;
    border-top: 1px solid #242424;
}

.stats-day {
    height: 100%;
    min-width: 0;
    display: grid;
    grid-template-rows: 24px 1fr 24px;
    align-items: end;
    text-align: center;
}

.stats-day-value {
    overflow: hidden;
    color: #8e8e8e;
    font-size: 0.67rem;
    white-space: nowrap;
}

.stats-day-bar-wrap {
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.stats-day-bar {
    width: min(100%, 22px);
    min-height: 2px;
    background: linear-gradient(to top, #008f3a, #00ff55);
    border-radius: 5px 5px 2px 2px;
}

.stats-day > span {
    color: #777;
    font-size: 0.68rem;
}

.stats-two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
}

.stats-ranking {
    display: grid;
    gap: 7px;
}

.stats-rank-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    color: inherit;
    background: #0d0d0d;
    border: 1px solid #252525;
    border-radius: 9px;
    text-decoration: none;
}

.stats-rank-row:hover {
    border-color: #246d3b;
    background: #0e1711;
}

.stats-rank-number {
    color: #777;
    font-weight: 800;
    text-align: center;
}

.stats-rank-main {
    min-width: 0;
}

.stats-rank-main strong,
.stats-rank-main small {
    display: block;
}

.stats-rank-main strong {
    color: var(--stats-green);
    font-size: 1rem;
}

.stats-rank-main small {
    overflow: hidden;
    margin-top: 2px;
    color: #8f8f8f;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-rank-count {
    padding: 6px 9px;
    color: #fff;
    background: #171717;
    border-radius: 7px;
    font-weight: 800;
}

.stats-bars {
    display: grid;
    gap: 14px;
}

.stats-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 6px;
}

.stats-bar-label strong {
    color: #f0f0f0;
}

.stats-bar-label span {
    color: var(--stats-muted);
}

.stats-bar-track {
    height: 10px;
    overflow: hidden;
    background: #090909;
    border: 1px solid #282828;
    border-radius: 999px;
}

.stats-bar-track span {
    display: block;
    height: 100%;
    min-width: 2px;
    background: linear-gradient(90deg, #008f3a, #00ff55);
    border-radius: inherit;
}

.stats-records-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.stats-record-card strong {
    display: block;
    margin: 8px 0 5px;
    color: var(--stats-green);
    font-size: 1.25rem;
}

.stats-empty {
    margin: 0;
    padding: 20px;
    color: #999;
    text-align: center;
    background: #0c0c0c;
    border: 1px dashed #333;
    border-radius: 9px;
}

.stats-actions {
    text-align: center;
}

.stats-primary-button {
    display: inline-block;
    padding: 13px 21px;
    color: #fff;
    background: var(--stats-green-dark);
    border: 1px solid #00c950;
    border-radius: 9px;
    text-decoration: none;
    font-weight: 800;
}

.stats-primary-button:hover {
    background: #00b84a;
}

@media (max-width: 1120px) {
    .stats-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-records-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .stats-topbar,
    .stats-section-heading,
    .stats-hero {
        display: block;
    }

    .stats-menu {
        margin-top: 15px;
        justify-content: flex-start;
    }

    .stats-updated {
        margin-top: 22px;
        text-align: left;
    }

    .stats-period-buttons {
        margin-top: 16px;
    }

    .stats-two-column {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stats-period-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-daily-chart {
        overflow-x: auto;
        grid-template-columns: repeat(30, minmax(24px, 1fr));
    }
}

@media (max-width: 560px) {
    .network-stats-page,
    .stats-topbar {
        width: min(100% - 20px, 1320px);
    }

    .stats-summary-grid,
    .stats-records-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-summary-card,
    .stats-record-card,
    .stats-panel,
    .stats-period-section,
    .stats-hero {
        padding: 16px;
    }

    .stats-summary-card strong {
        font-size: 1.55rem;
    }

    .stats-period-summary {
        grid-template-columns: 1fr 1fr;
    }

    .stats-rank-row {
        grid-template-columns: 30px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 9px;
    }

    .stats-rank-main small {
        font-size: 0.72rem;
    }
}
