/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.leaflet-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #0a4f9c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Flight Zone Map Styles */

#flight-zone-map {
    height: 600px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1;
    position: relative;
}

/* Ensure Leaflet controls are properly positioned and clickable */
#flight-zone-map .leaflet-control-container {
    z-index: 999;
    pointer-events: auto;
}

#flight-zone-map .leaflet-top,
#flight-zone-map .leaflet-bottom {
    z-index: 999;
    pointer-events: auto;
}

#flight-zone-map .leaflet-control {
    z-index: 999;
    pointer-events: auto;
}

/* Ensure layer control is clickable */
#flight-zone-map .leaflet-control-layers {
    z-index: 1000;
    pointer-events: auto;
}

#flight-zone-map .leaflet-control-layers input[type="checkbox"] {
    pointer-events: auto;
    cursor: pointer;
    width: 18px;
    height: 18px;
    margin-right: 5px;
}

#flight-zone-map .leaflet-control-layers label {
    pointer-events: auto;
    cursor: pointer;
    margin-bottom: 5px;
}

/* Make map fully interactive */
#flight-zone-map {
    touch-action: none;
}

#flight-zone-map .leaflet-pane {
    z-index: 400;
}

#flight-zone-map .leaflet-tile-pane {
    z-index: 200;
}

#flight-zone-map .leaflet-overlay-pane {
    z-index: 400;
}

#flight-zone-map .leaflet-shadow-pane {
    z-index: 300;
}

/* Make map container have proper positioning context */
.card-body {
    position: relative;
}

/* Make map full screen on mobile */
@media (max-width: 768px) {
    #flight-zone-map {
        height: 500px;
    }
}

/* Legend Styles */
.map-legend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    max-width: 250px;
}

.map-legend h6 {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-color {
    display: inline-block;
    width: 24px;
    height: 16px;
    margin-right: 10px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Zone Popup Styles */
.zone-popup {
    min-width: 250px;
    max-width: 350px;
}

.zone-popup h6 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #0a4f9c;
}

.zone-popup p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 6px;
}

.zone-popup strong {
    font-weight: 600;
}

.zone-popup small {
    font-size: 12px;
}

/* Map Message (for loading/error messages) */
.map-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
}

/* Layer Control Styling */
.leaflet-control-layers {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.leaflet-control-layers-expanded {
    padding: 10px;
}

/* Map Container */
.map-container {
    margin-top: 20px;
    margin-bottom: 40px;
}

.map-info-card {
    background: #f8f9fa;
    border-left: 4px solid #0a4f9c;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.map-info-card h5 {
    color: #0a4f9c;
    font-size: 18px;
    margin-bottom: 10px;
}

.map-info-card ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.map-info-card li {
    margin-bottom: 6px;
}

/* Filter Controls */
.zone-filters {
    margin-bottom: 20px;
}

.zone-filters .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zone-filters .btn {
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
}

/* Loading Spinner */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .map-legend {
        font-size: 12px;
        padding: 10px;
    }
    
    .legend-item {
        margin-bottom: 6px;
    }
    
    .zone-popup {
        min-width: 200px;
    }
    
    .zone-popup h6 {
        font-size: 14px;
    }
    
    .zone-popup p {
        font-size: 13px;
    }
}
