/**
 * Alert Map Styles for PascoWeather.com
 * Provides interactive map visualization for weather alerts
 */

/* Alert Map Container */
.alert-map-container {
    position: relative;
    height: 400px;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Alert Map */
#alert-map {
    height: 100%;
    width: 100%;
    z-index: 1;
}

/* Map Controls */
.alert-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background-color: var(--card-bg);
    border-radius: 0.375rem;
    padding: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.alert-map-controls .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-map-controls .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-align: left;
}

/* Map Legend */
.alert-map-legend {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    background-color: var(--card-bg);
    border-radius: 0.375rem;
    padding: 0.75rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    max-width: 200px;
    font-size: 0.8rem;
}

.alert-map-legend h6 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

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

.alert-map-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Alert Popup Styles */
.alert-map-popup {
    min-width: 250px;
    max-width: 300px;
}

.alert-map-popup .popup-header {
    padding: 0.5rem;
    border-radius: 4px 4px 0 0;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-map-popup .popup-body {
    padding: 0.75rem;
}

.alert-map-popup .popup-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.alert-map-popup .popup-description {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.alert-map-popup .popup-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.alert-map-popup .popup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.alert-map-popup .popup-actions .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Map Loading Indicator */
.alert-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.alert-map-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Map Error Message */
.alert-map-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 1rem;
    text-align: center;
}

.alert-map-error i {
    font-size: 2rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Alert Area Polygon Styles */
.alert-area-severe {
    stroke: #dc3545;
    stroke-width: 2;
    fill: #dc3545;
    fill-opacity: 0.2;
}

.alert-area-moderate {
    stroke: #ffc107;
    stroke-width: 2;
    fill: #ffc107;
    fill-opacity: 0.2;
}

.alert-area-minor {
    stroke: #17a2b8;
    stroke-width: 2;
    fill: #17a2b8;
    fill-opacity: 0.2;
}

.alert-area-expired {
    stroke: #6c757d;
    stroke-width: 1;
    fill: #6c757d;
    fill-opacity: 0.1;
    stroke-dasharray: 5, 5;
}

/* Alert Marker Styles */
.alert-marker {
    width: 36px !important;
    height: 36px !important;
    margin-top: -18px !important;
    margin-left: -18px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    transition: transform 0.2s ease;
}

.alert-marker:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.alert-marker-severe {
    background-color: #dc3545;
}

.alert-marker-moderate {
    background-color: #ffc107;
}

.alert-marker-minor {
    background-color: #17a2b8;
}

.alert-marker-expired {
    background-color: #6c757d;
    opacity: 0.7;
}

/* Map Toggle Button */
.map-toggle-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: var(--card-bg);
    border-radius: 0.375rem;
    padding: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .alert-map-container {
        height: 300px;
    }
    
    .alert-map-controls {
        top: auto;
        bottom: 10px;
    }
    
    .alert-map-controls .btn-group {
        flex-direction: row;
    }
    
    .alert-map-legend {
        max-width: 150px;
        font-size: 0.7rem;
        padding: 0.5rem;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .alert-map-loading {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .alert-map-error {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Animation for alert areas */
@keyframes alertPulse {
    0% { fill-opacity: 0.1; }
    50% { fill-opacity: 0.3; }
    100% { fill-opacity: 0.1; }
}

.alert-area-active {
    animation: alertPulse 2s infinite;
}