@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --secondary: #3b82f6;
    --bg-dark: #020617;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #d1d1d1;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #f59e0b;
}

html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Decoration */
.bg-blob {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
    animation: pulse 15s infinite alternate;
}

.bg-blob-2 {
    position: fixed;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    z-index: -1;
    border-radius: 50%;
    filter: blur(80px);
    animation: pulse 20s infinite alternate-reverse;
}

@keyframes pulse {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.2) translate(50px, 50px);
    }
}

.mountain-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.mountain-bg svg {
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
}

/* Navbar */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 400;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}


.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.lang-switch a {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.3s;
    /* Reset navbar link margins/transforms if necessary */
    margin: 0 !important;
    transform: none !important;
    opacity: 1 !important;
}

.lang-switch a:hover {
    color: var(--text-main);
}

.lang-switch a.active {
    color: var(--primary);
}

.lang-switch span {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--text-main);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Transform to X when active */
.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.05) 0%, transparent 80%);
}

#hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Ensure it behaves like the previous ::before element which had opacity 0.5 */
    opacity: 0.5;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    filter: blur(8px);
    transition: opacity 1.5s ease-in-out, filter 1.5s ease-in-out;
}

.hero-bg-image.active {
    opacity: 1;
    filter: blur(0);
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;

}

.hero h1 span {
    display: block;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.cta-button {
    padding: 1rem 2rem;
    background: var(--primary);
    color: var(--bg-dark);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 0 20px var(--primary-glow);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px var(--primary-glow);
}

.hero-featured-event {
    padding: 3rem;
    max-width: 1920px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

.hero-event-badge {
    align-self: flex-start;
    background: rgba(16, 185, 129, 0.15);
    color: #fff;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.hero-event-badge-happening {
    background: rgba(245, 159, 11, 0.458);
    border: 1px solid rgba(245, 136, 11, 0.674);
    color: #fff;
}

.hero-event-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.hero-event-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    text-align: center;
    align-items: center;
    color: #fff;
}

.hero-event-details .detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
}

.hero-event-details .detail svg {
    color: #fff;
}

.hero-event-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    box-shadow: none;
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05);
}

/* Calendar Section */
.calendar-section {
    padding: 100px 3%;
    position: relative;
    max-width: 1920px;
    margin: 0 auto;
}

.section-header {
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.month-group {
    margin-bottom: 6rem;
    width: 100%;
    align-items: center;
    scroll-margin-top: 100px;
}

.month-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 4px;
    width: 100%;
}

.month-title::before,
.month-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

.month-title::before {
    background: linear-gradient(to left, var(--border), transparent);
}

.month-title::after {
    background: linear-gradient(to right, var(--border), transparent);
}

.calendar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    width: 100%;
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.4rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.view-toggle-btn:hover {
    color: var(--text-main);
    border-color: var(--primary);
}

.view-toggle-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

/* Calendar Table View */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.calendar-table {
    width: 100%;
    min-width: 1200px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    /* overflow: hidden; Removed for dropdowns */
}

/* Fixed column widths for consistent alignment across all month tables */
/* Columns: Date | Event | Location | Distance | Elevation | Status | Links */
.calendar-table th:nth-child(1),
.calendar-table td:nth-child(1) {
    width: 14%;
    min-width: 240px;
}

/* Date */

.calendar-table th:nth-child(2),
.calendar-table td:nth-child(2) {
    width: 24%;
    min-width: 240px;
}

/* Event */

.calendar-table th:nth-child(3),
.calendar-table td:nth-child(3) {
    width: 14%;
    min-width: 140px;
}

/* Location */

.calendar-table th:nth-child(4),
.calendar-table td:nth-child(4) {
    width: 10%;
    min-width: 100px;
}

/* Distance */

.calendar-table th:nth-child(5),
.calendar-table td:nth-child(5) {
    width: 10%;
    min-width: 100px;
}

/* Elevation */

.calendar-table th:nth-child(6),
.calendar-table td:nth-child(6) {
    width: 10%;
    min-width: 100px;
}

/* Status */

.calendar-table th:nth-child(7),
.calendar-table td:nth-child(7) {
    width: 18%;
    min-width: 180px;
}

/* Links */

