/**
 * SPARK Logout Splash Screen - SIMPLIFIED FOR PERFORMANCE
 * Reverse animation - logo zooms in from large to small (stepping away effect)
 */

:root {
    --logout-splash-bg: #05070d;
    --logout-splash-duration: 1.4s;
    --logout-splash-zoom-scale: 32;
}

/* Logout splash overlay */
.logout-splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    background: var(--logout-splash-bg);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
}

.logout-splash-overlay.logout-splash-active {
    pointer-events: auto;
}

/* Logo container */
.logout-splash-logo-container {
    position: relative;
    box-sizing: border-box;
    padding: 24px;
    width: min(clamp(220px, 28vw, 360px), calc(100vw - 48px));
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Logo element - reverse animation */
.logout-splash-logo {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 160px);
    height: auto;
    object-fit: contain;
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(var(--logout-splash-zoom-scale));
}

/* Activate reverse animation */
.logout-splash-active {
    animation: fadeInSplash 0.3s ease-in forwards;
}

.logout-splash-active .logout-splash-logo {
    animation: logoZoomReverse var(--logout-splash-duration) cubic-bezier(0.87, 0, 0.13, 1) forwards;
}

/* Reverse animations - zoom from large to small */
@keyframes fadeInSplash {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes logoZoomReverse {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(var(--logout-splash-zoom-scale));
    }
    
    48% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    
    72% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
    
    100% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(0.8);
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .logout-splash-logo-container {
        padding: 20px;
        width: min(clamp(200px, 68vw, 300px), calc(100vw - 40px));
    }
    
    :root {
        --logout-splash-zoom-scale: 48;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .logout-splash-active .logout-splash-logo {
        animation: logoFadeOnlyReverse 0.8s ease-in forwards;
    }
    
    @keyframes logoFadeOnlyReverse {
        0% {
            opacity: 0;
        }
        30% {
            opacity: 1;
        }
        70% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }
}
