/* MeteoAlarm Map Styles */
/**
 * Wunderkammer Weather Plugin - MeteoAlarm Map CSS - meteoalarm-map.css
 * Copyright (c) 2025 Giuseppe Fraccalvieri. All rights reserved.
 * Licensed under proprietary license - See LICENSE.txt
 * Unauthorized use is strictly prohibited.
 */

/* Map Container */
.ww-meteoalarm-map-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

/* Map Header */
.ww-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.ww-map-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* Map Controls */
.ww-map-controls {
    display: flex;
    gap: 10px;
}

.ww-map-fullscreen,
.ww-map-close {
    background: none;
    border: 1px solid #ccc;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s ease;
}

.ww-map-fullscreen:hover,
.ww-map-close:hover {
    background: #f0f0f0;
    color: #333;
    border-color: #999;
}

.ww-map-close {
    font-size: 20px;
    line-height: 1;
    padding: 6px 10px;
}

/* Map Canvas */
.ww-map-canvas {
    flex: 1;
    position: relative;
    width: 100%;
}

/* Map Legend */
.ww-map-legend {
    position: absolute;
    bottom: 30px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 14px;
}

.ww-legend-item {
    display: inline-block;
    margin: 0 10px 0 0;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 500;
}

.ww-legend-green {
    background-color: #28a745;
    color: white;
}

.ww-legend-yellow {
    background-color: #ffda22;
    color: #856404;
}

.ww-legend-orange {
    background-color: #ff9300;
    color: white;
}

.ww-legend-red {
    background-color: #ff0000;
    color: white;
}

/* Map Loading */
.ww-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
}

.ww-map-loading .ww-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: ww-spin 1s linear infinite;
    margin: 0 auto 15px;
}

/* Map Attribution */
.ww-map-attribution {
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Map Popup Styles */
.ww-map-popup {
    min-width: 200px;
}

.ww-map-popup h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.ww-map-alerts-list {
    margin: 10px 0;
}

.ww-map-alert-group {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 14px;
}

.ww-map-alert-group.ww-alert-yellow {
    background-color: #fff3cd;
    border-left: 3px solid #ffda22;
}

.ww-map-alert-group.ww-alert-orange {
    background-color: #ffe5d0;
    border-left: 3px solid #ff9300;
}

.ww-map-alert-group.ww-alert-red {
    background-color: #f8d7da;
    border-left: 3px solid #ff0000;
}

.ww-map-alert-group strong {
    display: block;
    margin-bottom: 4px;
}

.ww-map-alert-areas {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.ww-map-popup-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.ww-map-view-details {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.ww-map-view-details:hover {
    text-decoration: underline;
}

/* Leaflet Customizations */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 15px;
}

.leaflet-popup-close-button {
    color: #666 !important;
    font-size: 20px !important;
    font-weight: normal !important;
    padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
    color: #333 !important;
}

/* Fullscreen Mode */
.ww-meteoalarm-map-container.ww-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 10000;
}

.ww-fullscreen .ww-map-legend {
    bottom: 40px;
    left: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ww-map-header {
        padding: 10px 15px;
    }
    
    .ww-map-header h3 {
        font-size: 18px;
    }
    
    .ww-map-legend {
        font-size: 12px;
        padding: 8px 12px;
        bottom: 20px;
    }
    
    .ww-legend-item {
        margin: 0 5px 0 0;
        padding: 2px 6px;
    }
    
    .ww-map-controls {
        gap: 5px;
    }
    
    .ww-map-fullscreen,
    .ww-map-close {
        padding: 6px 10px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .ww-map-header h3 {
        font-size: 16px;
    }
    
    .ww-map-legend {
        left: 5px;
        right: 5px;
        bottom: 10px;
        text-align: center;
    }
    
    .ww-legend-item {
        display: inline-block;
        margin: 2px;
        font-size: 11px;
    }
    
    .ww-map-popup {
        min-width: 150px;
    }
    
    .ww-map-popup h4 {
        font-size: 14px;
    }
    
    .ww-map-alert-group {
        font-size: 12px;
        padding: 6px;
    }
}

/* Loading Progress */
.ww-loading-progress {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.ww-map-loading {
    z-index: 1001;
}

/* Alerts Modal Overlay */
.ww-alerts-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
    overflow-y: auto;
}

.ww-alerts-modal {
    position: relative;
    max-width: 1200px;
    width: 90%;
    margin: 40px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.ww-alerts-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    background: #f8f9fa;
}

.ww-alerts-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.ww-alerts-modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.ww-alerts-modal-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.ww-alerts-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #0066cc;
}

.ww-alerts-modal-empty {
    text-align: center;
    color: #666;
    font-size: 16px;
    padding: 40px 20px;
}

.ww-alerts-modal-columns {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.ww-alert-modal-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ww-alert-modal-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ww-alert-modal-item.ww-alert-yellow {
    border-left: 4px solid #ffda22;
    background: linear-gradient(to right, rgba(255, 218, 34, 0.05), white);
}

.ww-alert-modal-item.ww-alert-orange {
    border-left: 4px solid #ff9300;
    background: linear-gradient(to right, rgba(255, 147, 0, 0.05), white);
}

.ww-alert-modal-item.ww-alert-red {
    border-left: 4px solid #ff0000;
    background: linear-gradient(to right, rgba(255, 0, 0, 0.05), white);
}

.ww-alert-modal-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.ww-alert-modal-icon {
    width: 36px;
    height: 36px;
    margin-right: 12px;
    flex-shrink: 0;
}

.ww-alert-modal-title-section h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ww-alert-modal-time {
    font-size: 13px;
    color: #666;
}

.ww-alert-modal-area {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ww-alert-modal-instruction {
    font-size: 14px;
    color: #333;
    background: rgba(0, 0, 0, 0.03);
    padding: 10px;
    border-radius: 4px;
    line-height: 1.5;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
    .ww-alerts-modal {
        width: 95%;
        margin: 20px auto;
    }
    
    .ww-alerts-modal-columns {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ww-alerts-modal-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .ww-alerts-modal {
        width: 100%;
        margin: 0;
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .ww-alerts-modal-content {
        padding: 15px;
    }
}