/* ==========================================================================
   TARJETA GLOBAL DE CARGA INSTITUCIONAL SiCAE - IPN
   Diseño Cuadrangular Centrado • Fondo Blanco y Acentos Guinda (#750946)
   ========================================================================== */

/* Overlay de bloqueo suave con efecto desenfoque */
.sicae-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sicae-loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Tarjeta Cuadrangular Centrada en el Medio con Fondo Blanco */
.sicae-loading-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%) scale(0.92);
    width: 90%;
    max-width: 350px;
    min-height: 260px;
    background: #ffffff;
    color: #1f2937;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25),
                0 10px 25px rgba(117, 9, 70, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(117, 9, 70, 0.12);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    font-family: var(--SiCAE-font-primary, 'Noto Sans', sans-serif);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sicae-loading-banner.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Cuerpo interno de la tarjeta */
.sicae-loading-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 26px 30px 26px;
    width: 100%;
    box-sizing: border-box;
    gap: 18px;
    flex: 1;
}

/* Spinner / Icono Institucional Guinda */
.sicae-loading-icon-wrapper {
    position: relative;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdf2f6;
    border: 1.5px solid rgba(117, 9, 70, 0.16);
    border-radius: 22px;
    box-shadow: 0 8px 20px rgba(117, 9, 70, 0.08),
                inset 0 1px 2px rgba(255, 255, 255, 0.9);
}

.sicae-loading-spinner {
    width: 42px;
    height: 42px;
    border: 3.5px solid rgba(117, 9, 70, 0.15);
    border-top-color: #750946;
    border-right-color: #a02f41;
    border-radius: 50%;
    animation: sicaeSpin 0.9s cubic-bezier(0.6, 0.2, 0.4, 0.9) infinite;
}

.sicae-loading-icon-pulse {
    position: absolute;
    width: 13px;
    height: 13px;
    background: #750946;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(117, 9, 70, 0.5);
    animation: sicaePulseDot 1.4s ease-in-out infinite;
}

/* Contenido de texto central */
.sicae-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sicae-loading-title {
    margin: 0 0 8px 0;
    font-size: 1.18rem;
    font-weight: 700;
    color: #750946;
    line-height: 1.35;
    text-align: center;
}

.sicae-loading-message {
    margin: 0;
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.48;
    font-weight: 400;
    text-align: center;
    max-width: 290px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sicae-loading-message.is-fading {
    opacity: 0;
    transform: translateY(4px);
}

/* Barra de progreso shimmer en el borde inferior con gradiente Guinda */
.sicae-loading-progress-bar {
    position: relative;
    width: 100%;
    height: 5px;
    background: #f3f4f6;
    overflow: hidden;
}

.sicae-loading-progress-line {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #750946 50%, 
        #a02f41 80%, 
        transparent 100%);
    box-shadow: 0 0 8px rgba(117, 9, 70, 0.4);
    animation: sicaeShimmer 1.6s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animaciones */
@keyframes sicaeSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes sicaePulseDot {
    0%, 100% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; }
}

@keyframes sicaeShimmer {
    0% {
        left: -50%;
    }
    100% {
        left: 100%;
    }
}

/* Responsividad para móviles */
@media (max-width: 480px) {
    .sicae-loading-banner {
        max-width: 300px;
        min-height: 250px;
        border-radius: 20px;
    }
    
    .sicae-loading-body {
        padding: 28px 20px 24px 20px;
        gap: 16px;
    }

    .sicae-loading-icon-wrapper {
        width: 66px;
        height: 66px;
        border-radius: 18px;
    }

    .sicae-loading-spinner {
        width: 36px;
        height: 36px;
    }

    .sicae-loading-title {
        font-size: 1.08rem;
    }

    .sicae-loading-message {
        font-size: 0.84rem;
    }
}
