/* ===================================
   MAP VIEW SECTION
   ================================== */

.map-view-section {
    padding: 3rem 0 4rem;
    background: linear-gradient(180deg, #0F2A2A 0%, #0A1F1F 50%, #1A3A3A 100%);
    position: relative;
}

.map-view-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(127, 255, 0, 0.3), transparent);
}

.map-view-section .container {
    max-width: 1600px;
}

/* Map Header */
.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(15, 42, 42, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(127, 255, 0, 0.1);
}

.map-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    color: #7FFF00;
    margin: 0;
}

.map-title svg {
    stroke: #7FFF00;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 24px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #7FFF00;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===================================
   MAP CONTAINER & CONTROLS
   ================================== */

.map-wrapper {
    position: relative;
    width: 100%;
    height: 700px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(127, 255, 0, 0.2);
}

.events-map {
    width: 100%;
    height: 100%;
    background: #0F2A2A;
    z-index: 1;
}

/* Leaflet overrides */
.leaflet-container {
    background: #0F2A2A !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* MapLibre GL overrides - High performance styles */
.maplibregl-map {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.maplibregl-popup {
    max-width: 320px !important;
}

.maplibregl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.maplibregl-popup-close-button {
    color: #7FFF00 !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    padding: 8px 16px !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
    border: none !important;
}

.maplibregl-popup-close-button:hover {
    color: #FFFFFF !important;
    transform: scale(1.1);
    background: rgba(127, 255, 0, 0.1) !important;
}

.maplibregl-popup-tip {
    display: none !important;
}

/* Custom Marker Styles */
.custom-marker {
    cursor: pointer;
    width: 42px;
    height: 52px;
}

.marker-pin {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    border: 3px solid #0F2A2A;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: markerDrop 0.6s ease-out;
}

.marker-pin.basic {
    background: linear-gradient(135deg, #7FFF00 0%, #0D4F4F 100%);
    box-shadow: 0 6px 20px rgba(127, 255, 0, 0.6);
}

.marker-pin.pro {
    background: linear-gradient(135deg, #FFD700 0%, #FF6B35 100%);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
}

.marker-pin:hover {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 0 8px 32px rgba(127, 255, 0, 0.8);
}

.marker-icon {
    transform: rotate(45deg);
    font-size: 20px;
}

.marker-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50% 50% 50% 0;
    border: 2px solid currentColor;
    opacity: 0;
    animation: markerPulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes markerDrop {
    0% {
        transform: rotate(-45deg) translateY(-200px) scale(0);
        opacity: 0;
    }
    60% {
        transform: rotate(-45deg) translateY(10px) scale(1.1);
    }
    100% {
        transform: rotate(-45deg) translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes markerPulse {
    0% {
        transform: rotate(-45deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: rotate(-45deg) scale(1.5);
        opacity: 0.4;
    }
    100% {
        transform: rotate(-45deg) scale(2);
        opacity: 0;
    }
}

/* Map Popup Styles */
.map-popup {
    background: linear-gradient(135deg, #0F2A2A 0%, #1A3A3A 100%);
    padding: 24px;
    border-radius: 20px;
    color: #FFFFFF;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    min-width: 300px;
}

.map-popup.basic {
    border: 2px solid rgba(127, 255, 0, 0.4);
}

.map-popup.pro {
    border: 2px solid rgba(255, 215, 0, 0.5);
}

.popup-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFD700 0%, #FF6B35 100%);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #0F2A2A;
    margin-bottom: 14px;
    letter-spacing: 1px;
}

.map-popup h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.map-popup.basic h3 {
    color: #7FFF00;
}

.map-popup.pro h3 {
    color: #FFD700;
}

.map-popup p {
    margin: 0 0 18px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.popup-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

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

.detail-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-value {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.detail-value.price {
    font-size: 18px;
    font-weight: 700;
}

.map-popup.basic .detail-value.price {
    color: #7FFF00;
}

.map-popup.pro .detail-value.price {
    color: #FFD700;
}

.popup-btn {
    background: linear-gradient(135deg, #7FFF00 0%, #6DE800 100%);
    color: #0F2A2A;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(127, 255, 0, 0.4);
}

.map-popup.pro .popup-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FF6B35 100%);
    box-shadow: 0 6px 16px rgba(255, 215, 0, 0.4);
}

.popup-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(127, 255, 0, 0.6);
}

.map-popup.pro .popup-btn:hover {
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.6);
}

.popup-btn:active {
    transform: translateY(-1px);
}

.leaflet-popup-content-wrapper {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7) !important;
    border-radius: 16px !important;
}

.leaflet-popup-tip {
    background: #0F2A2A !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.leaflet-popup-close-button {
    color: #7FFF00 !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    padding: 8px 16px !important;
    transition: all 0.3s ease !important;
}

.leaflet-popup-close-button:hover {
    color: #FFFFFF !important;
    transform: scale(1.1);
}

/* Marker animations */
@keyframes markerPulse {
    0%, 100% {
        box-shadow: 0 6px 16px rgba(127, 255, 0, 0.5);
    }
    50% {
        box-shadow: 0 8px 24px rgba(127, 255, 0, 0.8);
    }
}

.custom-map-marker {
    animation: markerBounce 0.6s ease-out, markerPulse 2s ease-in-out infinite 0.6s;
}

@keyframes markerBounce {
    0% {
        transform: translateY(-100px) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(10px) scale(1.1);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Marker Cluster Styles */
.marker-cluster-custom {
    background: transparent !important;
}

.leaflet-cluster-anim .leaflet-marker-icon, 
.leaflet-cluster-anim .leaflet-marker-shadow {
    transition: transform 0.3s ease-out, opacity 0.3s ease-in;
}

/* Map Layer Control */
.map-layer-control {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(15, 42, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    border: 2px solid rgba(127, 255, 0, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    min-width: 220px;
}

.layer-control-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: #7FFF00;
    font-weight: 700;
    font-size: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(127, 255, 0, 0.2);
}

.layer-control-header svg {
    stroke: #7FFF00;
}

.layer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.layer-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: rgba(26, 58, 58, 0.6);
    border: 2px solid transparent;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
}

.layer-btn svg {
    stroke: currentColor;
}

.layer-btn:hover {
    background: rgba(26, 58, 58, 0.9);
    border-color: rgba(127, 255, 0, 0.3);
    color: #7FFF00;
    transform: translateY(-2px);
}

.layer-btn.active {
    background: linear-gradient(135deg, rgba(127, 255, 0, 0.2), rgba(127, 255, 0, 0.1));
    border-color: #7FFF00;
    color: #7FFF00;
    box-shadow: 0 4px 16px rgba(127, 255, 0, 0.3);
}

/* Weather Toggle */
.weather-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(127, 255, 0, 0.2);
}

.toggle-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(26, 58, 58, 0.8);
    border: 2px solid rgba(127, 255, 0, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: rgba(255, 255, 255, 0.6);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #7FFF00, #6DE800);
    border-color: #7FFF00;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
    background-color: #0F2A2A;
}

/* Standard Map Controls */
.map-controls {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-control-btn {
    width: 48px;
    height: 48px;
    background: rgba(15, 42, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(127, 255, 0, 0.2);
    border-radius: 12px;
    color: #7FFF00;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.map-control-btn:hover {
    background: rgba(15, 42, 42, 1);
    border-color: #7FFF00;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(127, 255, 0, 0.4);
}

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

.map-control-btn svg {
    stroke: currentColor;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(15, 42, 42, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px 20px;
    border: 2px solid rgba(127, 255, 0, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.legend-title {
    color: #7FFF00;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #0F2A2A;
    flex-shrink: 0;
}

.legend-marker.basic {
    background: linear-gradient(135deg, #7FFF00 0%, #0D4F4F 100%);
    box-shadow: 0 2px 8px rgba(127, 255, 0, 0.4);
}

.legend-marker.pro {
    background: linear-gradient(135deg, #FFD700 0%, #FF6B35 100%);
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.legend-marker.cluster {
    background: linear-gradient(135deg, #7FFF00 0%, #FFD700 100%);
    box-shadow: 0 2px 8px rgba(127, 255, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #0F2A2A;
}

.legend-marker.cluster::before {
    content: '5+';
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-view-section {
        padding: 2rem 0 3rem;
    }
    
    .map-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .map-title {
        font-size: 22px;
    }
    
    .map-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .map-wrapper {
        height: 500px;
        border-radius: 16px;
    }
    
    .map-layer-control {
        left: 10px;
        top: 10px;
        padding: 12px;
        min-width: 180px;
    }
    
    .layer-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .layer-btn {
        padding: 8px;
        font-size: 11px;
    }
    
    .map-controls {
        right: 10px;
        top: 10px;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
    }
    
    .map-legend {
        bottom: 10px;
        left: 10px;
        padding: 12px 16px;
    }
}

/* Map Placeholder */
.map-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #7FFF00;
    text-align: center;
    padding: 2rem;
}

.map-placeholder svg {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.map-placeholder p {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #FFFFFF;
}

.map-placeholder small {
    color: #C0C0C0;
    font-size: 0.9rem;
}

.map-controls {
    position: absolute;
    right: 1rem;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.map-control-btn {
    width: 44px;
    height: 44px;
    background: rgba(15, 42, 42, 0.9);
    border: 2px solid rgba(127, 255, 0, 0.3);
    border-radius: 8px;
    color: #7FFF00;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.map-control-btn:hover {
    background: rgba(127, 255, 0, 0.2);
    border-color: #7FFF00;
    transform: scale(1.05);
}

.map-control-btn:active {
    transform: scale(0.95);
}

/* Responsive Map */
@media (max-width: 768px) {
    .map-wrapper {
        height: 500px;
        border-radius: 16px;
    }
    
    .map-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .map-title {
        font-size: 22px;
    }
    
    .map-stats {
        width: 100%;
        justify-content: space-around;
        gap: 1rem;
    }
    
    .map-controls {
        right: 0.5rem;
        top: 0.5rem;
    }
    
    .map-control-btn {
        width: 40px;
        height: 40px;
    }
    
    .map-popup {
        min-width: 280px;
        padding: 20px;
    }
    
    .popup-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .map-wrapper {
        height: 400px;
        border-radius: 12px;
    }
    
    .map-header {
        padding: 0.75rem;
    }
    
    .map-title {
        font-size: 18px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .map-popup {
        min-width: 260px;
        padding: 16px;
    }
    
    .map-popup h3 {
        font-size: 18px;
    }
}