.calendar-table thead th {
    padding: 1rem 1.2rem;
    text-align: left;
    align-items: center;
    vertical-align: middle;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.calendar-table tbody tr {
    transition: background 0.3s;
}

.calendar-table tbody tr:hover {
    background: rgba(16, 185, 129, 0.04);
}

.calendar-table tbody td {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    vertical-align: middle;
    color: var(--text-main);
    white-space: nowrap;
}

.calendar-table tbody tr:last-child td {
    border-bottom: none;
}

.table-date {
    white-space: nowrap;
    color: var(--primary) !important;
    font-weight: 600;
    font-size: 0.85rem !important;
}

.date-short {
    display: none;
}

.table-event {
    flex-direction: column;
    gap: 0.2rem;
}

.table-event-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
}

.table-event-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0.7;
}

.table-location {
    display: flex;
    align-items: center;
    vertical-align: middle;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.table-links {
    gap: 0.4rem;
}

.table-links-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.table-links .event-website-btn,
.table-links .event-timekeeping-btn,
.table-links .event-results-btn,
.table-links .event-evizi-btn,
.table-links .event-calendar-btn,
.table-links .dropdown-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    line-height: 1;
}

.table-links .event-evizi-btn img {
    height: 14px;
}

.table-links .dropdown-btn svg {
    width: 14px;
    height: 14px;
}

.table-links .dropdown-container {
    vertical-align: middle;
}

/* Race Card */
.race-card {
    flex: 1 1 350px;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
    position: relative;
    /* overflow: hidden; Removed to allow dropdowns */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.race-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.race-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2rem;
    width: calc(100% - 4rem);
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.4s;
    border-radius: 0 0 4px 4px;
}

.race-card:hover::before {
    opacity: 1;
}

.race-date {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
}

.race-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.race-card .race-title {
    font-size: 1.8rem;
}

.race-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.race-note {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.country-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.race-details {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.race-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
}

.race-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.status-open {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
}

.status-closed {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.status-cancelled {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.status-soon {
    color: var(--text-muted);
    border: 1px dashed var(--border);
}

.status-filled {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.status-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.event-website-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.event-website-btn:hover {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.event-website-btn svg {
    width: 14px;
    height: 14px;
}

.event-evizi-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--secondary);
    border-radius: 50px;
    color: var(--secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

.event-evizi-btn:hover {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 15px rgba(7, 213, 236, 0.579);
    transform: translateY(-2px);
}

.event-evizi-btn img {
    height: 16px;
    width: auto;
    object-fit: contain;
}

.event-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent);
    border-radius: 50px;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
}

/* Dropdown */
.dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 10;
}

.dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.dropdown-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.dropdown-btn:hover,
.dropdown-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.dropdown-content {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    min-width: auto;
    width: max-content;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 20;
    border-radius: 12px;
    padding: 0.5rem;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dropdown-content.show {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
}

.dropdown-content a {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.dropdown-content .event-evizi-btn {
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-results-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}

.event-results-btn svg {
    width: 14px;
    height: 14px;
}

.event-timekeeping-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(169, 85, 247, 0.503);
    border: 1px solid #a855f7;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.event-timekeeping-btn:hover {
    background: #a855f7;
    color: white;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
    transform: translateY(-2px);
}

.event-timekeeping-btn svg {
    width: 14px;
    height: 14px;
}

.event-calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid #06b6d4;
    border-radius: 50px;
    color: #06b6d4;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s;
    cursor: pointer;
}

.event-calendar-btn:hover {
    background: #06b6d4;
    color: white;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.4);
    transform: translateY(-2px);
}

.event-calendar-btn svg {
    width: 14px;
    height: 14px;
}


/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s, transform 0.8s;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}


.about-section {
    padding: 100px 3%;
    max-width: 1920px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.about-section::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    filter: blur(80px);
    z-index: -1;
}

.about-container {
    max-width: 1100px;
    margin: 0 auto;
}



.about-content {
    padding: 3rem;
    backdrop-filter: blur(10px);
}

