/*
 * stats.css
 * Štýly pre stats.php
 */

main {
    max-width: 1200px;
    margin: 36px auto;
    padding: 28px 24px;
    background: rgba(10,10,18,0.94);
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 30px rgba(225,6,0,0.08);
    position: relative;
    overflow: hidden;
}
main::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(circle at 10% 0%, rgba(225,6,0,0.15) 0, transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(0,188,212,0.15) 0, transparent 55%);
    opacity: 0.9;
    z-index: -1;
}

h2 {
    font-size: 2.1rem;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}
h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    margin: 10px auto 0;
    background: linear-gradient(90deg, #e10600, #00bcd4);
    border-radius: 999px;
}

.section-subtitle {
    font-size: 1.4rem;
    color: #fff;
    text-align: center;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.section-divider {
    border: none;
    height: 1px;
    margin: 32px 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* Stats grid layout: 2 columns on desktop */
.stats-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
    margin-bottom: 26px;
}

/* Individual stats card */
.stats-card {
    background: rgba(12,12,24,0.97);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.07);
    padding: 18px 16px;
    box-shadow: 0 14px 35px rgba(0,0,0,0.85);
    overflow: hidden;
    min-width: 0;
}
.stats-card h3 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #cfd8dc;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.stats-card h3 i {
    color: #e10600;
    margin-right: 8px;
}

/* Leaderboard table */
.stats-leaderboard {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
.stats-leaderboard thead th {
    color: #90a4ae;
    padding: 6px 6px;
    text-align: left;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}
.stats-leaderboard tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.2s;
}
.stats-leaderboard tbody tr:hover { background: rgba(225,6,0,0.08); }
.stats-leaderboard td {
    padding: 7px 6px;
    vertical-align: middle;
}
.rank-num {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    padding-right: 8px;
}
.driver-name-col {
    display: flex;
    align-items: center;
    gap: 8px;
}
.stat-thumb {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.stat-driver-link {
    color: #f0f0f0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    line-height: 1.3;
    word-break: break-word;
}
.stat-driver-link:hover { color: #ffb300; }
.stat-val {
    text-align: center;
    font-family: "Roboto Mono", monospace;
    font-size: 0.88rem;
    color: #4dd0e1;
    font-weight: 700;
    white-space: nowrap;
    padding-left: 4px;
    padding-right: 4px;
    width: 1%;
}

/* Gold/Silver/Bronze rows */
.rank-gold { background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, transparent 100%) !important; }
.rank-silver { background: linear-gradient(90deg, rgba(192,192,192,0.1) 0%, transparent 100%) !important; }
.rank-bronze { background: linear-gradient(90deg, rgba(205,127,50,0.1) 0%, transparent 100%) !important; }
.rank-gold .rank-num { color: #f4c430; }
.rank-silver .rank-num { color: #aaa; }
.rank-bronze .rank-num { color: #cd7f32; }

/* Full width table (completion rate) */
.full-width-table { margin-top: 10px; }

/* Completion rate bar */
.completion-bar-wrap {
    position: relative;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    height: 22px;
    min-width: 100px;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.completion-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, #e10600, #ff9800);
    border-radius: 999px;
    transition: width 0.4s;
}
.completion-bar-wrap span {
    position: relative;
    z-index: 1;
    padding-left: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
}

/* Info message */
.info-message {
    text-align: center;
    padding: 10px;
    color: #4dd0e1;
    font-size: 0.88rem;
}

@media (max-width: 768px) {
    .stats-grid-layout { grid-template-columns: 1fr; }
    .stats-leaderboard thead { display: none; }
    .stats-leaderboard tbody tr { display: block; margin-bottom: 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.06); }
    .stats-leaderboard td { display: block; text-align: right; padding: 7px 12px; position: relative; padding-left: 50%; }
    .stats-leaderboard td::before { content: attr(data-label); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #90a4ae; font-size: 0.72rem; text-transform: uppercase; }
    .driver-name-col { padding-left: 12px; text-align: left; justify-content: flex-start; }
}

/* DNF / DSQ badges in stats table */
.badge-dnf-sm,
.badge-dsq-sm {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 999px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-dnf-sm {
    background: rgba(230, 81, 0, 0.18);
    color: #ff8a65;
    border: 1px solid rgba(230, 81, 0, 0.4);
}
.badge-dsq-sm {
    background: rgba(183, 28, 28, 0.18);
    color: #ef9a9a;
    border: 1px solid rgba(183, 28, 28, 0.4);
}
