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

main {
    max-width: 1100px;
    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: 28px;
    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;
}

/* Race selector bar */
.race-selector-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
    justify-content: center;
}

.race-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(18,18,35,0.95);
    border: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    color: #ccc;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
    min-width: 120px;
    text-align: center;
}
.race-pill:hover {
    background: rgba(225,6,0,0.15);
    border-color: rgba(225,6,0,0.5);
    transform: translateY(-2px);
    color: #fff;
}
.race-pill.active {
    background: linear-gradient(90deg, rgba(225,6,0,0.25), rgba(0,188,212,0.15));
    border-color: #e10600;
    color: #fff;
}
.race-pill-name {
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.race-pill-date {
    font-size: 0.75rem;
    color: #888;
    margin-top: 2px;
}
.race-pill.active .race-pill-date { color: #aaa; }

/* Race results header */
.race-results-header {
    text-align: center;
    margin-bottom: 18px;
}
.race-results-header h3 {
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.race-meta {
    color: #90a4ae;
    font-size: 0.9rem;
    margin-top: 4px;
}

/* Results table */
.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(10,10,22,0.97);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0,0,0,0.9);
}
.results-table thead {
    background: linear-gradient(90deg, #050712, #121528);
}
.results-table thead th {
    color: #cfd8dc;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.results-table tbody tr:nth-child(even) { background: rgba(18,18,35,0.9); }
.results-table tbody tr:nth-child(odd) { background: rgba(11,11,25,0.97); }
.results-table tbody tr { transition: background 0.2s; }
.results-table tbody tr:hover { background: radial-gradient(circle at left, rgba(225,6,0,0.16) 0, rgba(18,18,40,0.98) 55%); }
.results-table td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    vertical-align: middle;
}

.pos-cell { width: 60px; text-align: center; font-size: 1.05rem; }
.driver-cell { display: flex; align-items: center; gap: 10px; }
.driver-thumb { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.5); }
.driver-link { color: #f0f0f0; text-decoration: none; font-weight: 600; }
.driver-link:hover { color: #ffb300; }
.points-cell { text-align: center; font-family: "Roboto Mono", monospace; }
.points-cell strong { color: #4dd0e1; font-size: 1.05rem; }
.laptime-cell { font-family: "Roboto Mono", monospace; white-space: nowrap; }
.laptime-fl { color: #ce93d8; font-weight: 700; font-size: 0.9rem; }
.laptime-normal { color: #b0bec5; font-size: 0.88rem; }
.laptime-empty { color: #444; }
.badges-cell { white-space: nowrap; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; margin-right: 4px; }
.badge-fl { background: linear-gradient(90deg, #7b2fff, #9c27b0); color: #fff; }
.badge-pp { background: linear-gradient(90deg, #f4c430, #ff9800); color: #111; }
.badge-dnf { background: linear-gradient(90deg, #e65100, #ff9800); color: #fff; }
.badge-dsq { background: linear-gradient(90deg, #b71c1c, #e53935); color: #fff; }

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

/* Info / error messages */
.info-message, .error-message {
    text-align: center;
    padding: 12px 16px;
    margin: 18px auto;
    border-radius: 999px;
    font-weight: 600;
    max-width: 520px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}
.info-message { background: rgba(0,172,193,0.12); color: #4dd0e1; border-color: rgba(0,172,193,0.5); }
.error-message { background: rgba(198,40,40,0.18); color: #ff8a80; border-color: rgba(239,83,80,0.8); }

@media (max-width: 768px) {
    .race-selector-bar { gap: 6px; }
    .race-pill { min-width: 100px; padding: 6px 10px; }
    .results-table thead { display: none; }
    .results-table, .results-table tbody, .results-table tr, .results-table td { display: block; width: 100%; }
    .results-table tr { margin-bottom: 10px; border-radius: 10px; overflow: hidden; }
    .results-table td { padding: 8px 12px; text-align: right; position: relative; padding-left: 45%; }
    .results-table td::before { content: attr(data-label); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 0.72rem; text-transform: uppercase; color: #90a4ae; }
    .driver-cell { padding-left: 12px; text-align: left; }
}