.about-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 500px) {
    .hero {
        padding: 80px 0;
    }

    .hero h1 {
        font-size: 2.0rem;
    }

    .hero p {
        font-size: 1.0rem;
        padding: 0 1rem;
    }

    .hero-featured-event {
        align-items: center;
        padding-top: 0.5rem;
        gap: 0;
    }

    .hero-event-title {
        font-size: 1.0rem;
    }

    .hero-event-details {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .hero-event-badge {
        align-self: center;
        margin-bottom: 0.5rem;
        font-size: 0.75rem;
        padding: 0.3rem 0.8rem;
    }

    .hero-event-details .detail {
        font-size: 0.9rem;
    }

    .hero-event-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .hero-event-actions a {
        justify-content: center;
    }

    .section-header {
        text-align: center;
        margin-bottom: 1rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .about-section {
        padding: 50px 1%;
        border-top: 1px solid var(--border);
        position: relative;
        overflow: hidden;
    }

    .about-content p {

        font-size: 0.9rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }

    .calendar-section {
        padding: 30px 1%;
    }

    .month-group {
        margin-bottom: 1rem;
    }

    .month-title {
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
        gap: 1rem;
        letter-spacing: 2px;
    }

    .calendar-table th:nth-child(1),
    .calendar-table td:nth-child(1) {
        width: 100px;
        min-width: auto;
    }

    .calendar-table th:nth-child(2),
    .calendar-table td:nth-child(2) {
        width: auto;
        min-width: auto;
    }

    .table-wrapper {
        overflow-x: hidden;
        padding: 0 3px;
    }

    .calendar-table {
        min-width: 0;
        width: 100%;
        display: grid;
    }

    .calendar-table thead,
    .calendar-table tbody {
        display: contents;
    }

    .calendar-table thead tr {
        display: grid;
        grid-template-columns: 100px minmax(150px, 2fr) 100px;
    }

    .calendar-table thead th:nth-child(3),
    .calendar-table thead th:nth-child(4),
    .calendar-table thead th:nth-child(5),
    .calendar-table thead th:nth-child(6) {
        display: none;
    }

    .calendar-table thead td:nth-child(3),
    .calendar-table thead td:nth-child(4),
    .calendar-table thead td:nth-child(5),
    .calendar-table thead td:nth-child(6) {
        display: none;
    }

    .calendar-table thead th {
        padding: 0.5rem 0.4rem;
        font-size: 0.6rem;
        letter-spacing: 0.5px;
        border-bottom: 1px solid var(--border);
    }

    .calendar-table tbody tr {
        display: grid;
        grid-template-columns: 100px minmax(150px, 2fr) 100px;
        grid-template-rows: auto auto;
        border-bottom: 1px solid var(--border);
    }

    .calendar-table tbody tr:last-child {
        border-bottom: none;
    }

    .calendar-table tbody td {
        padding: 0.4rem 0.4rem;
        font-size: 0.7rem;
        white-space: normal;
        border-bottom: none;
    }

    /* Date — col 1, spans both rows */
    .calendar-table tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
    }

    /* Event — col 2, row 1 */
    .calendar-table tbody td:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        padding-bottom: 0;
    }

    /* Location — col 2, row 2 (under Event) */
    .calendar-table tbody td:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        padding-top: 0;
    }

    /* Distance — hidden on mobile */
    .calendar-table tbody td:nth-child(4) {
        display: none;
    }

    /* Elevation — hidden on mobile */
    .calendar-table tbody td:nth-child(5) {
        display: none;
    }

    /* Status — hidden on mobile */
    .calendar-table tbody td:nth-child(6) {
        display: none;
    }

    /* Links — col 3, spans both rows */
    .calendar-table tbody td:nth-child(7) {
        grid-column: 3;
        grid-row: 1 / 3;
        align-self: center;
    }

    .table-date {
        width: 100px;
        font-size: 0.85rem !important;
        white-space: normal !important;
        word-break: break-word;
    }

    .date-full {
        display: none;
    }

    .date-short {
        display: inline;
    }

    .table-event-title {
        font-size: 0.75rem;
    }

    .table-event-note {
        font-size: 0.6rem;
    }

    .table-location {
        font-size: 0.7rem;
        gap: 0.25rem;
        margin-bottom: 0;
    }

    .country-flag {
        width: 16px;
        height: 11px;
    }

    .race-status {
        padding: 0.2rem 0.4rem;
        font-size: 0.6rem;
    }

    .table-links {
        display: table-cell !important;
        width: min-content;
    }

    .table-links-wrapper {
        display: grid !important;
        grid-template-columns: min-content min-content;
        gap: 0.2rem;
        width: min-content;
    }

    .table-links .event-website-btn,
    .table-links .event-timekeeping-btn,
    .table-links .event-results-btn,
    .table-links .event-evizi-btn,
    .table-links .event-calendar-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        font-size: 0;
    }

    .table-links .event-website-btn svg,
    .table-links .event-timekeeping-btn svg,
    .table-links .event-results-btn svg,
    .table-links .event-calendar-btn svg {
        width: 18px;
        height: 18px;
    }

    .table-links .event-evizi-btn img {
        height: 16px;
    }

    /* Hide text in dropdown button on mobile table view only */
    .table-links .dropdown-btn .btn-text {
        display: none;
    }

    .dropdown-btn {
        padding: 0.5rem 1rem;
        border-radius: 50px;
        /* Match other buttons instead of circle */
        width: auto;
        height: auto;
        justify-content: center;
        aspect-ratio: auto;
    }

    .table-links .dropdown-btn {
        width: 34px;
        height: 34px;
        padding: 0;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

    .dropdown-btn svg {
        width: 18px;
        height: 18px;
    }

    .calendar-table .race-title {
        font-size: 0.8rem;
        width: 80%;
    }

    .race-card .race-title {
        font-size: 1.3rem;
    }

    .race-note {
        font-size: 0.65rem;
        width: 80%;
    }
}

