﻿/* ===== BASE STYLES ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== LATEST ENTRIES SECTION ===== */
.latest-entries-section {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.latest-entries-header {
    text-align: center;
    margin-bottom: 25px;
}

    .latest-entries-header h2 {
        color: #2c3e50;
        font-size: 2em;
        font-weight: 700;
        margin: 0 0 10px 0;
    }

.latest-entries-subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
    margin: 0;
}

.latest-entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.latest-entry-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #3498db;
    width: 100%;
    box-sizing: border-box;
}

    .latest-entry-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    }

.latest-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #ecf0f1;
}

    .latest-entry-header h3 {
        margin: 0;
        color: #2c3e50;
        font-size: 1.3em;
        font-weight: 600;
    }

.latest-entry-badge {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.latest-race-info {
    margin-bottom: 15px;
}

.latest-race-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

    .latest-race-link:hover {
        transform: translateX(5px);
    }

    .latest-race-link h4 {
        margin: 0 0 6px 0;
        color: #2c3e50;
        font-size: 1.1em;
        font-weight: 600;
    }

.latest-race-date {
    margin: 0 0 10px 0;
    color: #7f8c8d;
    font-size: 0.9em;
    font-weight: 500;
}

.latest-race-type {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

    .latest-race-type.grand-prix {
        background: linear-gradient(135deg, #e8f5e8, #27ae60);
        color: #fff;
    }

    .latest-race-type.sprint {
        background: linear-gradient(135deg, #e3f2fd, #1976d2);
        color: #fff;
    }

/* Driver Performance Highlights */
.driver-performance-highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.driver-highlight-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .driver-highlight-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .driver-highlight-card.gain {
        border-color: #27ae60;
        background: linear-gradient(135deg, #f8fff8, #e8f5e8);
    }

    .driver-highlight-card.loss {
        border-color: #e74c3c;
        background: linear-gradient(135deg, #fff8f8, #fdeaea);
    }

.highlight-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.highlight-icon {
    font-size: 1.1em;
}

.highlight-title {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gain .highlight-title {
    color: #27ae60;
}

.loss .highlight-title {
    color: #e74c3c;
}

.highlight-driver {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.highlight-driver-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ecf0f1;
}

.highlight-driver-name {
    font-size: 0.6em;
    font-weight: 300;
    color: #2c3e50;
    text-align: center;
    line-height: 1.2;
}

.highlight-change {
    font-size: 1.1em;
    font-weight: 800;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 15px;
    display: inline-block;
}

.gain .highlight-change {
    background: #d5f4e6;
    color: #27ae60;
}

.loss .highlight-change {
    background: #fdeaea;
    color: #e74c3c;
}

.no-highlight-message {
    font-size: 0.85em;
    color: #7f8c8d;
    font-style: italic;
    padding: 10px 0;
    text-align: center;
    margin: auto 0;
}

/* ===== DRIVER GRID STYLES ===== */
.driver-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.driver-card {
    border: 2px solid #333;
    border-radius: 10px;
    padding: 20px;
    width: 280px;
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    box-sizing: border-box;
}

    .driver-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }

.driver-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.driver-image {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}

.driver-info-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.driver-name-large {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 5px;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

    .driver-name-large:hover {
        color: #3498db;
        transform: translateY(-1px);
    }

.team-name {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    line-height: 1.3;
}

.race-count {
    font-size: 14px;
    color: #888;
    margin-top: 5px;
}

.elo-score {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.rank-badge {
    background-color: #007bff;
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 5px;
}

.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A9A9A9 100%);
    color: #000;
}

.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: #fff;
}

/* ===== CLICKABLE DRIVER STYLES ===== */
.clickable-driver {
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .clickable-driver:hover {
        color: #3498db;
        transform: translateY(-1px);
        text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

.driver-cell .driver-name {
    font-weight: 600;
    font-size: 1.1em;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .driver-cell .driver-name:hover {
        background: #f8f9fa;
        color: #3498db;
        transform: translateX(3px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

/* ===== POSITION CHANGE INDICATORS ===== */
.position-change {
    font-size: 1.2em;
    margin-left: 8px;
    vertical-align: middle;
}

    .position-change.up {
        color: #27ae60;
    }

    .position-change.down {
        color: #e74c3c;
    }

    .position-change.same {
        color: #95a5a6;
        opacity: 0.7;
    }

    .position-change.new {
        color: #3498db;
    }

/* ===== RACE RESULTS STYLES ===== */
.race-header {
    text-align: center;
    margin: 20px 0;
}

.race-title {
    margin: 0;
    color: #2c3e50;
    font-size: 2.5em;
    font-weight: 700;
}

.race-subtitle {
    text-align: center;
    margin-top: 8px;
    font-size: 1.2em;
    color: #7f8c8d;
    font-weight: 500;
}

.race-date {
    text-align: center;
    margin-top: 8px;
    font-size: 1.2em;
    color: #95a5a6;
    font-weight: 400;
}

.race-navigation {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
}

.nav-button {
    background: white;
    color: #2c3e50;
    border: 2px solid #2c3e50;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

    .nav-button:hover {
        background: #2c3e50;
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

.race-results-container {
    max-width: 1400px;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

.race-results-table {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-collapse: collapse;
}

    .race-results-table thead {
        background: #2c3e50;
    }

    .race-results-table th {
        padding: 20px 15px;
        text-align: left;
        color: white;
        font-weight: 600;
        font-size: 0.9em;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .race-results-table tbody tr {
        border-bottom: 1px solid #ecf0f1;
        transition: all 0.3s ease;
    }

        .race-results-table tbody tr:hover {
            background-color: #f8f9fa;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }

    .race-results-table td {
        padding: 18px 15px;
        vertical-align: middle;
    }

.position-cell {
    font-size: 1.3em;
    font-weight: 700;
    text-align: center;
    width: 80px;
    color: #2c3e50;
}

.driver-cell {
    width: 25%;
}

.driver-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.driver-headshot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ecf0f1;
}

.team-cell {
    width: 20%;
}

.rating-change-cell {
    width: 120px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
}

.rating-change-positive {
    color: #27ae60;
}

.rating-change-negative {
    color: #e74c3c;
}

.rating-change-neutral {
    color: #95a5a6;
}

.new-rating-cell {
    width: 120px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
    color: #2c3e50;
    background: #f8f9fa;
    border-radius: 8px;
}

.modifiers-cell {
    width: 25%;
    font-size: 0.85em;
    color: #5d6d7e;
}

.modifiers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modifier-tag {
    background: #ecf0f1;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.modifier-positive {
    background: #d5f4e6;
    color: #27ae60;
}

.modifier-negative {
    background: #fdeaea;
    color: #e74c3c;
}

.modifier-neutral {
    background: #f8f9fa;
    color: #7f8c8d;
}

.podium-row {
    background: #fff9e6;
}

.points-row {
    background: #f8f9fa;
}

.dnf-row {
    background: #fdeaea;
}

/* ===== GAIN/LOSS SECTION ===== */
.gain-loss-section {
    max-width: 1400px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
}

.gain-loss-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.gain-loss-card {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

    .gain-loss-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 35px rgba(0,0,0,0.15);
    }

.gain-card {
    border-top: 5px solid #27ae60;
}

.loss-card {
    border-top: 5px solid #e74c3c;
}

.gain-loss-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.gain-loss-title {
    font-size: 1.4em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gain-card .gain-loss-title {
    color: #27ae60;
}

.loss-card .gain-loss-title {
    color: #e74c3c;
}

.gain-icon, .loss-icon {
    font-size: 1.5em;
    font-weight: bold;
}

.driver-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.driver-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ecf0f1;
}

.driver-name-display {
    font-size: 1.3em;
    font-weight: 700;
    color: #2c3e50;
}

.driver-position {
    font-size: 1em;
    color: #7f8c8d;
    font-weight: 500;
}

.elo-change {
    font-size: 2em;
    font-weight: 800;
    margin-top: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

.gain-card .elo-change {
    background: #d5f4e6;
    color: #27ae60;
}

.loss-card .elo-change {
    background: #fdeaea;
    color: #e74c3c;
}

.no-change-message {
    font-size: 1.1em;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px 0;
}

/* ===== SEARCH & COMMON COMPONENTS ===== */
.search-container {
    text-align: center;
    margin: 20px 0;
    background: transparent;
    padding: 20px;
    border-radius: 10px;
    box-shadow: none;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.search-bar {
    width: 100%;
    max-width: 500px;
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

    .search-bar:focus {
        border-color: #007bff;
    }

    .search-bar::placeholder {
        color: #999;
    }

.footer {
    background: white;
    padding: 20px;
    margin-top: 40px;
    text-align: center;
    font-size: 12px;
    color: #666;
    line-height: 1.6;
    width: 100%;
    box-sizing: border-box;
}

    .footer p {
        margin: 5px 0;
    }

.last-updated {
    font-weight: bold;
    color: #333;
}

.disclaimer {
    font-style: italic;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
}

.data-source {
    text-align: center;
    margin: 10px 0 0 0;
}

    .data-source a {
        color: #007bff;
        text-decoration: none;
    }

.no-races {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
    flex: 1;
}

/* ===== HAMBURGER MENU & OVERLAYS ===== */
.hamburger-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
}

.hamburger-icon {
    width: 35px;
    height: 30px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

    .hamburger-icon:hover {
        background: white;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        transform: scale(1.05);
    }

    .hamburger-icon span {
        display: block;
        height: 3px;
        width: 100%;
        background: #2c3e50;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

.menu-content {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 20px rgba(0,0,0,0.3);
    transition: left 0.4s ease;
    z-index: 1002;
    display: flex;
    flex-direction: column;
}

.menu-header {
    padding: 20px;
    background: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .menu-header h3 {
        margin: 0;
        font-size: 1.2em;
        font-weight: 600;
    }

.close-menu {
    font-size: 28px;
    cursor: pointer;
    color: white;
    transition: color 0.3s ease;
}

.menu-section {
    padding: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.menu-button {
    width: 100%;
    padding: 12px 16px;
    margin: 5px 0;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

    .menu-button:hover {
        background: #2980b9;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
    }

.menu-item {
    display: block;
    padding: 12px 8px;
    text-decoration: none;
    color: #34495e;
    border-bottom: 1px solid #f8f9fa;
    transition: all 0.3s ease;
    border-radius: 4px;
}

    .menu-item:hover {
        color: #3498db;
        background: #f8f9fa;
        transform: translateX(5px);
    }

.menu-overlay,
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.overlay-content {
    background-color: #fff;
    padding: 20px;
    max-width: 600px;
    width: 90%;
    border-radius: 8px;
    overflow-y: auto;
    max-height: 80%;
}

.overlay-header {
    padding: 20px;
    background: #2c3e50;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .overlay-header h2 {
        margin: 0;
        font-size: 1.5em;
        font-weight: 600;
    }

.close-overlay {
    font-size: 28px;
    cursor: pointer;
    color: white;
    transition: color 0.3s ease;
}

.races-list {
    max-height: 60vh;
    overflow-y: auto;
    padding: 20px;
}

.race-item {
    margin-bottom: 15px;
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .race-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

.race-link {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.race-info {
    display: flex;
    flex-direction: column;
}

.race-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.race-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.race-type {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

    .race-type.grand-prix {
        background: #e8f5e8;
        color: #27ae60;
    }

    .race-type.sprint {
        background: #e3f2fd;
        color: #1976d2;
    }

/* ===== ABOUT OVERLAY ===== */
.about-content {
    max-width: 750px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.about-text {
    padding: 20px 30px;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
}

    .about-text pre {
        background: #f4f4f4;
        padding: 6px 10px;
        border-radius: 5px;
        font-size: 0.9em;
        overflow-x: auto;
    }

    .about-text code {
        font-family: monospace;
        color: #c0392b;
    }

    .about-text ol li {
        margin-bottom: 10px;
    }

/* ===== CHANGELOG OVERLAY ===== */
.changelog-text {
    padding: 15px 25px;
    overflow-y: auto;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    .changelog-text .version {
        background: #ffffff;
        border-radius: 10px;
        padding: 15px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        border-left: 4px solid #3498db;
    }

        .changelog-text .version:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        }

    .changelog-text h3 {
        margin: 0 0 8px 0;
        color: #2c3e50;
        font-size: 1.2em;
        font-weight: 700;
        display: flex;
        align-items: center;
        gap: 8px;
        border-bottom: 1px solid #ecf0f1;
        padding-bottom: 6px;
    }

.version-tag {
    font-size: 0.7em;
    background: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.release-date {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-style: italic;
}

.section {
    margin-top: 12px;
}

    .section h4 {
        font-size: 0.95em;
        font-weight: 600;
        margin-bottom: 6px;
        color: #34495e;
        display: flex;
        align-items: center;
    }

        .section h4:before {
            content: "▸";
            margin-right: 6px;
            color: #3498db;
        }

    .section ul {
        padding-left: 16px;
        list-style-type: none;
        margin: 0;
    }

    .section li {
        margin-bottom: 4px;
        line-height: 1.4;
        transition: background 0.2s ease;
        padding: 4px 6px;
        border-radius: 4px;
        position: relative;
        padding-left: 20px;
        font-size: 0.9em;
    }

        .section li:before {
            content: "•";
            position: absolute;
            left: 8px;
            color: #3498db;
            font-weight: bold;
        }

        .section li:hover {
            background: #f8f9fa;
        }

        .section li strong {
            color: #2c3e50;
        }

            .section li strong[data-status="added"] {
                color: #27ae60;
            }

            .section li strong[data-status="improved"] {
                color: #3498db;
            }

            .section li strong[data-status="fixed"] {
                color: #e74c3c;
            }

/* ===== MODAL & CHART STYLES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.chart-container {
    margin: 20px 0;
    height: 200px;
}

.chart-controls {
    margin-bottom: 10px;
    text-align: center;
}

.range-selector {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 12px;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
    display: none;
}

.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .latest-entries-section {
        margin: 15px auto;
        padding: 0 15px;
    }

    .latest-entries-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .driver-performance-highlights {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .latest-entry-card {
        padding: 15px;
    }

    .latest-entry-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .driver-name-large {
        font-size: 20px;
    }

    .latest-race-link:hover {
        transform: none;
    }

    .hamburger-menu {
        top: 15px;
        left: 15px;
    }

    .hamburger-icon {
        width: 32px;
        height: 28px;
        padding: 7px 5px;
    }

    .menu-content {
        width: 250px;
    }

    .overlay-content {
        width: 95%;
        margin: 10px;
    }

    .race-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .race-type {
        margin-top: 5px;
    }

    .race-title {
        font-size: 2em;
    }

    .gain-loss-container {
        flex-direction: column;
        align-items: center;
    }

    .gain-loss-card {
        min-width: 100%;
    }

    .changelog-text {
        padding: 12px 18px;
        max-height: 75vh;
        gap: 12px;
    }

        .changelog-text .version {
            padding: 12px;
        }

        .changelog-text h3 {
            font-size: 1.1em;
            margin-bottom: 6px;
            gap: 6px;
        }

    .section h4 {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .section li {
        font-size: 0.85em;
        margin-bottom: 3px;
    }

    .driver-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .rank-badge {
        margin-right: 0;
        align-self: center;
    }

    .driver-info-card {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .latest-entries-section {
        margin: 10px auto;
        padding: 0 10px;
    }

    .latest-entry-card {
        padding: 12px;
    }

    .latest-entry-header h3 {
        font-size: 1.1em;
    }

    .driver-name-large {
        font-size: 18px;
    }

    .hamburger-menu {
        top: 10px;
        left: 10px;
    }

    .hamburger-icon {
        width: 30px;
        height: 26px;
        padding: 6px 4px;
    }

    .race-title {
        font-size: 1.7em;
    }

    .changelog-text {
        padding: 8px 12px;
        max-height: 70vh;
        gap: 10px;
    }

        .changelog-text .version {
            padding: 10px;
            border-left-width: 3px;
        }

        .changelog-text h3 {
            font-size: 1em;
        }

    .version-tag {
        font-size: 0.65em;
        padding: 1px 4px;
    }

    .driver-card {
        width: 100%;
        max-width: 280px;
    }

    .team-name {
        font-size: 14px;
    }

    .race-count {
        font-size: 12px;
    }
}