/* ==========================================================================
   RACE DETAILS STYLESHEET
   ========================================================================== */

:root {
    --rd-primary-green: #159C33;
    --rd-light-green: #E6F4EA;
    --rd-dark-green: #0D7022;
    --rd-grey: #A0AEC0;
    --rd-light-grey: #F8FAFC;
    --rd-dark-grey: #4A5568;
    --rd-white: #FFFFFF;
    --rd-bg-color: #FFFFFF;
    /* Changed to white to match standard Outlands pages */
}

/* Container Utama */
.race-details-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 160px 30px 30px 30px; /* Adjusted top padding for fixed navbar */
    background-color: var(--rd-bg-color);
    font-family: 'Montserrat', sans-serif;
    color: var(--rd-dark-grey);
}

/* Header & Navigasi Jarak */
.rd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.rd-main-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--rd-primary-green);
    margin: 0;
    text-transform: uppercase;
}

.rd-race-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.rd-race-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.rd-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    color: var(--rd-grey);
    background-color: var(--rd-white);
    border: 1px solid #E2E8F0;
    text-decoration: none;
    transition: all 0.3s;
}

.rd-btn.active {
    background-color: var(--rd-primary-green);
    color: var(--rd-white);
    border-color: var(--rd-primary-green);
}

.rd-btn:hover:not(.active) {
    border-color: var(--rd-primary-green);
    color: var(--rd-primary-green);
}

/* Deskripsi Singkat Atas */
.rd-description {
    font-size: 16px;
    color: var(--rd-grey);
    margin-bottom: 30px;
    text-align: left;
    max-width: 700px;
    line-height: 1.6;
}

/* Banner Pendaftaran Gelap */
.rd-registration-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #0F172A;
    color: var(--rd-white);
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
}

.rd-registration-status {
    display: flex;
    align-items: center;
    gap: 15px;
}

.rd-status-icon {
    width: 45px;
    height: 45px;
    background-color: #166534;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #86EFAC;
}

.rd-status-details h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.rd-status-details p {
    font-size: 13px;
    color: #94A3B8;
    margin: 0;
}

.rd-join-btn {
    background-color: var(--rd-primary-green);
    color: var(--rd-white);
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s;
}

.rd-join-btn:hover {
    background-color: var(--rd-dark-green);
    transform: translateY(-2px);
}

/* Grid Statistik 8 Kotak */
.rd-race-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}

.rd-stat-card {
    background-color: var(--rd-light-green);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid transparent;
}

.rd-stat-card.rd-mountain-level-card {
    background-color: var(--rd-white);
    border: 1px solid #E2E8F0;
}

.rd-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--rd-grey);
    margin-bottom: 8px;
}

.rd-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--rd-primary-green);
}

.rd-mountain-level-card .rd-stat-value {
    color: #1a202c;
}

/* Indikator Level Gunung */
.rd-mountain-level-grid {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.rd-level-box {
    flex: 1;
    height: 8px;
    background-color: #E2E8F0;
    border-radius: 2px;
}

.rd-level-box.green {
    background-color: var(--rd-primary-green);
}

/* Header Map */
.rd-map-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.rd-section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--rd-primary-green);
    margin: 0;
}

.rd-download-btn {
    font-size: 14px;
    font-weight: 600;
    color: #3B82F6;
    /* Biru seperti di desain */
    text-decoration: none;
    transition: 0.3s;
}

.rd-download-btn:hover {
    color: #2563EB;
}

/* Peta dan Keterangan */
.rd-route-map-section {
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: start; /* WAJIB agar sticky bekerja pada child */
}

.rd-map-sticky-wrapper {
    position: sticky;
    top: 80px; /* Offset navbar (±80px) agar tidak ketimpa navbar */
    z-index: 10;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.rd-map-canvas {
    background-color: #e2e8f0;
    border-radius: 12px;
    height: 450px;
}

.rd-map-legend {
    background-color: #F1F0E8;
    /* Warna krem sesuai gambar */
    padding: 24px;
    border-radius: 12px;
}

.rd-map-legend h3 {
    font-size: 16px;
    text-transform: uppercase;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 20px 0;
    letter-spacing: 1px;
}

.rd-legend-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.rd-legend-icon {
    width: 30px;
    height: 30px;
    background-color: #1F2937;
    /* Warna bulat gelap */
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    flex-shrink: 0;
}

.rd-legend-details h4 {
    font-size: 13px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 2px 0;
}

.rd-legend-details p {
    font-size: 11px;
    color: #64748B;
    margin: 0;
}

/* Profil Elevasi */
.rd-elevation-section {
    margin-bottom: 40px;
}

.rd-elevation-profile {
    background-color: var(--rd-white);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.rd-elevation-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--rd-grey);
    margin: 0 0 15px 0;
}

.rd-elevation-graph {
    height: 150px;
    position: relative;
    padding-bottom: 25px;
}

.rd-elevation-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 600;
    color: var(--rd-grey);
    position: absolute;
    bottom: 0;
    width: 100%;
}

/* Tabs Bawah */
.rd-detail-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px 0 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.rd-detail-tabs::-webkit-scrollbar {
    display: none;
}

.rd-tab-btn {
    flex: 0 0 auto;
    text-align: center;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 700;
    color: var(--rd-dark-grey);
    background-color: #F1F5F9;
    border: 1px solid #E2E8F0;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rd-tab-btn.active,
.rd-tab-btn:hover {
    background-color: #166534;
    /* Hijau tua */
    color: var(--rd-white);
}

/* Kotak Deskripsi Hijau */
.rd-description-section {
    background-color: var(--rd-primary-green);
    color: var(--rd-white);
    padding: 30px;
    border-radius: 12px;
}

.rd-description-box h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 15px 0;
}

.rd-description-box p {
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}


/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */

@media (max-width: 1024px) {
    .rd-race-stats {
        grid-template-columns: repeat(2, 1fr);
        /* Jadi 2 baris x 4 kolom di tablet */
    }

    .rd-route-map-section {
        grid-template-columns: 1.5fr 1fr;
    }
}

@media (max-width: 768px) {
    .race-details-container {
        padding: 30px 15px 30px 15px !important;
    }

    .rd-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .rd-main-title {
        font-size: 28px;
    }

    .rd-race-nav {
        width: 100%;
    }

    .rd-registration-bar {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 20px;
        margin-left: 0;
        margin-right: 0;
        border-radius: 12px;
    }

    .rd-status-icon {
        margin: 0 auto;
    }

    .rd-registration-status {
        flex-direction: column;
    }

    .rd-join-btn {
        width: 100%;
        text-align: center;
    }

    .rd-race-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .rd-stat-card {
        padding: 15px;
    }

    .rd-stat-value {
        font-size: 18px;
    }

    .rd-route-map-section {
        grid-template-columns: 1fr;
    }

    .rd-map-sticky-wrapper {
        position: relative;
        top: 0;
        margin-bottom: 15px;
    }

    .rd-map-legend {
        padding: 20px;
    }

    .rd-detail-tabs {
        padding: 5px 0;
    }

    .rd-tab-btn {
        padding: 8px 15px;
        font-size: 10px;
    }
}