/* =====================================================================
   شاشة التحميل (Splash) بشعار «بياض الثلج»
   تظهر عند فتح الصفحة الرئيسية ثم تختفي تلقائياً بعد اكتمال التحميل.
   ===================================================================== */
html.splash-lock,
html.splash-lock body {
    overflow: hidden;
}

.splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    background:
        radial-gradient(circle at 50% 42%, rgba(91, 184, 232, 0.16) 0%, rgba(255, 255, 255, 0) 55%),
        #ffffff;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}

.splash.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash.is-hidden .splash-logo {
    transform: scale(1.08);
}

/* أيقونة الشعار: تظهر بتكبير ناعم مع إزالة الضبابية ثم تطفو بخفة */
.splash-icon {
    width: min(150px, 38vw);
    height: auto;
    opacity: 0;
    transform: scale(0.6) translateY(12px);
    filter: blur(8px);
    animation:
        splash-pop 0.9s cubic-bezier(0.22, 1.2, 0.36, 1) 0.15s forwards,
        splash-float 3s ease-in-out 1.2s infinite;
}

/* اسم المغسلة: يُكشف من اليمين إلى اليسار مع لمعة تمر عليه */
.splash-text-wrap {
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.splash-text {
    width: min(270px, 66vw);
    height: auto;
    clip-path: inset(0 0 0 100%);
    animation: splash-reveal 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.75s forwards;
}

.splash-text-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    right: -60%;
    background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0) 100%);
    animation: splash-shine 1.1s ease-in-out 1.7s forwards;
}

/* شريط التقدم */
.splash-bar {
    width: min(180px, 46vw);
    height: 4px;
    border-radius: 999px;
    background: #e6eef6;
    overflow: hidden;
    opacity: 0;
    animation: splash-fade 0.4s ease 0.9s forwards;
}

.splash-bar span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1e4e8c, #5bb8e8);
    animation: splash-progress 1.2s ease-in-out infinite;
}

/* فقاعات صابون خفيفة في الخلفية */
.splash-bubbles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.splash-bubbles i {
    position: absolute;
    bottom: -40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(91, 184, 232, 0.25) 60%, rgba(30, 78, 140, 0.12));
    border: 1px solid rgba(91, 184, 232, 0.35);
    animation: splash-bubble linear infinite;
}

.splash-bubbles i:nth-child(1) { right: 12%; width: 18px; height: 18px; animation-duration: 6s; }
.splash-bubbles i:nth-child(2) { right: 28%; width: 10px; height: 10px; animation-duration: 4.5s; animation-delay: 0.8s; }
.splash-bubbles i:nth-child(3) { right: 46%; width: 24px; height: 24px; animation-duration: 7s; animation-delay: 0.3s; }
.splash-bubbles i:nth-child(4) { right: 64%; width: 12px; height: 12px; animation-duration: 5s; animation-delay: 1.2s; }
.splash-bubbles i:nth-child(5) { right: 80%; width: 20px; height: 20px; animation-duration: 6.5s; animation-delay: 0.5s; }
.splash-bubbles i:nth-child(6) { right: 90%; width: 9px; height: 9px; animation-duration: 4s; animation-delay: 1.6s; }

@keyframes splash-pop {
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

@keyframes splash-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes splash-reveal {
    to { clip-path: inset(0 0 0 0); }
}

@keyframes splash-shine {
    to { right: 120%; }
}

@keyframes splash-fade {
    to { opacity: 1; }
}

@keyframes splash-progress {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-250%); }
}

@keyframes splash-bubble {
    0% { transform: translateY(0) scale(0.8); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translateY(-110vh) scale(1.1); opacity: 0; }
}

/* احترام إعداد تقليل الحركة في الجهاز */
@media (prefers-reduced-motion: reduce) {
    .splash *,
    .splash *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
    }
    .splash-bubbles { display: none; }
}
