/**
 * Municipality Map Styles
 * Custom CSS for map integration
 */

/* Map Container */
.municipality-map-container {
    height: 400px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.municipality-map-container.compact {
    height: 250px;
}

.municipality-map-container.large {
    height: 500px;
}

/* Map Element */
.municipality-map {
    height: 100%;
    width: 100%;
}

/* Location Information Panel */
.location-info-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.location-info-panel.bordered {
    border: 2px solid #dee2e6;
}

/* Location Status Indicators */
.location-status {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.location-status.empty {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.location-status.selected {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.location-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f1aeb5;
}

/* Map Controls */
.map-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.map-controls .btn {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Location Input Fields */
.location-inputs {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.location-inputs.two-column {
    grid-template-columns: 1fr 1fr;
}

.location-inputs .form-group {
    margin-bottom: 0;
}

.location-inputs .form-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.location-inputs .form-control {
    font-size: 14px;
}

/* Map Requirement Badge */
.map-requirement-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.map-requirement-badge i {
    margin-right: 4px;
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 12px;
    line-height: 1.4;
    font-size: 14px;
}

.custom-popup-content {
    font-size: 14px;
    line-height: 1.4;
}

.custom-popup-content strong {
    color: #495057;
}

.custom-popup-content small {
    color: #6c757d;
}

/* Loading State */
.map-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.map-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: map-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes map-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Map Instructions */
.map-instructions {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 14px;
}

.map-instructions i {
    color: #1976d2;
    margin-right: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .municipality-map-container {
        height: 300px;
    }
    
    .municipality-map-container.compact {
        height: 200px;
    }
    
    .municipality-map-container.large {
        height: 350px;
    }
    
    .location-inputs.two-column {
        grid-template-columns: 1fr;
    }
    
    .map-controls {
        justify-content: center;
    }
    
    .map-controls .btn {
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 576px) {
    .municipality-map-container {
        border-radius: 4px;
        height: 250px;
    }
    
    .location-info-panel {
        padding: 10px;
    }
    
    .location-status {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .map-instructions {
        padding: 10px;
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .location-info-panel {
        background: #343a40;
        border-color: #495057;
        color: #f8f9fa;
    }
    
    .map-instructions {
        background: #1e3a5f;
        border-color: #4a6fa5;
        color: #e3f2fd;
    }
    
    .location-status.empty {
        background: #664d03;
        color: #ffecb5;
        border-color: #997404;
    }
    
    .location-status.selected {
        background: #055160;
        color: #b8f5ff;
        border-color: #087990;
    }
    
    .map-requirement-badge {
        background: #1e3a5f;
        color: #b8daff;
        border-color: #4a6fa5;
    }
}

/* Animation for status changes */
.location-status {
    transition: all 0.3s ease;
}

.location-status.changing {
    transform: scale(1.02);
}

/* Highlight selected location input */
.location-inputs .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Map marker pulse effect */
@keyframes marker-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.leaflet-marker-icon.pulse {
    animation: marker-pulse 2s ease-in-out infinite;
}
