/* Green Theme for Outdoor Race Website */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: #112f17; /* Dark green background */
    padding: 20px;
    color: #d8e9a8; /* Light green text */
}

/* Tab Navigation */
.tabs {
    display: flex;
    justify-content: center;
    margin: 2rem auto;
    background: #3c7a2f; /* Medium green background */
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: fit-content;
    flex-wrap: wrap;
}

.tab {
    padding: 0.8rem 2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: #d8e9a8; /* Light green text */
    border-radius: 25px;
    transition: all 0.3s ease;
    margin: 3px;
}

.tab.active {
    background: #112f17; /* Dark green */
    color: #d8e9a8;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.tab:hover:not(.active) {
    background: rgba(216, 233, 168, 0.2); /* Light green with opacity */
}

/* Container Styles */
.container {
    text-align: center;
    background-color: #112f17; /* Dark green background */
    padding: 20px 40px;
    border-radius: 12px;
    border: 1px solid #3c7a2f;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 40px;
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.section {
    display: block;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Typography */
h1, h2 {
    font-size: 24px;
    color: #d8e9a8; /* Light green text */
    margin-bottom: 20px;
}

p {
    color: #d8e9a8; /* Light green text */
    line-height: 1.6;
}

a {
    color: #d8e9a8; /* Light green text */
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: white;
    text-decoration: underline;
}

/* Button Styles */
button {
    font-size: 18px;
    padding: 15px 40px;
    border-radius: 10px;
    border: none;
    background-color: #3c7a2f; /* Medium green */
    color: #d8e9a8; /* Light green text */
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #d8e9a8; /* Light green */
    color: #112f17; /* Dark green */
}

/* Team Cards */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px;
}

.team-card {
    background: #112f17; /* Dark green background */
    border: 2px solid #3c7a2f; /* Medium green border */
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.team-icon {
    width: 100px;
    height: 100px;
    margin: 15px 0;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #3c7a2f; /* Medium green border */
}

.team-title {
    font-size: 22px;
    color: #d8e9a8; /* Light green text */
    margin: 10px 0;
    font-weight: bold;
}

.team-description {
    text-align: center;
    margin: 15px 0;
    color: #d8e9a8; /* Light green text */
    font-style: italic;
    line-height: 1.5;
}

.team-members {
    width: 100%;
    padding: 0;
    list-style: none;
}

.team-member {
    padding: 8px;
    margin: 5px 0;
    background-color: #3c7a2f; /* Medium green */
    border-radius: 5px;
    text-align: center;
    color: #d8e9a8; /* Light green text */
}

/* Results Table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #112f17; /* Dark green background */
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #3c7a2f; /* Medium green border */
}

.results-table th, .results-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #3c7a2f; /* Medium green border */
}

.results-table th {
    background-color: #3c7a2f; /* Medium green */
    color: #d8e9a8; /* Light green text */
}

.results-table tr:hover {
    background-color: rgba(60, 122, 47, 0.2); /* Medium green with opacity */
}

/* Rules List */
.rules-list {
    background: #112f17; /* Dark green background */
    border: 1px solid #3c7a2f; /* Medium green border */
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.rules-list ol {
    padding-left: 20px;
    color: #d8e9a8; /* Light green text */
}

.rules-list li {
    margin: 10px 0;
    line-height: 1.6;
}

/* Gallery Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

.gallery-item {
    position: relative;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #3c7a2f; /* Medium green border */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 47, 23, 0.85); /* Dark green with opacity */
    color: #d8e9a8; /* Light green text */
    padding: 10px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

/* Gallery Category Tabs */
.gallery-categories {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 15px;
    flex-wrap: wrap;
}