/* Footer */
footer {
    padding: 60px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-dark);
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.footer-columns {
    display: flex;
    justify-content: center;
    gap: 4rem;
    width: 100%;
    flex-wrap: wrap;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    min-width: 180px;
}

.footer-column h3 {
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.footer-logo {
    height: 100px;
    width: auto;
    object-fit: contain;
}

.footer-logo-col {
    justify-content: center;
    align-items: center;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: left;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.contact-link:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.footer-column-links {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-column-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s, transform 0.2s;
}

.footer-column-links a:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.footer-column-links a svg {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.footer-column-links a:hover svg {
    opacity: 1;
}

.footer-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
    opacity: 0.6;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        width: 100%;
        height: 100vh;
        top: 0;
        left: -100%;
        background: rgba(2, 6, 23, 0.98);
        backdrop-filter: blur(15px);
        transition: left 0.4s ease-in-out;
        z-index: 999;
        padding-top: 60px;
        /* Space for navbar */
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
        margin: 1.5rem 0;
        text-transform: uppercase;
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .nav-links.active a {
        opacity: 1;
        transform: translateY(0);
        /* Staggered animation handled by JS or fixed delay */
        transition-delay: 0.2s;
    }


    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .link-detail {
        display: none;
    }

    .signup-form {
        flex-direction: column;
    }

    .signup-input {
        text-align: center;
    }

    .footer-columns {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        text-align: center;
    }

    .footer-column {
        align-items: center;
    }

    .footer-column-links a {
        justify-content: center;
    }
}

/* Admin Panel */
.admin-container {
    padding: 120px 2rem 60px;
    max-width: 1500px;
    margin: 0 auto;
}

.admin-check {
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
}

.event-list th {
    text-align: center;
    font-size: 1.1rem;
    cursor: default;
}

.event-list th:nth-child(1),
.event-list th:nth-child(2) {
    text-align: left;
}

.event-list td:nth-child(1),
.event-list td:nth-child(2) {
    text-align: left;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

input,
select,
textarea {
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    outline: none;
    transition: border-color 0.3s;
    font-family: inherit;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

option {
    background: var(--bg-dark);
    color: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
    border: none;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.event-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.event-list th,
.event-list td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.event-list tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

#global-dropdown {
    position: fixed;
    z-index: 9999;
    display: none;
    flex-direction: column;
    background-color: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    min-width: auto;
    width: max-content;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 0.5rem;
    gap: 0.5rem;
}

#global-dropdown.show {
    display: flex;
    animation: fadeIn 0.2s ease-in-out;
}

#global-dropdown a {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

/* Adjust button sizes in global dropdown when invoked from table */
#global-dropdown.table-mode .event-website-btn,
#global-dropdown.table-mode .event-timekeeping-btn,
#global-dropdown.table-mode .event-results-btn,
#global-dropdown.table-mode .event-evizi-btn,
#global-dropdown.table-mode .event-calendar-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
}

#global-dropdown.table-mode .event-evizi-btn img {
    height: 14px;
}