/**
 * Weather Maps Used - Estilos
 */

/* Contenedor principal */
.weather-map-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 30px 0;
}

/* Cabecera */
.weather-map-header {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.weather-map-title {
    margin: 0;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-map-title .dashicons {
    font-size: 1.2em;
}

/* Botones de capas */
.weather-map-layers {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.weather-layer-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-layer-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

.weather-layer-btn.active {
    background: white;
    color: #0073aa;
    border-color: white;
    font-weight: bold;
}

.weather-layer-btn span {
    display: inline;
}

/* Mapa */
.weather-map {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Aviso informativo */
.weather-map-tip {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin: 0;
    font-size: 0.9em;
    color: #856404;
}

.weather-map-tip strong {
    color: #533f03;
}

/* Sobrescribir estilos de Leaflet para mejor apariencia */
.weather-map .leaflet-popup-content-wrapper {
    border-radius: 8px;
    font-size: 14px;
}

.weather-map .leaflet-popup-content {
    margin: 12px;
}

/* Footer */
.weather-map-footer {
    background: #f5f7fa;
    padding: 15px 20px;
    border-top: 1px solid #ddd;
}

.weather-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.legend-item {
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-item strong {
    color: #333;
}

.legend-colors {
    display: flex;
    gap: 8px;
}

.legend-colors span {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid rgba(0,0,0,0.1);
}

.weather-map-info {
    margin: 0;
    text-align: center;
    color: #666;
}

.weather-map-info a {
    color: #0073aa;
    text-decoration: none;
}

.weather-map-info a:hover {
    text-decoration: underline;
}

/* Error */
.weather-map-error {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.weather-map-error p {
    margin: 10px 0;
    color: #856404;
}

/* Responsive */
@media (max-width: 768px) {
    .weather-map-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .weather-map-title {
        justify-content: center;
        font-size: 1.3em;
    }
    
    .weather-map-layers {
        justify-content: center;
    }
    
    .weather-layer-btn {
        flex: 1;
        justify-content: center;
        min-width: 70px;
    }
    
    .weather-layer-btn span {
        display: none;
    }
    
    .weather-map {
        height: 400px !important;
    }
    
    .weather-map-legend {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .weather-map-header {
        padding: 15px;
    }
    
    .weather-layer-btn {
        padding: 8px 12px;
        font-size: 1.2em;
    }
    
    .weather-map {
        height: 350px !important;
    }
    
    .legend-colors {
        flex-wrap: wrap;
    }
}

/* Animación de carga */
.weather-map.loading::before {
    content: "⏳ Cargando mapa...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    font-size: 1.2em;
    color: #0073aa;
}
