/* =================================================================== */
/*        MÓDULO DE ESTILOS PARA LOADERS (loaders.css)                 */
/*        Estilos aislados y de alta especificidad.                    */
/* =================================================================== */

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-spinner);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loader-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loader-content {
    background: var(--color-primary); /* Fondo oscuro garantizado */
    color: #FFF; /* Texto blanco por defecto */
    padding: 30px 40px;
    border-radius: var(--border-radius-large);
    text-align: center;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#loader-overlay.show .loader-content {
    transform: scale(1);
    opacity: 1;
}

.loader-icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: var(--color-surface);
    display: block;
    animation: popIn 0.6s ease-out;
}

#loader-text {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.5;
    min-height: 3.3rem; /* Espacio para dos líneas de texto */
    color: #FFF !important; /* Forzamos el color para máxima seguridad */
}

/* Animación para el cambio de texto */
#loader-text.fade-out {
    animation: fadeOutText 0.25s ease-out forwards;
}
#loader-text.fade-in {
    animation: fadeInText 0.25s 0.25s ease-out forwards;
}

@keyframes fadeInText {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOutText {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Animación genérica usada por el icono */
@keyframes popIn { 
    from { opacity: 0; transform: scale(0.8); } 
    to { opacity: 1; transform: scale(1); } 
}