/* ============================================
   SPACE NAVIGATION SYSTEM - نظام التنقل الفضائي
   ============================================ */

/* إلغاء السكرول التقليدي */
html {
    scroll-behavior: smooth !important;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

/* تأثيرات انتقال الصفحات */
body {
    transition: none;
}

body.page-transitioning-out {
    animation: pageWarpOut 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* الحفاظ على الهيدر ثابت أثناء الانتقال */
.professional-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000 !important;
    transform: none !important;
    filter: none !important;
}

/* ============================================
   WARP SPEED ANIMATIONS - تأثيرات سرعة الضوء
   ============================================ */

@keyframes pageWarpOut {
    0% {
        opacity: 1;
        transform: scale(1) translateX(0);
        filter: blur(0px) brightness(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2) translateX(0);
        filter: blur(15px) brightness(1.5);
    }
    100% {
        opacity: 0;
        transform: scale(1.5) translateX(0);
        filter: blur(30px) brightness(2);
    }
}

/* ============================================
   SPACE PARTICLES - جزيئات فضائية
   ============================================ */

.warp-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.warp-particles.active {
    opacity: 1;
}

.warp-particle {
    position: absolute;
    width: 2px;
    height: 100px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        rgba(0, 212, 255, 0.8) 50%, 
        transparent 100%);
    opacity: 0;
}

.warp-particle.animating {
    animation: warpParticle 0.5s ease-out forwards;
}

@keyframes warpParticle {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) scaleY(0.1);
    }
    50% {
        opacity: 1;
        transform: translateX(var(--tx)) translateY(var(--ty)) scaleY(1);
    }
    100% {
        opacity: 0;
        transform: translateX(calc(var(--tx) * 2)) translateY(calc(var(--ty) * 2)) scaleY(2);
    }
}

/* ============================================
   NAVIGATION CONTROLS - أزرار التنقل (مخفية)
   ============================================ */

.space-nav-controls {
    display: none !important;
}

.space-nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 212, 255, 0.3);
    color: rgba(0, 212, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2),
                inset 0 0 20px rgba(0, 212, 255, 0.05);
}

.space-nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
}

.space-nav-btn:hover::before {
    width: 200%;
    height: 200%;
}

.space-nav-btn:hover {
    transform: scale(1.15);
    border-color: rgba(0, 212, 255, 0.8);
    color: rgba(0, 212, 255, 1);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.6),
                inset 0 0 30px rgba(0, 212, 255, 0.1);
}

.space-nav-btn.active {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 1);
    color: #fff;
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.8),
                inset 0 0 40px rgba(0, 212, 255, 0.2);
}

.space-nav-btn i {
    font-size: 20px;
    position: relative;
    z-index: 1;
}

/* Tooltip */
.space-nav-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.space-nav-btn:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* ============================================
   PROGRESS INDICATOR - مؤشر التقدم (مخفي)
   ============================================ */

.space-progress {
    display: none !important;
}

.space-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
    position: relative;
}

.space-progress-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.space-progress-dot.active {
    background: rgba(0, 212, 255, 1);
    border-color: rgba(0, 212, 255, 1);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
    transform: scale(1.5);
}

.space-progress-dot.active::before {
    width: 200%;
    height: 200%;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* ============================================
   WARP EFFECT OVERLAY - طبقة تأثير الوارب
   ============================================ */

.warp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        transparent 0%, 
        rgba(0, 212, 255, 0.1) 50%, 
        rgba(139, 92, 246, 0.2) 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 9998;
    transition: opacity 0.3s ease;
}

.warp-overlay.active {
    opacity: 1;
    animation: warpPulse 1.2s ease-in-out;
}

@keyframes warpPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.1);
        filter: brightness(1.5);
    }
}

/* ============================================
   SPACE GRID - شبكة فضائية
   ============================================ */

.space-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0;
    pointer-events: none;
    z-index: 9997;
    transition: opacity 0.5s ease;
}

.space-grid.active {
    opacity: 1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }
    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

/* ============================================
   KEYBOARD HINT - تلميح لوحة المفاتيح (مخفي)
   ============================================ */

.keyboard-hint {
    display: none !important;
}

.keyboard-hint .key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 35px;
    padding: 0 12px;
    background: rgba(0, 212, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: rgba(0, 212, 255, 1);
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.2);
}

/* ============================================
   RESPONSIVE - استجابة للشاشات الصغيرة
   ============================================ */

@media (max-width: 768px) {
    .space-nav-controls {
        right: 20px;
        gap: 15px;
    }
    
    .space-nav-btn {
        width: 50px;
        height: 50px;
    }
    
    .space-nav-btn i {
        font-size: 18px;
    }
    
    .space-nav-btn::after {
        display: none;
    }
    
    .space-progress {
        left: 20px;
        gap: 12px;
    }
    
    .space-progress-dot {
        width: 10px;
        height: 10px;
    }
    
    .keyboard-hint {
        display: none;
    }
}

/* ============================================
   RTL SUPPORT - دعم اللغة العربية
   ============================================ */

[dir="rtl"] .space-nav-controls {
    right: auto;
    left: 40px;
}

[dir="rtl"] .space-nav-btn::after {
    right: auto;
    left: 75px;
    transform: translateY(-50%) translateX(-10px);
}

[dir="rtl"] .space-nav-btn:hover::after {
    transform: translateY(-50%) translateX(0);
}

[dir="rtl"] .space-progress {
    left: auto;
    right: 40px;
}

@media (max-width: 768px) {
    [dir="rtl"] .space-nav-controls {
        left: 20px;
    }
    
    [dir="rtl"] .space-progress {
        right: 20px;
    }
}

/* ============================================
   LOADING ANIMATION - تأثير التحميل
   ============================================ */

.space-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #2563eb 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.space-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.space-loading-content {
    text-align: center;
    color: white;
}

.space-loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-right-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.space-loading-text {
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(90deg, #00d4ff 0%, #8b5cf6 50%, #ff1744 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}
