/**
 * ============================================
 * SPACE LOADER STYLES - أنماط شاشة التحميل
 * ============================================
 * أنماط مشتركة لشاشة التحميل المستخدمة في تحميل الصفحات وتبديل اللغة
 */

/* منع الوميض الأبيض */
html, body {
    background-color: #020815 !important;
}

.space-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a1628 0%, #020815 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.space-bg {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 20%, rgba(255, 23, 68, 0.05) 0%, transparent 50%);
    animation: spaceRotate 20s linear infinite;
}

@keyframes spaceRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stars-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

.stars, .stars2, .stars3 {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars {
    background-image: radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 60px 70px, #fff, transparent),
        radial-gradient(1px 1px at 50px 50px, #ddd, transparent),
        radial-gradient(1px 1px at 130px 80px, #fff, transparent),
        radial-gradient(2px 2px at 90px 10px, #eee, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: starsMove 50s linear infinite;
}

.stars2 {
    background-image: radial-gradient(1px 1px at 100px 120px, #fff, transparent),
        radial-gradient(1px 1px at 150px 160px, #ddd, transparent),
        radial-gradient(1px 1px at 180px 50px, #eee, transparent);
    background-repeat: repeat;
    background-size: 250px 250px;
    animation: starsMove 100s linear infinite;
}

.stars3 {
    background-image: radial-gradient(1px 1px at 75px 90px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 120px 140px, rgba(255,255,255,0.3), transparent);
    background-repeat: repeat;
    background-size: 300px 300px;
    animation: starsMove 150s linear infinite;
}

@keyframes starsMove {
    from { transform: translateY(0); }
    to { transform: translateY(-2000px); }
}

.loader-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.orbit-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border: 3px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.8);
    border-right-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: orbitSpin 3s linear infinite;
    background: transparent;
}

.orbit-ring-2 {
    width: 190px;
    height: 190px;
    border: 2px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.6);
    border-left-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: orbitSpin 4s linear infinite reverse;
    background: transparent;
}

@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logo-container {
    position: relative;
    width: 110px;
    height: 110px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { 
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.3)) 
                drop-shadow(0 0 40px rgba(139, 92, 246, 0.2))
                drop-shadow(0 0 60px rgba(255, 255, 255, 0.15));
    }
    50% { 
        filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.4)) 
                drop-shadow(0 0 60px rgba(139, 92, 246, 0.3))
                drop-shadow(0 0 90px rgba(255, 255, 255, 0.2));
    }
}

.loader-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4))
            drop-shadow(0 0 25px rgba(0, 212, 255, 0.3));
    animation: logoFloat 3s ease-in-out infinite, logoGlowPulse 2s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes logoGlowPulse {
    0%, 100% { 
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4))
                drop-shadow(0 0 25px rgba(0, 212, 255, 0.3));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.5))
                drop-shadow(0 0 40px rgba(0, 212, 255, 0.4))
                drop-shadow(0 0 60px rgba(139, 92, 246, 0.3));
    }
}

.loading-text {
    position: absolute;
    bottom: -100px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* تأثير الاختفاء بالشفافية */
.space-loader.fade-out {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}
