/* race_detail.css */

:root {
    /* Farby - prispôsob si podľa tvojej témy */
    --primary-color: #e10600; /* Formula 1 červená */
    --secondary-color: #00bcd4; /* Nová accent farba */
    --text-color: #f0f0f0;
    --text-color-light: #aaaaaa;
    --bg-color: #121212;
    --card-bg-color: #1e1e1e;
    --border-color: #333;
    --link-color: #f0f0f0;
    --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
    --box-shadow-hover: 0 0 15px rgba(225, 6, 0, 0.3);
}

body {
    font-family: 'Roboto Condensed', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}

main {
    max-width: 1100px;
    margin: 40px auto;
    padding: 30px;
    background-color: var(--card-bg-color);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

h2, h3 {
    font-size: 2.5em;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 2px solid rgba(225, 6, 0, 0.3);
    padding-bottom: 15px;
}

.section-subtitle {
    font-size: 2em;
    letter-spacing: 1px;
}

.race-info-section {
    background-color: var(--bg-color);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    border-left: 5px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.race-info-section:hover {
    transform: translateY(-5px);
}

.race-info-section p {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Pomer strán 16:9 */
    height: 0;
    margin-bottom: 30px;
    background-color: var(--card-bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.7);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

.table-container {
    background-color: var(--card-bg-color);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 16px;
    margin: 0;
    table-layout: fixed;
}

.data-table thead th {
    background-color: var(--bg-color);
    color: var(--text-color-light);
    padding: 20px;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 2px;
    border-bottom: 3px solid var(--primary-color);
}

.data-table tbody tr {
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #2a2a2a;
    transform: scale(1.02);
    box-shadow: var(--box-shadow-hover);
    z-index: 10;
    position: relative;
}

.data-table tbody tr:nth-child(even) {
    background-color: #252525;
}

.data-table td {
    padding: 15px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table th:nth-child(1), .data-table td:nth-child(1) { width: 8%; text-align: center; }
.data-table th:nth-child(2), .data-table td:nth-child(2) { width: 35%; }
.data-table th:nth-child(3), .data-table td:nth-child(3) { width: 25%; }
.data-table th:nth-child(4), .data-table td:nth-child(4) { width: 12%; text-align: center; }
.data-table th:nth-child(5), .data-table td:nth-child(5) { width: 20%; text-align: center; }

.position-cell {
    font-weight: bold;
    color: #fff;
    font-size: 1.4em;
}

/* --- TOTO JE KĽÚČOVÁ ZMENA PRE ROZLOŽENIE --- */
.driver-name-cell, .team-name-cell {
    display: flex;
    align-items: center; /* Všetko v jednej línii */
    gap: 15px;
}

.name-wrapper {
    display: flex;
    flex-direction: column;
}
/* ----------------------------------------------- */

.driver-photo-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.driver-photo-thumb:hover {
    transform: scale(1.2);
    border-color: var(--secondary-color);
    cursor: pointer;
}

.table-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: color 0.2s ease;
}

.table-link:hover {
    color: var(--primary-color);
}

.points-cell {
    text-align: center;
    font-family: monospace;
    font-size: 1.2em;
    font-weight: bold;
}

.points-cell strong {
    font-size: 1.3em;
    color: var(--secondary-color);
}

.race-fastest-lap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--secondary-color);
    font-weight: bold;
    font-family: monospace;
}

.race-fastest-lap i {
    font-size: 1.2em;
}

.lap-time-normal {
    text-align: center;
    color: var(--text-color);
    font-weight: bold;
    font-family: monospace;
}

.no-team {
    color: var(--text-color-light);
    font-size: 1em;
    font-style: italic;
}

/* Responzívne zobrazenie pre mobilné zariadenia */
@media (max-width: 768px) {
    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        margin-bottom: 15px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    }

    .data-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid var(--border-color);
    }

    .data-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: bold;
        text-transform: uppercase;
        color: var(--primary-color);
        text-align: left;
    }
    
    .data-table tr:last-child td {
        border-bottom: 1px solid var(--border-color);
    }

    .data-table td:first-child {
        border-top-left-radius: 8px;
        border-top-right-radius: 8px;
    }

    .data-table td:last-child {
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    
    .hide-mobile {
        display: none;
    }
}