/* ============================================
   MAP WRAPPER
   ============================================ */
.map-wrapper {
    min-height: calc(100vh - 76px);
    padding-bottom: 4rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.map-hero {
    background: linear-gradient(135deg, rgba(212, 168, 83, 0.1), rgba(184, 146, 46, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem 0 2rem;
    margin-bottom: 3rem;
}

.map-hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--light);
}

.map-hero-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto;
}

/* ============================================
   MAP CONTAINER
   ============================================ */
.map-container {
    max-width: 1400px;
}

/* ============================================
   MAP CONTROLS
   ============================================ */
.map-controls {
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    animation: fadeInDown 0.5s ease-out;
}

.control-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(212, 168, 83, 0.1);
    color: var(--light);
    border: 2px solid rgba(212, 168, 83, 0.3);
    font-weight: 600;
    transition: all var(--transition-normal);
}

.btn-control:hover {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-control i {
    font-size: 1.1rem;
}

.stats-group {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--light);
}

.stat-item i {
    color: var(--primary);
    font-size: 1.25rem;
}

.stat-item span:first-of-type {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--light);
}

/* ============================================
   MAP CARD
   ============================================ */
.map-card {
    padding: 0;
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

#map {
    width: 100%;
    height: 600px;
    border-radius: var(--radius-lg);
    z-index: 1;
}


/* Map Loading */
.map-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease-out;
}

.map-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(212, 168, 83, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.map-loading p {
    color: var(--light);
    font-size: 1.1rem;
}

/* ============================================
   MAP LEGEND
   ============================================ */
.map-legend {
    padding: 1.5rem;
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.legend-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1rem;
}

.legend-title i {
    color: var(--primary);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--light);
}

.legend-marker {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(212, 168, 83, 0.1);
    border-radius: 6px;
    font-size: 1.1rem;
}

/* ============================================
   CUSTOM LEAFLET STYLES
   ============================================ */
.leaflet-popup-content-wrapper {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    padding: 1.5rem;
    min-width: 250px;
}

.leaflet-popup-tip {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-popup-content {
    text-align: center;
}

.popup-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 1rem;
}

.popup-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.popup-info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.95rem;
}

.popup-info-item i {
    color: var(--primary-light);
}

.popup-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.popup-type {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    color: white;
}

.popup-type-sport {
    background: rgba(76, 175, 80, 0.25);
    color: #66bb6a;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.popup-type-trad {
    background: rgba(255, 152, 0, 0.25);
    color: #ffa726;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.popup-type-boulder {
    background: rgba(33, 150, 243, 0.25);
    color: #42a5f5;
    border: 1px solid rgba(33, 150, 243, 0.4);
}

.popup-type-other {
    background: rgba(171, 71, 188, 0.25);
    color: #ba68c8;
    border: 1px solid rgba(171, 71, 188, 0.4);
}

.popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: white !important;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all var(--transition-normal);
    width: 100%;
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 83, 0.4);
    color: white;
}

/* Custom Marker Cluster */
.marker-cluster {
    background: rgba(212, 168, 83, 0.3);
    border: 3px solid var(--primary);
}

.marker-cluster div {
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
}

/* Custom Marker Icon */
.custom-marker-icon {
    background: var(--gradient-primary);
    width: 35px;
    height: 35px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.custom-marker-icon::after {
    content: '\f3c5';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    color: white;
    font-size: 16px;
}

/* ============================================
   LOCATION MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    animation: scaleIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
}

.modal-close:hover {
    background: var(--danger);
    transform: rotate(90deg);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .map-hero {
        padding: 2rem 0 1.5rem;
        margin-bottom: 2rem;
    }

    .map-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        width: 100%;
    }

    .btn-control {
        flex: 1;
        justify-content: center;
    }

    .stats-group {
        width: 100%;
        justify-content: center;
    }

    #map {
        height: 450px;
    }

    .legend-items {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .map-hero-title {
        font-size: 1.75rem;
    }

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

    #map {
        height: 400px;
    }

    .btn-control span {
        display: none;
    }

    .control-group {
        justify-content: space-between;
    }
}