/**
 * Quick Step - Premium Splash Screen
 * Bento Grid Style - Smooth & Elegant Animations
 */

/* ============================================
   SPLASH SCREEN - BENTO STYLE
   ============================================ */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F2F2F2;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    overflow: hidden;
}

/* Subtle Grid Pattern Background */
.splash-screen::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(112, 189, 182, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(112, 189, 182, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* ============================================
   BENTO CONTAINER
   ============================================ */
.splash-bento {
    display: grid;
    grid-template-columns: 200px 200px;
    grid-template-rows: 120px 120px;
    gap: 16px;
    position: relative;
    z-index: 2;
}

/* ============================================
   SPLASH CARDS - Matching Bento Style
   ============================================ */
.splash-card {
    background: #111111;
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px) scale(0.9);
}

/* Card 1 - Logo (spans 2 columns) */
.splash-card-logo {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #70BDB6 0%, #5BA8A1 100%);
    align-items: center;
    justify-content: center;
    animation: cardRevealSmooth 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s forwards;
}

.splash-card-logo .splash-logo-text {
    font-family: 'Inter', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #111111;
    letter-spacing: 0.1em;
}

/* Card Header (matching bento style) */
.splash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: auto;
}

.splash-card-icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-card-icon svg {
    width: 18px;
    height: 18px;
    stroke: #F2F2F2;
}

.splash-card-dots {
    display: flex;
    gap: 4px;
}

.splash-card-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Card 2 - Arabic Text */
.splash-card-ar {
    animation: cardRevealSmooth 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s forwards;
}

.splash-card-ar .splash-text-ar {
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #F2F2F2;
    line-height: 1.5;
    margin-top: auto;
}

/* Card 3 - English Text */
.splash-card-en {
    background: #FF9779;
    animation: cardRevealSmooth 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s forwards;
}

.splash-card-en .splash-text-en {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #111111;
    line-height: 1.5;
    margin-top: auto;
}

.splash-card-en .splash-card-icon {
    background: rgba(17, 17, 17, 0.1);
}

.splash-card-en .splash-card-icon svg {
    stroke: #111111;
}

.splash-card-en .splash-card-dots span {
    background: rgba(17, 17, 17, 0.3);
}

/* ============================================
   LOADING BAR
   ============================================ */
.splash-loading {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    opacity: 0;
    animation: fadeInSmooth 0.8s ease 0.9s forwards;
}

.splash-loading-bar {
    width: 120px;
    height: 3px;
    background: rgba(17, 17, 17, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.splash-loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #70BDB6, #FF9779);
    border-radius: 3px;
    animation: loadProgressSmooth 2.5s cubic-bezier(0.4, 0, 0.2, 1) 1s forwards;
}

.splash-loading-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(17, 17, 17, 0.5);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* ============================================
   KEYFRAME ANIMATIONS - SMOOTH
   ============================================ */
@keyframes cardRevealSmooth {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInSmooth {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes loadProgressSmooth {
    0% { width: 0%; }
    30% { width: 30%; }
    60% { width: 60%; }
    90% { width: 90%; }
    100% { width: 100%; }
}

/* ============================================
   EXIT ANIMATION - Smooth Fade & Scale Up
   ============================================ */
.splash-screen.splash-exit .splash-card {
    animation: cardExitSmooth 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.splash-screen.splash-exit .splash-card-logo {
    animation-delay: 0.15s;
}

.splash-screen.splash-exit .splash-card-ar {
    animation-delay: 0s;
}

.splash-screen.splash-exit .splash-card-en {
    animation-delay: 0.08s;
}

.splash-screen.splash-exit .splash-loading {
    animation: fadeOutSmooth 0.4s ease forwards;
}

.splash-screen.splash-exit {
    animation: splashFadeOutSmooth 1s cubic-bezier(0.4, 0, 0.2, 1) 0.4s forwards;
}

@keyframes cardExitSmooth {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px) scale(1.05);
    }
}

@keyframes fadeOutSmooth {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes splashFadeOutSmooth {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* ============================================
   PAGE TRANSITION - Smooth Curtain Effect
   ============================================ */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999998;
    pointer-events: none !important;
    display: flex;
    visibility: hidden !important;
    opacity: 0 !important;
}

.page-transition.entering {
    visibility: visible !important;
    opacity: 1 !important;
}

.page-transition-panel {
    flex: 1;
    background: linear-gradient(180deg, #111111 0%, #1a1a1a 100%);
    transform: scaleY(0);
    transform-origin: bottom;
    opacity: 0;
}

.page-transition.entering .page-transition-panel {
    opacity: 1;
}

/* Ensure splash screen is fully removed */
.splash-screen.splash-exit {
    pointer-events: none !important;
}

/* Entering Animation - Panels sweep up then down */
.page-transition.entering .page-transition-panel {
    animation: panelSweep 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Staggered panels for wave effect */
.page-transition-panel:nth-child(1) { animation-delay: 0s; }
.page-transition-panel:nth-child(2) { animation-delay: 0.08s; }
.page-transition-panel:nth-child(3) { animation-delay: 0.16s; }
.page-transition-panel:nth-child(4) { animation-delay: 0.24s; }

@keyframes panelSweep {
    0% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
    45% {
        transform: scaleY(1);
        transform-origin: bottom;
    }
    55% {
        transform: scaleY(1);
        transform-origin: top;
    }
    100% {
        transform: scaleY(0);
        transform-origin: top;
    }
}

/* Alternative: Fade Transition (backup) */
.page-transition-fade {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F2F2F2;
    z-index: 9999998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition-fade.active {
    opacity: 1;
    pointer-events: all;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 500px) {
    .splash-bento {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        width: 90%;
        max-width: 300px;
    }

    .splash-card-logo {
        grid-column: 1;
        padding: 32px;
    }

    .splash-card {
        padding: 20px;
    }

    .splash-card-logo .splash-logo-text {
        font-size: 2rem;
    }
}
