* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors */
    --racing-red: #E10600;
    --jet-black: #101010;
    --bright-white: #FFFFFF;

    /* Alternate Colors */
    --neon-yellow: #FFD700;
    --electric-blue: #1E90FF;
    --flame-orange: #FF4500;

    /* Legacy mappings */
    --primary-color: var(--racing-red);
    --secondary-color: var(--electric-blue);
    --dark-bg: var(--jet-black);
    --light-bg: #f5f5f5;
    --text-dark: #333;
    --text-light: var(--bright-white);
    --border-color: #ddd;
    --hover-bg: #f0f0f0;
    --success-color: #4caf50;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

header {
    background: linear-gradient(135deg, var(--racing-red) 0%, var(--jet-black) 100%);
    color: var(--text-light);
    padding: 2rem 0;
    box-shadow: 0 4px 15px rgba(225, 6, 0, 0.3);
    border-bottom: 3px solid var(--neon-yellow);
}

header .header-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

header .logo {
    height: 60px;
    width: auto;
}

header h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

nav a:hover:not(.disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

nav a.active {
    background-color: rgba(255, 255, 255, 0.3);
    border-bottom: 3px solid var(--neon-yellow);
}

nav a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

main {
    padding: 4rem 0;
    min-height: calc(100vh - 200px);
}

.schedule-header {
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.schedule-header h2 {
    font-size: 2.75rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.season-info {
    color: #666;
    font-size: 1.15rem;
    font-weight: 500;
}

.season-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.season-selector:hover {
    border-color: var(--electric-blue);
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.2);
}

.season-selector label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.05rem;
}

.season-selector select {
    padding: 0.6rem 1.1rem;
    font-size: 1.05rem;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.3s ease;
    min-width: 150px;
}

.season-selector select:hover {
    border-color: var(--secondary-color);
}

.season-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.schedule-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    overflow-x: auto;
}

#loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.25rem;
    color: #666;
}

#error {
    text-align: center;
    padding: 2rem;
    font-size: 1.05rem;
    color: var(--racing-red);
    background: linear-gradient(135deg, rgba(225, 6, 0, 0.1) 0%, rgba(255, 69, 0, 0.1) 100%);
    border-radius: 8px;
    margin: 1rem 0;
    border: 2px solid rgba(225, 6, 0, 0.3);
    font-weight: 500;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background: linear-gradient(135deg, var(--racing-red) 0%, var(--jet-black) 100%);
    color: var(--text-light);
}

th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

td {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--hover-bg);
}

tbody tr.race-scheduled {
    opacity: 0.6;
}

tbody tr.race-completed {
    background-color: rgba(76, 175, 80, 0.08);
    border-left: 3px solid #4caf50;
}

tbody tr.race-highlighted {
    background-color: #fff3cd !important;
    border-left: 4px solid var(--racing-red) !important;
    box-shadow: 0 2px 8px rgba(225, 6, 0, 0.2);
}

tbody tr.playoff-header {
    background: linear-gradient(135deg, var(--neon-yellow) 0%, #ffed4e 100%);
    font-weight: bold;
    border-top: 3px solid var(--racing-red);
    border-bottom: 3px solid var(--racing-red);
}

tbody tr.playoff-header:hover {
    background: linear-gradient(135deg, var(--neon-yellow) 0%, #ffed4e 100%);
}

.playoff-header-cell {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 1.5rem !important;
    color: var(--jet-black);
    border: none !important;
    text-shadow: 0 1px 2px rgba(255, 215, 0, 0.3);
}

.playoff-icon {
    font-size: 1.6rem;
    margin-right: 0.5rem;
    filter: drop-shadow(0 2px 3px rgba(225, 6, 0, 0.3));
}

.race-number {
    font-weight: 700;
    color: var(--racing-red);
    font-size: 1.1rem;
}

.track-length {
    white-space: nowrap;
}

.winner-cell {
    font-weight: 600;
    color: var(--neon-yellow);
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
}

.pole-cell {
    font-weight: 500;
    color: var(--electric-blue);
}

.tbd {
    color: #999;
    font-style: italic;
}

footer {
    background: linear-gradient(135deg, var(--jet-black) 0%, #1a1a1a 100%);
    color: var(--text-light);
    text-align: center;
    padding: 2.5rem 0;
    margin-top: 4rem;
    border-top: 3px solid var(--racing-red);
    box-shadow: 0 -2px 10px rgba(225, 6, 0, 0.1);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    nav ul {
        gap: 1rem;
    }

    .schedule-header h2 {
        font-size: 1.8rem;
    }

    .schedule-content {
        padding: 1rem;
    }

    th, td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    th {
        font-size: 0.75rem;
    }
}
