/* Map-specific styles */

/* Leaflet Map Customization */
.leaflet-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Custom Map Controls */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    top: 200px !important; /* Move zoom controls down to avoid header overlap */
}

.leaflet-control-zoom a {
    background: #fff !important;
    border: 1px solid #d1d5db !important;
    color: #374151 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.leaflet-control-zoom a:hover {
    background: #f9fafb !important;
    border-color: #2563eb !important;
    color: #2563eb !important;
}

/* Custom Markers */
.custom-marker {
    background: #2563eb;
    border: 3px solid #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

/* Dynamic Legend System - 6-Color Palette */
.custom-marker.color-1 {
    background: #3b82f6; /* Primary Blue */
}

.custom-marker.color-2 {
    background: #10b981; /* Emerald */
}

.custom-marker.color-3 {
    background: #f59e0b; /* Amber */
}

.custom-marker.color-4 {
    background: #ef4444; /* Red */
}

.custom-marker.color-5 {
    background: #8b5cf6; /* Violet */
}

.custom-marker.color-6 {
    background: #166534; /* Dark Green */
}

/* Legend Styling */
.map-legend {
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
    line-height: 1.4;
    max-width: 200px;
}

.map-legend h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex-shrink: 0; /* Prevent marker from being compressed when text wraps */
}

.legend-marker.color-1 {
    background: #3b82f6;
}

.legend-marker.color-2 {
    background: #10b981;
}

.legend-marker.color-3 {
    background: #f59e0b;
}

.legend-marker.color-4 {
    background: #ef4444;
}

.legend-marker.color-5 {
    background: #8b5cf6;
}

.legend-marker.color-6 {
    background: #166534;
}



/* Marker Clusters */
.marker-cluster-small {
    background-color: rgba(37, 99, 235, 0.8);
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    text-align: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.marker-cluster-medium {
    background-color: rgba(16, 185, 129, 0.8);
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.marker-cluster-large {
    background-color: rgba(139, 92, 246, 0.8);
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    text-align: center;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

.leaflet-popup-tip {
    background: #fff !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Custom Popup Content */
.popup-content {
    padding: 1rem;
    min-width: 200px;
    max-width: 300px;
}

.popup-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.popup-description {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.popup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.popup-category {
    background: #2563eb;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.popup-tag {
    background: #f1f5f9;
    color: #64748b;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
}

.popup-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.popup-btn-primary {
    background: #2563eb;
    color: white !important;
    text-decoration: none;
}

.popup-btn-primary:visited {
    color: white !important;
}

.popup-btn-primary:hover {
    background: #1d4ed8;
}

.popup-btn-secondary {
    background: transparent;
    color: #2563eb;
    border: 1px solid #2563eb;
}

.popup-btn-secondary:hover {
    background: #2563eb;
    color: white;
}

/* Map Loading State */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 1000;
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-loading-text {
    color: #64748b;
    font-size: 0.875rem;
}

/* Map Error State */
.map-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    z-index: 1000;
    max-width: 400px;
}

.map-error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.map-error-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.map-error-message {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.map-error-retry {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.map-error-retry:hover {
    background: #b91c1c;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    font-size: 0.875rem;
}

.map-legend h4 {
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-weight: 600;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.map-legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}



/* Responsive Map Adjustments */
@media (max-width: 768px) {
    .map-legend {
        bottom: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
        padding: 0.75rem;
    }
    
    .map-legend h4 {
        font-size: 0.875rem;
    }
    
    .map-legend-item {
        font-size: 0.75rem;
    }
    
    .popup-content {
        min-width: 150px;
        max-width: 250px;
    }
    
    .popup-title {
        font-size: 0.875rem;
    }
    
    .popup-description {
        font-size: 0.75rem;
    }
}

/* Popup with Overlay Effect - DISABLED */
/*
.popup-with-overlay .leaflet-popup-content-wrapper {
    position: relative;
    z-index: 1002;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.15);
    z-index: 1000;
    pointer-events: none;
}
*/
