* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    text-align: left;
    max-width: 100%;
}

img,
video,
audio,
table {
    max-width: 100%;
    height: auto;
}

body {
    background-color: #f9f9f9;
}

.container {
    padding: 0 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border: 1px solid #333;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    gap: 10px;
    padding: 0 10px 10px;
}

.header {
    background-color: #e10600;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
}

.menu-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.menu-button {
    background-color: white;
    color: #333;
    padding: 10px 15px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
}

.menu-button:hover {
    background-color: #333;
    color: white;
}



.teams-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border-radius: 8px;
}

.teams-table th,
.teams-table td {
    padding: 15px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.teams-table th {
    background-color: #222;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.teams-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.teams-table tr:hover {
    background-color: #f0f0f0;
}

.champion-team {
    background-color: rgba(255, 215, 0, 0.1) !important;
}

.champion-team td:first-child {
    border-left: 5px solid #ffd700;
}

.team-car {
    max-width: 280px;
    max-height: 150px;
    display: block;
    margin: 10px 0;
    border-radius: 5px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.team-car:hover {
    transform: scale(1.05);
}

.flag {
    height: 13px;
    vertical-align: middle;
    margin-left: 5px;
    margin-right: 5px;
}

.team-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #111;
}

.car-model {
    font-style: italic;
    color: #666;
    font-size: 0.9em;
}

.team-points {
    font-weight: bold;
    color: #e10600;
}

.driver-name {
    font-weight: bold;
    margin: 5px 0;
    display: block;
}

footer {
    margin-top: 30px;
    text-align: center;
    color: #777;
    font-size: 1rem;
    padding: 15px;
    border-top: 1px solid #ddd;
}

@media screen and (max-width: 768px) {
    .teams-table {
        display: block;
        overflow-x: auto;
    }

    .teams-table th,
    .teams-table td {
        padding: 10px;
        font-size: 14px;
    }

    .team-car {
        max-width: 200px;
    }
}

@media print {
    .teams-details {
        display: block !important;
    }

    .teams-details summary {
        display: none;
    }

    .champion-team {
        background-color: #ffffe0 !important;
    }
}

#dark-mode-toggle {
    background-color: #333;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

#dark-mode-toggle:hover {
    background-color: #555;
}

.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode main {
    background-color: rgba(30, 30, 30, 0.9);
    color: #e0e0e0;
}

.dark-mode .header,
.dark-mode .footer {
    background-color: #1a1a1a;
}

.dark-mode .menu-button {
    background-color: #333;
    color: #e0e0e0;
}

.dark-mode .menu-button:hover {
    background-color: #e10600;
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
    background-color: #333;
    color: #e0e0e0;
    border-color: #555;
}

.dark-mode input[type="submit"],
.dark-mode input[type="reset"] {
    background-color: #333;
    color: #e0e0e0;
}

.dark-mode input[type="submit"]:hover,
.dark-mode input[type="reset"]:hover {
    background-color: #e10600;
    color: white;
}

.dark-mode .teams-table {
    color: #121212;
}

.dark-mode caption {
    color: #e0e0e0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #e10600;
    color: white;
    padding: 8px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #000;
}


@media screen and (max-width: 768px) {

    .content-table,
    .teams-table,
    .track-stats {
        display: block;
        overflow-x: auto;
        width: 100%;
    }

    .content-table th,
    .content-table td,
    .teams-table th,
    .teams-table td,
    .track-stats th,
    .track-stats td {
        font-size: 14px;
        padding: 10px;
    }
}