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

:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b61;
    --secondary-color: #57c5b6;
    --accent-color: #159895;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --white: #fff;
    --error-color: #dc3545;
    --success-color: #28a745;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

/* Global Navigation */
.main-nav {
    background: var(--bg-light);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 10px 0;
}

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

.nav-logo {
    height: 32px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    padding: 15px 18px;
    display: block;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(0, 0, 0, 0.05);
}

.nav-menu a.active {
    color: var(--primary-color);
    background: rgba(26, 95, 122, 0.1);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

@media (max-width: 600px) {
    .main-nav .container {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding-bottom: 10px;
    }

    .nav-menu.open {
        display: flex;
    }

    .nav-menu a {
        padding: 12px 20px;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 20px;
}

/* Hero Image Header */
.hero-image {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-logo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 96px;
    height: 52px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 600px) {
    .hero-image {
        height: 250px;
    }

    .hero-logo {
        width: 60px;
        height: 60px;
        top: 15px;
        right: 15px;
    }
}

/* Hero Content Section */
.hero-content {
    background: var(--bg-light);
    padding: 40px 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.hero-content .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .hero-content {
        padding: 30px 20px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content .subtitle {
        font-size: 1rem;
    }
}

/* Event Details Card */
.event-details-card {
    background: var(--white);
    max-width: 600px;
    margin: -30px auto 0;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    text-align: left;
}

.event-details-card h2 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.event-details-card .details-list {
    list-style: none;
    margin-bottom: 25px;
}

.event-details-card .details-list li {
    padding: 8px 0;
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.5;
}

.event-details-card .details-list li strong {
    color: var(--primary-color);
}

.event-details-card .cta-button {
    display: block;
    text-align: center;
}

@media (max-width: 600px) {
    .event-details-card {
        margin: -20px 15px 0;
        padding: 25px 20px;
    }

    .event-details-card h2 {
        font-size: 1.1rem;
    }

    .event-details-card .details-list li {
        font-size: 0.95rem;
    }
}

/* Simple Hero for subpages */
.hero {
    background: var(--primary-color);
    color: var(--white);
    padding: 40px 20px;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* Main Content */
main {
    padding: 40px 0;
}


/* Registration Section */
.registration-section {
    background: var(--white);
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.registration-section h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
    text-align: center;
}

.price-info {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.price-info strong {
    color: var(--primary-color);
}

.deadline {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Form Styles */
.registration-form {
    max-width: 500px;
    margin: 0 auto;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-group input.error,
.form-group select.error {
    border-color: var(--error-color);
}

.checkbox-group {
    margin-top: 25px;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-top: 4px;
}

.checkbox-group a {
    color: var(--primary-color);
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px 30px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.submit-btn:hover {
    background: var(--primary-dark);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.payment-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 15px;
}

/* Footer */
footer {
    background: var(--bg-light);
    color: var(--text-light);
    border-top: 1px solid #e0e0e0;
    padding: 30px 20px;
    text-align: center;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer p {
    margin: 5px 0;
}

/* Responsive */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero .subtitle {
        font-size: 0.9rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .info-section,
    .registration-section {
        padding: 20px;
    }

    .route-card h3 {
        font-size: 1.6rem;
    }
}

/* Loading State */
.submit-btn.loading {
    position: relative;
    color: transparent;
}

.submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--white);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-message {
    background: #fdeaea;
    color: var(--error-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* Sticky CTA Button */
.sticky-cta {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background 0.2s;
    z-index: 1000;
}

.sticky-cta:hover {
    background: var(--primary-dark);
}

.sticky-cta.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

@media (max-width: 600px) {
    .sticky-cta {
        bottom: 15px;
        right: 15px;
        left: 15px;
        text-align: center;
        border-radius: 10px;
    }
}

/* Footer bottom padding removed - no sticky button on main pages */

/* Results Table */
#results-table {
    width: 100%;
    border-collapse: collapse;
}

#results-table th,
#results-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
}

#results-table tr:hover {
    background: #f8f9fa;
}

@media (max-width: 600px) {
    /* Ergebnisse: Verein (3.) und AK (4.) ausblenden */
    #results-table th:nth-child(3),
    #results-table td:nth-child(3),
    #results-table th:nth-child(4),
    #results-table td:nth-child(4) {
        display: none;
    }

    #results-table th,
    #results-table td {
        padding: 10px 8px;
        font-size: 0.88rem;
    }

    /* Tabs & Filter */
    #results-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    #filter-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .agegroup-dropdown {
        width: 100%;
    }

    /* Download Button */
    .urkunde-btn {
        padding: 8px 10px;
    }

    /* Registration Form */
    .form-row {
        grid-template-columns: 1fr;
    }

    .registration-section {
        padding: 20px 15px;
    }

    .price-info {
        font-size: 1rem;
    }

    /* Hero */
    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-content .subtitle {
        font-size: 0.95rem;
    }

    /* Event Card */
    .event-details-card {
        margin: -20px 10px 0;
        padding: 20px 16px;
    }

    .race-distance {
        font-size: 1rem;
    }

    .race-price {
        font-size: 1rem;
    }

    /* Footer */
    footer {
        font-size: 0.9rem;
        padding: 20px 15px;
    }
}

.tab-btn {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    margin-right: 10px;
    border-radius: 6px;
}

.tab-btn.active {
    background: rgba(26, 95, 122, 0.1);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.urkunde-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.urkunde-btn:hover {
    background: var(--primary-dark);
}

/* CTA Button (Landing Page) */
.cta-button {
    display: inline-block;
    padding: 16px 40px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(26, 95, 122, 0.3);
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 95, 122, 0.4);
}

@media (max-width: 600px) {
    .cta-button {
        padding: 14px 30px;
        font-size: 1rem;
        width: 100%;
    }
}

/* Race Blocks (Landing Page) */
.race-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0;
}

.race-block--kinder {
    padding: 6px 0;
}

.race-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

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

.race-distance {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.race-desc {
    font-size: 0.88rem;
    color: var(--text-light);
}

.race-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.race-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.race-time {
    font-size: 0.88rem;
    color: var(--text-light);
}

.race-badge {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    vertical-align: middle;
    letter-spacing: 0.03em;
}

.race-divider {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 16px 0;
}

.includes-note {
    font-size: 0.92rem;
    color: var(--text-light);
    margin-bottom: 24px;
    text-align: center;
}

/* Page-specific: hide/show based on navigation */
.nav-menu li.hidden {
    display: none;
}

/* Age Group Filter Dropdown */
.agegroup-dropdown {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 180px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.agegroup-dropdown:hover {
    border-color: var(--secondary-color);
}

.agegroup-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
}

#filter-row label {
    white-space: nowrap;
}

@media (max-width: 600px) {
    #filter-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .agegroup-dropdown {
        width: 100%;
    }
}