.gallery-category-btn {
    padding: 10px 25px;
    border: none;
    background-color: #3c7a2f; /* Medium green */
    color: #d8e9a8; /* Light green text */
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.gallery-category-btn.active {
    background-color: #d8e9a8; /* Light green */
    color: #112f17; /* Dark green */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.gallery-category-btn:hover:not(.active) {
    background-color: #2c5a23; /* Darker medium green */
}

.gallery-category {
    display: none;
}

.gallery-category.active {
    display: block;
}

.category-title {
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3c7a2f; /* Medium green */
    font-size: 22px;
    color: #d8e9a8; /* Light green text */
    text-align: center;
}

/* Photo Popup Styles */
.photo-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 47, 23, 0.9); /* Dark green with opacity */
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    background-color: #112f17; /* Dark green background */
    border: 3px solid #3c7a2f; /* Medium green border */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.popup-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin: 0 auto;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: #3c7a2f; /* Medium green */
    color: #d8e9a8; /* Light green text */
    border: 2px solid #d8e9a8; /* Light green border */
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
}

.close-popup:hover {
    background: #d8e9a8; /* Light green */
    color: #112f17; /* Dark green */
}

.popup-caption {
    padding: 15px;
    text-align: center;
    color: #d8e9a8; /* Light green text */
    background-color: #112f17; /* Dark green background */
    font-size: 16px;
    border-top: 1px solid #3c7a2f; /* Medium green border */
}

/* Copyright Footer */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #3c7a2f;
    color: #d8e9a8;
}

.footer a {
    color: #d8e9a8;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Editions Styles */
.edition-card {
    background: #112f17;
    border: 2px solid #3c7a2f;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.edition-card:hover {
    transform: translateY(-10px);
}

.edition-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.edition-title {
    font-size: 26px;
    color: #d8e9a8;
}

.edition-link {
    padding: 8px 20px;
    background-color: #3c7a2f;
    color: #d8e9a8;
    border-radius: 20px;
    transition: all 0.3s;
}

.edition-link:hover {
    background-color: #d8e9a8;
    color: #112f17;
    text-decoration: none;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3c7a2f;
    transform: translateY(-50%);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    background: #112f17;
    border: 2px solid #3c7a2f;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step-label {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
}

.step.completed {
    background-color: #3c7a2f;
    color: #d8e9a8;
    text-decoration: line-through;
}

.step.active {
    background-color: #d8e9a8;
    color: #112f17;
    border-color: #d8e9a8;
}

.step.future {
    background-color: #112f17;
    color: #3c7a2f;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.action-card {
    background: #112f17;
    border: 1px solid #3c7a2f;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.action-card h3 {
    color: #d8e9a8;
    margin-bottom: 15px;
    font-size: 20px;
}

.action-card p {
    color: #d8e9a8;
    margin-bottom: 20px;
}

.action-btn {
    display: inline-block;
    padding: 8px 20px;
    background-color: #3c7a2f;
    color: #d8e9a8;
    border-radius: 5px;
    transition: all 0.3s;
}

.action-btn:hover {
    background-color: #d8e9a8;
    color: #112f17;
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .tabs {
        display: flex;
        flex-wrap: wrap;
    }
    
    .tab {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .gallery-categories {
        flex-direction: column;
        align-items: center;
    }
    
    .container {
        padding: 15px 20px;
    }
    
    button {
        padding: 12px 25px;
        font-size: 16px;
    }
    
    /* Make tables responsive */
    .container {
        max-width: 100%;
        overflow-x: auto;
        padding: 15px;
    }
    
    /* Fix for results tables on mobile */
    .results-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .results-table th,
    .results-table td {
        padding: 10px 8px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    /* Ensure the section container doesn't overflow */
    .section.results {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Additional mobile adjustments */
    .team-card {
        padding: 15px;
    }
    
    .team-title {
        font-size: 18px;
    }
    
    .team-description {
        font-size: 14px;
    }
    
    .team-member {
        padding: 6px;
        font-size: 14px;
    }
    
    .progress-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
    }
    
    .progress-steps::before {
        height: 100%;
        width: 2px;
        top: 0;
        left: 19px;
        transform: none;
    }
    
    .step {
        margin-left: 0;
    }
    
    .step-label {
        top: 0;
        left: 50px;
        transform: none;
    }
}