/* =====================================================
   AZAL Airlines - Ultimate Cinematic Splash Screen
   Restored and optimized for perfect brand colors
   ===================================================== */

.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary); /* Use official primary navy */
    overflow: hidden;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.splash-screen.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Subtle Clouds for depth */
.splash-clouds {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    opacity: 0.1;
    background-image: radial-gradient(circle at 20% 30%, #fff 1%, transparent 10%),
                      radial-gradient(circle at 80% 70%, #fff 1.5%, transparent 12%),
                      radial-gradient(circle at 40% 80%, #fff 0.8%, transparent 8%);
    background-size: 300px 300px;
    animation: driftClouds 30s linear infinite;
    z-index: 1;
}

@keyframes driftClouds {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(5deg) scale(1.2); }
}

/* The Plane */
.splash-plane-wrapper {
    position: absolute;
    top: 50%;
    left: -10%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    z-index: 10;
    /* Plane flies across in 1.5s */
    animation: flyPlane 1.5s cubic-bezier(0.5, 0.0, 0.2, 1) forwards;
    filter: drop-shadow(0 0 15px rgba(200, 164, 92, 0.9));
}

.splash-plane-icon {
    width: 100%;
    height: 100%;
    transform: rotate(90deg); /* Point right */
}

@keyframes flyPlane {
    0% { left: -10%; transform: translateY(-50%) scale(0.8); }
    50% { transform: translateY(-50%) scale(1.2); } /* Slightly closer in the middle */
    100% { left: 110%; transform: translateY(-50%) scale(0.8); }
}

/* The Glowing Contrail Line */
.splash-line-container {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
    z-index: 5;
}

.splash-line {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, transparent, var(--color-accent), #fff);
    box-shadow: 0 0 15px var(--color-accent), 0 0 30px var(--color-accent);
    /* Line draws as plane flies, then dissipates */
    animation: drawLine 1.5s cubic-bezier(0.5, 0.0, 0.2, 1) forwards, 
               fadeLine 0.6s ease-out 1.6s forwards;
}

@keyframes drawLine {
    0% { width: 0%; opacity: 1; }
    100% { width: 100%; opacity: 1; }
}

@keyframes fadeLine {
    0% { opacity: 1; height: 2px; }
    100% { opacity: 0; height: 100px; filter: blur(20px); }
}

/* Circular Flash Effect */
.splash-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    box-shadow: 0 0 60px 30px var(--color-accent);
    z-index: 15;
    /* Flash triggers exactly before logo appears */
    animation: flashBang 1s ease-out 1.3s forwards;
    opacity: 0;
}

@keyframes flashBang {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    30% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(100); opacity: 0; }
}

/* Center Content */
.splash-content {
    position: relative;
    z-index: 20;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo Reveal */
.splash-logo-container {
    perspective: 1000px;
    margin-bottom: 25px;
    position: relative;
}

/* SOFT WHITE GLOW to make the dark logo pop on the navy background */
.splash-logo-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    animation: explodeGlow 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.5s forwards;
}

.splash-logo {
    width: 200px;
    height: auto;
    opacity: 0;
    transform: scale(0.3) translateY(80px) rotateX(60deg);
    /* Explodes into view after flash */
    animation: explodeLogo 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.5s forwards;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.6));
}

@keyframes explodeGlow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes explodeLogo {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(80px) rotateX(60deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0) rotateX(0deg);
    }
}

/* Text Reveal */
.splash-text-container {
    opacity: 0;
    transform: translateY(20px);
    animation: revealText 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 2.2s forwards;
}

.splash-title {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 10px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.splash-tagline {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    color: var(--color-accent);
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 4px;
}

@keyframes revealText {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .splash-logo { width: 150px; }
    .splash-logo-container::before { width: 180px; height: 180px; }
    .splash-title { font-size: 20px; letter-spacing: 6px; }
    .splash-tagline { font-size: 14px; letter-spacing: 2px; }
    .splash-plane-wrapper { width: 30px; height: 30px; }
}
