/* ============================= */
/* GLOBAL LOADING OVERLAY */
/* ============================= */

.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.94);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    z-index: 999999; /* 🔥 más alto por seguridad */

    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.global-loading-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}


/* ============================= */
/* CONTENIDO DEL LOADER */
/* ============================= */

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 140px;
    max-width: 90vw;
    padding: 20px;

    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}


/* ICONO */
.loading-icon {
    font-size: 48px;
    color: #1d4ed8;
    margin-bottom: 10px;
}


/* BARRA */
.loading-bar {
    width: 100%;
    height: 4px;
    background: #dbeafe;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.loading-bar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 40%;
    height: 100%;
    background: #2563eb;
    animation: loadingAnimation 1.4s ease-in-out infinite;
}

@keyframes loadingAnimation {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(20%); }
    100% { transform: translateX(100%); }
}


/* Mensaje de texto dentro del loader */
.loading-message {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b; /* Gris oscuro profesional */
    margin-top: 12px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
    
    /* Animación suave de entrada */
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Cuando el mensaje tiene texto, lo hacemos visible */
.loading-message:not(:empty) {
    opacity: 1;
    transform: translateY(0);
}