:root {
    --header-bg-color: linear-gradient(to right, #F0EDFF, #FEEAC8, #B09DFF);
    --hero-content-bg-color: linear-gradient(135deg, #46249d, #6132da);
    --purple: #46249d;
    --accent-color: #050599;
    --button-selected-bg-color: #000;
    --button-selected-text-color: #fff;
    --button-hover-border-color: #000;
    --button-hover-bg-color: #fff;
    --button-hover-text-color: #000;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
}

@font-face {
    font-family: 'Thernaly Regular';
    font-style: normal;
    font-weight: normal;
    src: local('Thernaly Regular'), url('fonts/Thernaly-YqJWv.woff') format('woff');
}

@font-face {
    font-family: 'Thernaly Italic';
    font-style: normal;
    font-weight: normal;
    src: local('Thernaly Italic'), url('fonts/ThernalyItalic-rvmpA.woff') format('woff');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--header-bg-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}


/* HEADER */
.header {
    position: sticky;
    top: 0;
    background: var(--header-bg-color);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-sm);
    box-shadow: var(--shadow);
    z-index: 100;
}

.header-logos {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-logo img {
    height: 40px;
    transition: transform 0.3s ease;
}

.header-logo img:hover {
    transform: scale(1.05);
}

/* HERO SECTION */
.hero-section {
    padding: var(--spacing-lg) 0;
    background: url('assets/bg_desktop.png') top/cover;
    background-color: rgba(255, 255, 255, 0.2);
    background-blend-mode: lighten;
    background-attachment: fixed;
    position: relative;
}

/* .hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--gradient-color-1), var(--gradient-color-2), var(--gradient-color-3));
    opacity: 0.8;
    z-index: 1;
} */

.hero-section .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    position: relative;
    z-index: 2;
    min-height: 60vh;
}

.hero-content {
    background: var(--hero-content-bg-color);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    color: white;
    backdrop-filter: blur(10px);
}

.hero-text h1 {
    font-family: 'Thernaly Italic', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: normal;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 2px;
}

.hero-text p {
    font-family: 'Sora', sans-serif;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
}

.total-distance {
    font-size: 1.2rem !important;
    font-weight: 500;
}

.highlight {
    font-size: 1.5em;
    font-weight: bold;
    color: #FFD700;
}

.bottom-content h3 {
    margin-bottom: var(--spacing-sm);
    font-weight: bold;
    color: #FFD700;
}

.bottom-content p:last-of-type {
    margin-bottom: 0;
}

.bottom-content .hero-text {
    width: 100%;
    text-align: center;
}

@media (min-width: 768px) {
    .hero-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        grid-template-rows: auto auto;
        gap: var(--spacing-lg);
        align-items: start;
    }

    .hero-content.main-content {
        grid-column: 1;
        grid-row: 1;
    }

    .hero-table {
        grid-column: 2;
        grid-row: 1;
    }

    .hero-content.bottom-content {
        grid-column: 1 / 3;
        grid-row: 2;

        justify-self: center;
        width: fit-content;
        max-width: 100%;

        display: block;
    }

    .hero-content.bottom-content .hero-text {
        width: 100%;
        text-align: center;
    }
}


/* DAILY RESULTS SECTION */
.daily-results-section {
    padding: var(--spacing-md) 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.section-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-family: 'Thernaly Regular', sans-serif;
    color: var(--purple);
    font-size: 1.8rem;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
}

.section-header p {
    font-family: 'Sora', sans-serif;
    color: #666;
    font-size: 1.1rem;
}

.date-selector {
    margin-bottom: 1.5rem;
}

.daily-results-table {
    display: flex;
    justify-content: center;
}

/* BUTTONS */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.option-button {
    font-family: 'Sora', sans-serif;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--purple);
    border-radius: 50px;
    background-color: white;
    color: var(--purple);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.option-button:hover {
    border-color: var(--accent-color);
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option-button.selected {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}

/* RESULTS TABLES */
.results-table {
    font-family: 'Sora', sans-serif;
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    min-width: 350px;
}

.results-table h2,
.results-table h3 {
    color: var(--purple);
    font-family: 'Thernaly Regular', sans-serif;
    font-weight: bolder;
    font-size: 1.3rem;
    letter-spacing: 1.5px;
    margin-bottom: 0.75rem;
}

.results-table .top-n {
    font-size: 0.8em;
    font-weight: 300;
}

.results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.results-list li {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.results-list li:last-child {
    border-bottom: none;
}

.results-list li .km {
    font-size: 0.8rem;
}

.medal {
    font-size: 1.5rem;
    text-align: center;
}

.position {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    font-weight: bold;
    color: #666;
    font-size: 0.9rem;
}

.name {
    font-weight: 500;
    color: #333;
}

.date {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
    text-align: right;
}

.score {
    font-weight: bold;
    color: var(--purple);
    font-size: 1.1rem;
}

.gold {
    color: #DAA520;
}

.silver {
    color: #C0C0C0;
}

.bronze {
    color: #CD7F32;
}

#globalResults .score {
    padding-right: 0.5rem;
}

/* FOOTER */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    /* margin-top: var(--spacing-lg); */
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.footer-links a {
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .header {
        position: relative;
    }

    .hero-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .hero-section .container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* .hero-content,
    .hero-table {
        order: 1;
    }

    .hero-content {
        order: 0;
    } */

    .header {
        padding: 0.75rem;
    }

    .header-logos {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-logo img {
        height: 40px;
    }

    .results-table {
        min-width: auto;
        margin: 0 auto;
    }

    .button-group {
        gap: 0.5rem;
    }

    .option-button {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.8rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .results-list li {
        grid-template-columns: 35px 1fr auto auto;
        gap: 0.3rem;
        font-size: 0.9rem;
    }

    .date {
        font-size: 0.7rem;
    }

    .medal {
        font-size: 1.2rem;
    }

    .score {
        font-size: 1rem;
    }
}