/* =====================================================
   SPLASH SCREEN - PIDT G-CASST
   Pantalla de carga innovadora
   ===================================================== */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg,
        var(--pidt-accent-tecna-ice, #0E1A4E) 0%,
        var(--pidt-primary-dark, #4459D7) 50%,
        var(--pidt-accent-tecna-ice-2, #003399) 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    overflow: hidden;
}

.splash-screen.visible {
    display: flex;
    animation: splashReveal 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.splash-screen.fade-out {
    animation: splashVanish 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashReveal {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes splashVanish {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

/* --- Canvas de particulas --- */
#splash-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.5;
}

/* --- Contenido principal --- */
.splash-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

/* --- Logo --- */
.splash-logo-wrapper {
    margin-bottom: 1.5rem;
    animation: logoEnter 1s ease-out 0.2s both;
}

.splash-logo {
    width: 140px;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.3));
}

@keyframes logoEnter {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Branding --- */
.splash-branding {
    margin-bottom: 2.5rem;
    animation: brandingEnter 1s ease-out 0.4s both;
}

.splash-title {
    font-family: var(--pidt-font-secondary, 'Public Sans', sans-serif);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: white;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #fff 0%, var(--pidt-primary, #36C1FF) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-subtitle {
    font-family: var(--pidt-font-primary, 'Karla', sans-serif);
    font-size: 0.95rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    letter-spacing: 0.5px;
    max-width: 350px;
}

@keyframes brandingEnter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Loader moderno --- */
.splash-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
    animation: loaderEnter 0.8s ease-out 0.6s both;
}

@keyframes loaderEnter {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loader-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.6;
    }
}

.loader-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Estado --- */
.splash-status {
    margin-bottom: 1.5rem;
    animation: statusEnter 0.8s ease-out 0.8s both;
}

.status-text {
    font-family: var(--pidt-font-primary, 'Karla', sans-serif);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    letter-spacing: 0.5px;
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes statusEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textGlow {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* --- Barra de progreso --- */
.splash-progress {
    width: 280px;
    animation: progressEnter 0.8s ease-out 1s both;
}

@keyframes progressEnter {
    from {
        opacity: 0;
        transform: scaleX(0.8);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

.progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.8) 0%,
        var(--pidt-primary, #36C1FF) 50%,
        rgba(255, 255, 255, 0.8) 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* --- Footer --- */
.splash-footer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.35rem;
    font-family: var(--pidt-font-primary, 'Karla', sans-serif);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    animation: footerEnter 0.8s ease-out 1.2s both;
}

.splash-footer strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

@keyframes footerEnter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .splash-logo {
        width: 100px;
    }

    .splash-title {
        font-size: 2.25rem;
        letter-spacing: 3px;
    }

    .splash-subtitle {
        font-size: 0.85rem;
        max-width: 280px;
    }

    .splash-loader {
        width: 60px;
        height: 60px;
    }

    .loader-pulse {
        width: 16px;
        height: 16px;
    }

    .splash-progress {
        width: 220px;
    }
}
