* {
    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: repeat(4, 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;
}

.track-container {
    position: relative;
    grid-column: span 1;
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 20px;
}

.track-card {
    background-color: #ddd;
    padding: 20px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

img {
    width: 100%;
    height: auto;
}

.track-card:hover {
    background-color: #ccc;
}

.track-detail {
    position: absolute;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    opacity: 0;
    z-index: 10;
}

.track-container:hover .track-detail {
    max-height: 800px;
    opacity: 1;
    margin-top: 10px;
}

.track-detail h2 {
    border-bottom: 2px solid #e10600;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.track-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.track-image {
    flex: 1 1 300px;
    min-height: 200px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-info {
    flex: 2 1 400px;
}

.track-stats {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.track-stats th,
.track-stats td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.track-stats th {
    background-color: #f2f2f2;
}

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

video {
    width: 100%;
    height: auto;
    display: block;
}

audio {
    width: 100%;
    display: block;
}

@media print {
    .track-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .track-container {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .track-card {
        display: none;
    }

    .track-stats {
        font-size: 10pt;
    }
}

#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 .track-detail {
    color: #121212;
}

.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;
    }

    .team-car,
    .flag {
        max-width: 100%;
        height: auto;
    }
}


.track-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media screen and (min-width: 768px) {
    .track-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media screen and (min-width: 1024px) {
    .track-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}