/**
 * Estilos para la Barra de Alertas de Emergencia.
 *
 * Define la apariencia de la barra, incluyendo los colores dinámicos
 * para los diferentes niveles de alerta (amarilla, naranja, roja).
 * ACTUALIZADO: Aumentada especificidad de selectores y ajustado posicionamiento.
 *
 * @version 1.0.1
 * @date 2025-07-07
 * @author Baxahaun
 * // PEV_REF: TAREA_CORE_02_LayoutFix
 */

/* --- Contenedor Principal de la Barra de Alerta --- */
#emergency-alert-bar-container.emergency-alert-bar {
    padding: 0.75rem 1rem;
    color: #fff; /* Color de texto por defecto, se sobreescribe por nivel */
    border-bottom: 3px solid rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: sticky; /* Esencial para que se pegue */
    /* 'top' se establece dinámicamente con JS desde main.js */
    left: 0;
    width: 100%;
    z-index: 1021; /* Justo por encima del header (1020) y debajo de offcanvas (1045) */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
    transform: translateY(0); /* Asegura que no esté oculto por defecto */
    opacity: 1;
}

/* --- Niveles de Alerta (Colores) - Selectores más específicos --- */
#emergency-alert-bar-container.alert-level--amarilla {
    background-color: #ffc107 !important; /* Amarillo de Bootstrap */
    color: #000 !important; /* Texto negro para contraste sobre amarillo */
    border-bottom-color: #cca300 !important;
}

#emergency-alert-bar-container.alert-level--naranja {
    background-color: #fd7e14 !important; /* Naranja de Bootstrap */
    color: #fff !important; /* Texto blanco para contraste sobre naranja */
    border-bottom-color: #c8640e !important;
}

#emergency-alert-bar-container.alert-level--roja {
    background-color: #dc3545 !important; /* Rojo de Bootstrap */
    color: #fff !important; /* Texto blanco para contraste sobre rojo */
    border-bottom-color: #b02a37 !important;
    animation: pulseRedAlert 2s infinite ease-in-out;
}

/* --- Contenido Interno --- */
.emergency-alert-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.emergency-alert-bar__content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.emergency-alert-bar__icon {
    font-size: 1.4rem;
    vertical-align: middle;
    line-height: 1;
    animation: pulseIcon 2s infinite ease-in-out;
}

.emergency-alert-bar__message {
    font-weight: 500;
}

.emergency-alert-bar__source {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.emergency-alert-bar__source:hover {
    color: inherit;
    opacity: 1;
    text-decoration: underline;
}

/* --- Botón de Cierre --- */
.emergency-alert-bar__close-btn {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.8;
    padding: 0.25rem 0.5rem;
    margin-left: 1rem;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 50%;
}

.emergency-alert-bar__close-btn:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.emergency-alert-bar__close-btn .material-symbols-filled {
    font-size: 1.25rem;
    vertical-align: middle;
}


/* --- Animaciones --- */
@keyframes pulseRedAlert {
    0% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

@keyframes pulseIcon {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
