/* =========================================
   1. CORE VARIABLES & RESET
   ========================================= */
:root {
    --primary: #00f3ff;       /* Electric Cyan */
    --secondary: #ffd700;     /* تم التغيير لـ Cyber Gold */
    --bg-dark: #02050a;       /* Almost Black */
    --glass: rgba(10, 20, 40, 0.75); /* Darker glass for readability */
    --border: rgba(0, 243, 255, 0.3);
    --text-main: #e0e6ed;
    --text-muted: #94a3b8;
    
    --font-head: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    
    --glow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(0, 243, 255, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
/* جعل المؤشر طبيعي في الموبايل لسهولة الاستخدام */
@media (pointer: fine) { * { cursor: none; } }

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden; /* يمنع سكرول الصفحة بالكامل */
    height: 100vh;
    width: 100vw;
}

/* =========================================
   2. BACKGROUND & ATMOSPHERE
   ========================================= */
.bg-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -10; }

.main-bg {
    width: 100%; height: 100%;
    background: url('bg.jpg') no-repeat center center/cover;
    filter: brightness(0.4) contrast(1.2) saturate(1.1);
}

.grid-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1; pointer-events: none;
}

.vignette {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 40%, #000 100%);
    z-index: 2; pointer-events: none;
}

#particles { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }

/* =========================================
   3. SYSTEM UI DECORATIONS
   ========================================= */
/* إخفاء الزخارف في الموبايل لتوفير مساحة */
.system-border, .corner-bracket { pointer-events: none; }
.system-border { position: fixed; left: 5%; width: 90%; height: 1px; background: rgba(0,243,255,0.2); z-index: 100; }
.system-border.top { top: 100px; }
.system-border.bottom { bottom: 50px; }

.corner-bracket { position: fixed; width: 30px; height: 30px; border: 2px solid var(--primary); z-index: 100; opacity: 0.7; }
.top-left { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.top-right { top: 20px; right: 20px; border-left: none; border-bottom: none; }
.bottom-left { bottom: 20px; left: 20px; border-right: none; border-top: none; }
.bottom-right { bottom: 20px; right: 20px; border-left: none; border-top: none; }

/* =========================================
   4. CURSOR (DESKTOP ONLY)
   ========================================= */
@media (pointer: fine) {
    .cursor-dot { width: 6px; height: 6px; background: var(--primary); border-radius: 50%; position: fixed; pointer-events: none; z-index: 9999; }
    .cursor-circle { 
        width: 40px; height: 40px; 
        border: 1px dashed var(--primary); 
        border-radius: 50%; position: fixed; pointer-events: none; z-index: 9999;
        animation: spin 10s linear infinite; 
        transition: width 0.3s, height 0.3s;
    }
    body.hovering .cursor-circle { width: 60px; height: 60px; background: rgba(0,243,255,0.1); border-style: solid; }
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =========================================
   5. NAVIGATION
   ========================================= */
.cyber-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 50px; z-index: 500;
    backdrop-filter: blur(5px);
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
}

.brand { display: flex; align-items: center; gap: 15px; color: #fff; }
.logo-icon { font-size: 2rem; color: var(--primary); text-shadow: var(--glow); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text .main { font-family: var(--font-head); font-weight: 900; font-size: 1.5rem; letter-spacing: 2px; }
.brand-text .sub { font-family: var(--font-mono); font-size: 0.8rem; color: var(--primary); letter-spacing: 4px; }

.nav-modules { display: flex; gap: 10px; }
.nav-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted); padding: 10px 25px;
    font-family: var(--font-mono); font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px;
    transition: 0.3s; cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.nav-btn:hover, .nav-btn.active {
    background: rgba(0,243,255,0.1);
    border-color: var(--primary);
    color: #fff;
    text-shadow: 0 0 5px var(--primary);
}
.glow-btn { border-color: var(--primary); color: var(--primary); }

/* =========================================
   6. SCREENS & LAYERS (FIXED LAYOUT)
   ========================================= */
.viewport { 
    position: relative; width: 100%; height: 100vh; overflow: hidden; 
}

.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden; transition: 0.6s ease-in-out;
    transform: scale(0.95) translateY(30px);
    overflow-y: auto; /* يسمح بالسكرول إذا المحتوى طويل */
    display: flex; 
    flex-direction: column;
    align-items: center; 
    justify-content: center; /* يوسط المحتوى عمودياً */
    padding: 100px 20px 60px 20px; /* هوامش لتجنب تداخل النافبار والحدود */
    scrollbar-width: thin; scrollbar-color: var(--primary) transparent;
}
/* تخصيص السكرول بار */
.screen::-webkit-scrollbar { width: 6px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.active-screen { opacity: 1; visibility: visible; transform: scale(1) translateY(0); z-index: 10; }

/* === HOME SECTION === */
#home.screen { padding: 0; display: block; overflow: hidden; } /* الهوم فيديو لا يحتاج سكرول */
.bg-video { width: 100%; height: 100%; object-fit: cover; }
.scanlines { position: absolute; top:0;left:0;width:100%;height:100%; background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06)); background-size: 100% 2px, 3px 100%; pointer-events: none; }

.intro-content {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    text-align: center; width: 100%; z-index: 20;
}
.mega-title {
    font-family: var(--font-head); font-size: 5vw; line-height: 1;
    font-weight: 900; letter-spacing: 5px; color: #fff;
    text-shadow: 0 0 30px rgba(255,255,255,0.2);
}
.mega-title.cyan { color: transparent; -webkit-text-stroke: 2px var(--primary); text-shadow: 0 0 20px var(--primary); }
.cyber-subtitle { font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 5px; margin-top: 20px; color: var(--primary); }

.cybr-btn {
    --primary: #00f3ff;
    --shadow-primary: #008cff;
    color: #fff; text-transform: uppercase; font-family: var(--font-mono); font-size: 1.2rem; letter-spacing: 2px;
    background: transparent; border: 1px solid var(--primary); padding: 20px 50px; cursor: pointer;
    position: relative; margin-top: 50px; clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}
.cybr-btn:hover { background: rgba(0,243,255,0.1); box-shadow: 0 0 30px var(--shadow-primary); }

/* === ROBOT HUD === */
.hud-grid { display: flex; width: 100%; height: 100%; padding: 100px 50px; max-width: 1600px; margin: 0 auto; align-items: center; }
.hud-col { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }

.hologram-box {
    text-align: left; padding: 40px; background: linear-gradient(90deg, rgba(0,243,255,0.05) 0%, transparent 100%);
    border-left: 2px solid var(--primary); width: 100%;
}
.mono-label { font-family: var(--font-mono); color: var(--primary); margin-bottom: 10px; display: block; }
.hologram-box h2 { font-size: 4rem; line-height: 1; margin-bottom: 20px; font-family: var(--font-head); color: #fff; }
.gradient-text { background: linear-gradient(to right, #fff, var(--primary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hologram-box p { font-size: 1.1rem; color: #aaa; max-width: 90%; margin-bottom: 30px; line-height: 1.6; }

.data-row { display: flex; gap: 40px; margin-bottom: 30px; }
.data-block { display: flex; flex-direction: column; }
.data-block .val { font-family: var(--font-head); font-size: 2.5rem; color: #fff; }
.data-block .lbl { font-family: var(--font-mono); color: var(--secondary); font-size: 0.9rem; }

.neon-btn {
    padding: 15px 40px; background: var(--primary); color: #000; border: none; font-weight: bold;
    font-family: var(--font-head); font-size: 1.1rem; clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%, 0 25%);
    transition: 0.3s; cursor: pointer;
}
.neon-btn:hover { background: #fff; box-shadow: 0 0 25px var(--primary); }

/* === GLASS TERMINAL (FIXED LAYOUT) === */
.glass-terminal {
    background: rgba(10, 15, 25, 0.85); backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    position: relative; 
    display: flex; flex-direction: column;
}

/* تعديل الارتفاع ليكون ديناميكي */
.large { 
    width: 90%; max-width: 1200px; 
    min-height: 50vh; /* ارتفاع أدنى */
    max-height: 80vh; /* أقصى ارتفاع لتجنب الاختفاء */
}
.medium { width: 100%; max-width: 600px; }

.terminal-header {
    background: rgba(0,0,0,0.5); padding: 15px 20px; display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}
.dots { display: flex; gap: 8px; margin-right: 20px; }
.dots span { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ff5f56; } .yellow { background: #ffbd2e; } .green { background: #27c93f; }
.title { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.9rem; }

.terminal-body { 
    padding: 40px; 
    overflow-y: auto; /* يسمح بسكرول النص داخل المربع */
    flex-grow: 1;
}
/* تخصيص السكرول بار داخل التيرمينال */
.terminal-body::-webkit-scrollbar { width: 5px; }
.terminal-body::-webkit-scrollbar-thumb { background: rgba(0,243,255,0.3); }

.split-body { display: flex; gap: 50px; flex-wrap: wrap; }
.info-side { flex: 2; min-width: 300px; } 
.stats-side { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 20px; }

.cyber-heading { font-family: var(--font-head); font-size: 2.5rem; margin-bottom: 20px; color: #fff; }
.justified { text-align: justify; margin-bottom: 15px; color: #ccc; line-height: 1.7; font-size: 1.05rem; }
.tech-list { list-style: none; margin-top: 20px; }
.tech-list li { margin-bottom: 10px; font-family: var(--font-mono); color: var(--primary); font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }

.stat-card {
    background: rgba(255,255,255,0.03); padding: 25px; text-align: center; border: 1px solid rgba(255,255,255,0.05);
    transition: 0.3s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-5px); background: rgba(0,243,255,0.05); }
.stat-card i { font-size: 2rem; color: var(--primary); margin-bottom: 10px; }
.stat-card h2 { font-size: 2.5rem; margin: 5px 0; font-family: var(--font-head); color: #fff; }

/* === SERVICES HEX GRID === */
.services-wrapper { text-align: center; width: 100%; max-width: 1400px; }
.section-title { font-family: var(--font-head); font-size: 3rem; margin-bottom: 40px; color: #fff; }

.hex-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }
.cyber-card {
    width: 300px; min-height: 350px; position: relative; background: rgba(5, 10, 20, 0.6);
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    transition: 0.4s; cursor: pointer; border: 1px solid transparent;
}
.card-border {
    position: absolute; inset: 0; clip-path: inherit; border: 1px solid rgba(0,243,255,0.2); z-index: 1; pointer-events: none;
}
.card-content {
    position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px;
}
.icon-glow { font-size: 3rem; color: var(--primary); margin-bottom: 20px; transition: 0.3s; }
.cyber-card h3 { font-family: var(--font-head); margin-bottom: 15px; font-size: 1.5rem; color: #fff; }
.cyber-card p { font-size: 0.95rem; color: #aaa; margin-bottom: 25px; line-height: 1.5; }
.tiny-btn {
    background: transparent; border: 1px solid var(--primary); color: var(--primary); padding: 8px 25px;
    font-family: var(--font-mono); font-size: 0.8rem; transition: 0.3s; cursor: pointer;
}

.cyber-card:hover { transform: translateY(-10px); background: rgba(0,243,255,0.05); border-color: var(--primary); }
.cyber-card:hover .icon-glow { text-shadow: 0 0 20px var(--primary); transform: scale(1.1); }
.cyber-card:hover .tiny-btn { background: var(--primary); color: #000; }

/* === CONTACT FORM === */
.cyber-form { display: flex; flex-direction: column; gap: 20px; }
.input-group label { font-family: var(--font-mono); color: var(--primary); font-size: 0.8rem; display: block; margin-bottom: 5px; }
.input-group input, .input-group textarea {
    width: 100%; background: transparent; border: none; color: #fff; font-family: var(--font-body); font-size: 1.1rem;
    padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.2);
}
.input-group input:focus, .input-group textarea:focus { border-bottom-color: var(--primary); }
.input-line { width: 0; height: 1px; background: var(--primary); transition: 0.5s; }
.input-group input:focus + .input-line { width: 100%; }

/* === COMMS LINK === */
.comms-link {
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px;
    background: rgba(11, 21, 33, 0.9); border: 1px solid var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary); font-size: 28px; text-decoration: none; z-index: 999;
    box-shadow: 0 0 20px rgba(0,243,255,0.1); transition: 0.3s;
}
.comms-link:hover { background: var(--primary); color: #000; box-shadow: 0 0 30px var(--primary); transform: scale(1.1); }

/* =========================================================================
   7. MOBILE & RESPONSIVE DESIGN (THE FIXES)
   ========================================================================= */
@media (max-width: 1024px) {
    .hud-grid { flex-direction: column-reverse; padding: 100px 20px; text-align: center; }
    .hud-col { width: 100%; margin-bottom: 30px; }
    .hologram-box { border: none; padding: 20px; background: rgba(0,0,0,0.4); border-top: 1px solid var(--primary); border-bottom: 1px solid var(--primary); text-align: center; }
    .hologram-box p { margin: 0 auto 30px auto; }
    .data-row { justify-content: center; }
    .large { height: auto; max-height: none; margin-bottom: 50px; }
}

@media (max-width: 768px) {
    /* Navbar Adjustment: Bottom Dock Style (More usable than sidebar on mobile) */
    .cyber-nav {
        top: auto; bottom: 0; left: 0;
        width: 100%; height: 65px;
        background: rgba(2, 5, 10, 0.95);
        border-top: 1px solid var(--primary);
        padding: 0 10px;
        justify-content: space-around; /* توزيع الأزرار */
        box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
    }

    .brand { display: none; } /* إخفاء اللوجو في النافبار لتوفير مساحة */
    
    .nav-modules { width: 100%; justify-content: space-around; gap: 0; }
    
    .nav-btn {
        flex-direction: column; padding: 5px; border: none; 
        font-size: 0.7rem; gap: 4px; clip-path: none;
    }
    .nav-btn .icon { font-size: 1.2rem; margin-bottom: 2px; }
    .nav-btn .txt { font-size: 0.65rem; display: block; } /* إظهار النص بحجم صغير */
    
    .nav-btn.active { background: transparent; border: none; color: var(--primary); }
    .nav-btn:hover { background: transparent; }

    /* Screen Adjustments */
    .system-border, .corner-bracket { display: none; } /* إخفاء الحدود للوضوح */
    
    .screen {
        padding: 40px 15px 100px 15px; /* مساحة سفلية للنافبار */
        justify-content: flex-start; /* البدء من الأعلى */
    }

    /* Typography */
    .mega-title { font-size: 12vw; margin-top: -50px; }
    .cyber-subtitle { font-size: 0.9rem; letter-spacing: 2px; }
    .section-title { font-size: 2rem; }
    
    /* Layouts */
    .glass-terminal.large { width: 100%; margin-top: 20px; }
    .split-body { flex-direction: column; gap: 30px; }
    .tech-list li { font-size: 1rem; }
    
    .hex-grid { gap: 20px; }
    .cyber-card { width: 100%; max-width: 350px; height: auto; min-height: 250px; }
    
    /* Adjust Home Video */
    .intro-content { top: 45%; }
    .cybr-btn { padding: 15px 30px; font-size: 1rem; }

    /* Whatsapp Button Move */
    .comms-link { bottom: 80px; right: 20px; width: 50px; height: 50px; font-size: 24px; }
}
/* =========================================
   GLITCH BUTTON (INITIALIZE SYSTEM)
   ========================================= */
.cybr-btn {
    --primary: #00f3ff;
    --shadow-primary: #008cff;
    color: #fff;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    letter-spacing: 2px;
    background: transparent;
    border: 1px solid var(--primary);
    padding: 20px 50px;
    cursor: pointer;
    position: relative;
    margin-top: 50px;
    /* شكل الزرار المقصوص */
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: 0.2s;
}

.cybr-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 30px var(--shadow-primary); 
}

/* الطبقة المخفية اللي بتظهر وقت الهوفر */
.cybr-btn__glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark); /* نفس لون خلفية الموقع */
    filter: drop-shadow(-2px 3px #67e3f3) drop-shadow(-1px -3px #02d8f3) drop-shadow(2px 1px #02d8f3);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
}

/* تشغيل الأنيميشن عند الهوفر */
.cybr-btn:hover .cybr-btn__glitch {
    opacity: 1;
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

/* حركة التشويش */
@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}
/* =========================================================================
   MOBILE HOME & ROBOT FIXES (PORTRAIT MODE)
   ========================================================================= */
@media (max-width: 768px) {

    /* 1. ضبط شاشة الهوم عشان تاخد ارتفاع الموبايل بالظبط */
    #home.screen {
        padding: 0 !important;
        overflow: hidden !important;
        height: 100dvh; /* Dynamic Viewport Height: بيظبط مع شريط العنوان في الموبايل */
        width: 100%;
        display: block; /* عشان الطبقات تركب فوق بعض */
    }

    /* 2. ضبط طبقة الفيديو الافتتاحية */
    #videoLayer {
        position: absolute; inset: 0; width: 100%; height: 100%; z-index: 20;
    }
    
    .bg-video {
        width: 100%; height: 100%;
        object-fit: cover; /* يملأ الشاشة */
        object-position: center;
    }

    /* توسيط الكلام والزرار على الفيديو */
    .intro-content {
        width: 90%;
        top: 50%; 
        transform: translate(-50%, -50%);
    }

    .mega-title {
        font-size: 10vw; /* تصغير الخط عشان مايطلعش برا */
        margin-bottom: 10px;
    }

    .cyber-subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
        margin-bottom: 40px;
    }

    /* زرار Glitch يكون أصغر شوية */
    .cybr-btn {
        padding: 15px 30px;
        font-size: 1rem;
        margin-top: 20px;
        width: 100%; /* الزرار بعرض الشاشة */
        max-width: 300px;
    }

    /* 3. ضبط طبقة الروبوت (لما تعمل Skip) */
    #robotLayer {
        height: 100dvh;
        overflow-y: auto; /* لو المحتوى طويل نعمل سكرول */
        padding-bottom: 80px; /* مساحة عشان النافبار اللي تحت */
    }

    /* ترتيب العناصر فوق بعض (الروبوت الأول وبعدين الكلام) */
    .hud-grid {
        flex-direction: column;
        padding: 60px 20px 20px 20px;
        gap: 20px;
        height: auto;
        min-height: 100%;
        justify-content: flex-start;
    }

    /* عمود الروبوت */
    .robot-col {
        order: 1; /* الروبوت يظهر الأول */
        width: 100%;
        height: 35vh; /* ياخد ثلث الشاشة تقريباً */
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }

    /* الكانفاس بتاع الروبوت */
    #robotCanvas {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain;
        max-height: 300px;
    }
    
    .robot-circle-bg {
        width: 280px; height: 280px; /* تصغير الدايرة الخلفية */
    }

    /* عمود النص (المعلومات) */
    .text-col {
        order: 2; /* النص يظهر تحت الروبوت */
        width: 100%;
        height: auto;
        text-align: center;
    }

    /* بوكس المعلومات */
    .hologram-box {
        background: rgba(0, 5, 10, 0.6); /* خلفية أغمق شوية للقراءة */
        padding: 20px;
        border: 1px solid var(--primary);
        border-left: 1px solid var(--primary); /* نرجع الحدود كاملة */
        box-shadow: 0 0 20px rgba(0,0,0,0.5);
    }

    .hologram-box h2 {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }

    .hologram-box p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .data-row {
        justify-content: space-around;
        gap: 10px;
    }
    
    .data-block .val { font-size: 1.8rem; }
}
/* =========================================
   SOUND TOGGLE BUTTON
   ========================================= */
.sound-toggle-btn {
    position: absolute;
    bottom: 40px; /* المسافة من تحت */
    right: 40px;  /* المسافة من اليمين */
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

/* الدايرة المحيطة */
.btn-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px dashed var(--primary);
    border-radius: 50%;
    animation: spin-slow 10s linear infinite;
}

.sound-toggle-btn i {
    font-size: 1.5rem;
    color: var(--primary); /* لون السيان */
    z-index: 2;
    transition: 0.3s;
}

.sound-toggle-btn:hover {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary);
}

.sound-toggle-btn:hover i {
    color: #000;
}

/* في الموبايل نرفع الزرار شوية عشان مايغطيش عليه حاجة */
@media (max-width: 768px) {
    .sound-toggle-btn {
        bottom: 120px; /* رفعناه فوق شوية عشان النافبار والزرار الكبير */
        right: 20px;
        width: 50px;
        height: 50px;
    }
    .sound-toggle-btn i { font-size: 1.2rem; }
}

@keyframes spin-slow { 
    100% { transform: rotate(360deg); } 
}
/* =========================================
   SOUND TOGGLE BUTTON (FIXED POSITION)
   ========================================= */
.sound-toggle-btn {
    position: absolute;
    /* مكان الزرار في اللاب توب (أسفل يسار) */
    bottom: 40px; 
    left: 40px;   /* نقلناه شمال بدل يمين */
    right: auto;  /* الغاء اليمين */
    
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    backdrop-filter: blur(5px);
}

/* في الموبايل */
@media (max-width: 768px) {
    .sound-toggle-btn {
        /* نرفعه فوق شوية عشان مايخبطش في القائمة السفلية */
        bottom: 90px; 
        left: 20px; /* يفضل شمال زي ما هو */
        
        width: 50px;
        height: 50px;
    }
    .sound-toggle-btn i { font-size: 1.2rem; }
}

/* باقي الستايل زي ما هو */
.btn-ring {
    position: absolute; width: 100%; height: 100%;
    border: 1px dashed var(--primary); border-radius: 50%;
    animation: spin-slow 10s linear infinite;
}
.sound-toggle-btn i { font-size: 1.5rem; color: var(--primary); z-index: 2; }
.sound-toggle-btn:hover { background: var(--primary); box-shadow: 0 0 20px var(--primary); }
.sound-toggle-btn:hover i { color: #000; }
@keyframes spin-slow { 100% { transform: rotate(360deg); } }
/* =========================================================================
   MOBILE FIXES (FINAL TEXT FIX)
   ========================================================================= */
@media (max-width: 768px) {

    /* 1. ضبط الكونتينر الرئيسي للكلام */
    .intro-content {
        width: 100%;
        top: 45%; /* رفعناه فوق المنتصف قليلاً */
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 0 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 20;
    }

    /* 2. ضبط الحاوية الخاصة بالعناوين عشان ترصهم تحت بعض */
    .glitch-wrapper {
        display: flex;
        flex-direction: column; /* ترتيب عمودي */
        align-items: center;
        justify-content: center;
        width: 100%;
        gap: 15px; /* مسافة صريحة بين الكلمة الأولى والتانية */
    }

    /* 3. تنسيق العنوان الكبير (WE / INTELLIGENCE) */
    .mega-title {
        font-size: 11vw; /* تصغير الخط قليلاً ليتناسب مع العرض */
        line-height: 1.2; /* زيادة ارتفاع السطر لمنع التداخل */
        margin: 0; 
        padding: 0;
        display: block;
        width: 100%;
        text-align: center;
        white-space: nowrap; /* يمنع الكلمة تنزل على سطرين */
    }

    /* تعديل خاص للكلمة التانية (الشفافة) */
    .mega-title.cyan {
        margin-top: 5px; /* مسافة إضافية للأمان */
    }

    /* 4. العنوان الفرعي */
    .cyber-subtitle {
        font-size: 3.5vw; /* حجم نسبي للعرض */
        letter-spacing: 1px;
        margin-top: 25px; /* مسافة كبيرة تفصله عن العنوان */
        margin-bottom: 30px;
        color: var(--secondary); /* اللون الذهبي */
        text-align: center;
        line-height: 1.4;
    }

    /* 5. الزرار */
    .cybr-btn {
        margin-top: 10px;
        padding: 15px 0;
        width: 90%; /* عرض الزرار */
        font-size: 1rem;
    }

    /* 6. مكان زرار الصوت (شمال تحت) */
    .sound-toggle-btn {
        bottom: 85px; /* فوق النافبار */
        left: 20px;
        width: 50px;
        height: 50px;
    }

    /* 7. مكان زرار الواتساب (يمين تحت) */
    .comms-link {
        bottom: 85px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}
/* =========================================
   IMPROVED CONTACT FORM & TERMINAL
   ========================================= */
.glass-terminal {
    background: rgba(5, 10, 15, 0.9); /* خلفية أغمق لزيادة التباين */
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* يمنع خروج المحتوى بره الإطار */
}

/* تنسيق المقاسات */
.large { width: 90%; max-width: 1200px; height: 75vh; }
.medium { 
    width: 100%; 
    max-width: 650px; /* عرض مناسب للفورم */
    max-height: 85vh; /* عشان ماتطولش زيادة عن الشاشة */
}

.terminal-header {
    background: rgba(0, 243, 255, 0.05);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    flex-shrink: 0; /* يمنع الهيدر من الانكماش */
}

.terminal-body {
    padding: 40px;
    overflow-y: auto; /* السكرول يكون جوه الجسم بس */
    flex-grow: 1;
}

/* تنسيق الحقول (Inputs) */
.cyber-form { display: flex; flex-direction: column; gap: 25px; }

.input-group { position: relative; }

.input-group label {
    font-family: var(--font-mono);
    color: var(--primary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
    letter-spacing: 1px;
}

.input-group input, .input-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03); /* لون خلفية خفيف للحقل */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 15px;
    transition: 0.3s;
    border-radius: 4px;
}

.input-group input:focus, .input-group textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 243, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.input-line { display: none; } /* شلنا الخط القديم واستبدلناه بالبوردر */

/* تنسيق زرار الإرسال داخل الفورم */
.cyber-form .cybr-btn {
    margin-top: 20px;
    width: 100%; /* بعرض الفورم */
    font-size: 1rem;
    padding: 15px;
}
/* =========================================================================
   MOBILE FIXES (NO CLIPPING + BETTER CONTRAST)
   ========================================================================= */
@media (max-width: 768px) {

    /* 1. ضبط الحاوية */
    .intro-content {
        width: 100%;
        max-width: 100%; /* تأكيد عدم الخروج عن الشاشة */
        top: 45%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 0 10px; /* تقليل الهوامش الجانبية */
        overflow: hidden; /* أمان إضافي */
    }

    .glitch-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    /* 2. تصغير الخط لمنع القص */
    .mega-title {
        font-size: 9vw; /* كان 11vw، دلوقتي 9vw عشان يسيع الكلمة */
        line-height: 1.1;
        margin: 0;
        text-align: center;
        width: 100%;
        display: block;
    }

    .mega-title.cyan {
        margin-top: 5px;
        /* خاصية مهمة جداً: لو الكلمة لسه كبيرة، صغر المسافات بين الحروف */
        letter-spacing: 1px; 
    }

    /* 3. تحسين قراءة النص الأصفر (خلفية شفافة) */
    .cyber-subtitle {
        font-size: 3.5vw;
        letter-spacing: 1px;
        margin-top: 20px;
        color: var(--secondary);
        
        /* إضافة خلفية عشان الكلام يبان فوق الروبوت */
        background: rgba(0, 0, 0, 0.7);
        padding: 5px 10px;
        border-radius: 4px;
        backdrop-filter: blur(4px);
    }

    /* 4. تعديل الفورم في الموبايل */
    .glass-terminal.medium {
        height: auto;
        max-height: 75vh;
        margin-top: 20px;
    }
    .terminal-body { padding: 20px; }

    /* الأزرار العائمة */
    .sound-toggle-btn { bottom: 85px; left: 15px; }
    .comms-link { bottom: 85px; right: 15px; }
}
/* =========================================
   LOGO IMAGE STYLING
   ========================================= */
.brand {
    display: flex;
    align-items: center;
    height: 100%; /* عشان يتوسط طولياً */
}

.brand-logo {
    max-height: 80px; /* أقصى ارتفاع عشان مايكبرش النافبار */
    width: auto;      /* العرض يتظبط تلقائي حسب النسبة */
    object-fit: contain; /* يحافظ على أبعاد اللوجو */
    
    /* لمسة جمالية: ظل خفيف بلون السيان عشان يندمج مع التصميم */
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.3));
    transition: 0.3s;
}

.brand-logo:hover {
    /* لما تقف عليه ينور زيادة */
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.8));
    transform: scale(1.05); /* تكبير بسيط */
}

/* في الموبايل */
@media (max-width: 768px) {
    /* لو حابب تخفي اللوجو في الموبايل عشان المساحة (زي ما كنا عاملين) */
    .brand { display: none; }
    
    /* لكن.. لو حابب تظهره في الموبايل فوق، استخدم الكود ده بدل اللي فوق: */
    /*
    .brand { display: block; position: absolute; top: 20px; left: 20px; }
    .brand-logo { max-height: 40px; }
    */
}
/* =========================================
   3D FLIP SERVICES CARDS
   ========================================= */
.services-wrapper { text-align: center; width: 100%; max-width: 1400px; perspective: 1000px; }
.hex-grid { display: flex; justify-content: center; gap: 30px; flex-wrap: wrap; }

.cyber-card {
    width: 300px; height: 380px;
    background: transparent; /* الخلفية اتشالت من هنا */
    cursor: pointer;
    perspective: 1000px; /* عشان الـ 3D يبان */
}

.card-inner {
    position: relative;
    width: 100%; height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* حركة ناعمة */
    transform-style: preserve-3d;
}

/* الكلاس اللي بيقلب الكارت */
.cyber-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    -webkit-backface-visibility: hidden; /* يخفي الظهر لما يتقلب */
    backface-visibility: hidden;
    background: rgba(5, 10, 20, 0.9); /* لون الكارت */
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    border: 1px solid rgba(0,243,255,0.1);
}

/* تنسيق الظهر (Back) */
.card-back {
    transform: rotateY(180deg); /* ملفوف 180 درجة عشان يظهر لما نقلب */
    background: rgba(0, 10, 20, 0.95);
    border: 1px solid var(--primary);
    box-shadow: 0 0 20px rgba(0,243,255,0.1);
}

/* تنسيق المحتوى */
.card-content {
    position: absolute; inset: 0; z-index: 2;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 25px;
}

.card-border {
    position: absolute; inset: 2px; clip-path: inherit;
    border: 1px solid rgba(0,243,255,0.2); z-index: 1; pointer-events: none;
}

/* القائمة في ظهر الكارت */
.service-list {
    list-style: none; text-align: left; width: 100%; margin-bottom: 30px;
}
.service-list li {
    font-family: var(--font-mono); color: #ccc; font-size: 1rem;
    padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.service-list li span { color: var(--primary); margin-right: 10px; font-weight: bold; }

/* الأزرار */
.tiny-btn {
    background: transparent; border: 1px solid var(--primary);
    color: var(--primary); padding: 8px 25px; font-family: var(--font-mono);
    transition: 0.3s; margin-top: auto;
}
.tiny-btn.glow { background: rgba(0,243,255,0.1); box-shadow: 0 0 10px var(--primary); color: #fff; }

.icon-glow { font-size: 3rem; color: var(--primary); margin-bottom: 20px; text-shadow: 0 0 10px var(--primary); }
.cyber-card h3 { font-family: var(--font-head); margin-bottom: 10px; font-size: 1.5rem; color: #fff; }
.cyber-card p { font-size: 0.9rem; color: #aaa; line-height: 1.5; }
.tech-list {
    list-style: none;
    margin-top: 20px;
    /* التعديل الجديد: تقسيم القائمة لعمودين */
    display: grid;
    grid-template-columns: 1fr 1fr; 
    gap: 10px 20px; /* مسافة بين العناصر */
}

/* في الموبايل نرجعها عمود واحد عشان الشاشة صغيرة */
@media (max-width: 768px) {
    .tech-list {
        grid-template-columns: 1fr;
    }
}
/* =========================================
   ABOUT SECTION FLIP & TEAM STYLES
   ========================================= */

/* إعدادات القلب للترمينال */
.flip-container { perspective: 1500px; }
.terminal-inner {
    position: relative; width: 100%; height: 100%;
    text-align: left; transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

/* الكلاس اللي الجافاسكربت بيضيفه عشان يقلب */
.glass-terminal.flipped .terminal-inner { transform: rotateY(180deg); }

/* تنسيق الوجه والظهر */
.terminal-front, .terminal-back {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    -webkit-backface-visibility: hidden; backface-visibility: hidden;
    background: rgba(10, 15, 25, 0.95); /* خلفية معتمة شوية عشان الكلام يوضح */
    display: flex; flex-direction: column;
    border-radius: inherit;
}

/* الظهر (التيم) ملفوف 180 درجة */
.terminal-back { transform: rotateY(180deg); }

/* سكرول للتيم لو العدد كبير */
.team-body { overflow-y: auto; padding: 20px 30px; }

/* عناوين الأقسام (Executives / Engineering) */
.team-section-title {
    color: var(--primary); font-family: var(--font-mono);
    margin: 20px 0 15px; border-bottom: 1px solid rgba(0,243,255,0.2);
    padding-bottom: 5px; font-size: 0.9rem;
}

/* شبكة التيم */
.team-grid {
    display: flex; gap: 20px; flex-wrap: wrap; justify-content: center;
}
.leaders { margin-bottom: 30px; } /* مسافة بعد المديرين */

/* كارت الموظف */
.member-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 15px; width: 200px; text-align: center;
    text-decoration: none; transition: 0.3s;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
}
.member-card:hover {
    border-color: var(--primary); background: rgba(0,243,255,0.05);
    transform: translateY(-5px);
}

/* تمييز كارت أحمد صابر (Lead) */

.member-card img {
    width: 80px; height: 80px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--primary);
    margin-bottom: 10px;
}
.member-card h3 {
    color: #fff; font-family: var(--font-head); font-size: 1rem; margin-bottom: 5px;
}
.member-card .role {
    color: var(--primary); font-family: var(--font-mono); font-size: 0.75rem;
    display: block; margin-bottom: 5px; font-weight: bold;
}
.member-card .bio {
    color: #888; font-size: 0.7rem; line-height: 1.2;
}

/* في الموبايل */
@media (max-width: 768px) {
    .member-card { width: 45%; } /* كارتين جنب بعض في الموبايل */
    .team-grid { gap: 10px; }
}
/* تمييز كارت الـ Team Lead (هادي وشيك) */
.member-card.highlight {
    /* بوردر أفتح سنة بسيطة من الباقيين */
    border-color: rgba(255, 215, 0, 0.07); 
    
    /* خلفية متدرجة خفيفة جداً تكاد لا تظهر */
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.05), transparent);
}



/* عند الهوفر، التوهج يكون ناعم */
.member-card.highlight:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}
/* =========================================
   4. FIXED HUD CURSOR (NO LAG - TARGET STYLE)
   ========================================= */
@media (pointer: fine) {
    
    /* 1. المركز: علامة + دقيقة */
    .cursor-main {
        position: fixed;
        width: 20px; height: 20px;
        transform: translate(-50%, -50%);
        pointer-events: none;
        z-index: 9999;
        /* رسم علامة + */
        background: 
            linear-gradient(to right, var(--primary) 2px, transparent 2px) center/2px 100% no-repeat,
            linear-gradient(to bottom, var(--primary) 2px, transparent 2px) center/100% 2px no-repeat;
    }

    /* 2. الإطار: زوايا القناص */
    .cursor-follower {
        position: fixed;
        width: 40px; height: 40px;
        border: 1px solid rgba(0, 243, 255, 0.5);
        transform: translate(-50%, -50%);
        pointer-events: none;
        z-index: 9998;
        /* قص الزوايا */
        clip-path: polygon(
            0 0, 30% 0, 30% 10%, 10% 10%, 10% 90%, 30% 90%, 30% 100%, 0 100%,
            100% 100%, 70% 100%, 70% 90%, 90% 90%, 90% 10%, 70% 10%, 70% 0, 100% 0
        );
        transition: width 0.2s, height 0.2s, border-color 0.2s; 
    }

    /* === حالة الهوفر (HOVER) === */
    body.hovering .cursor-main {
        opacity: 0; /* المركز يختفي */
    }

    body.hovering .cursor-follower {
        width: 60px; height: 60px; /* يكبر */
        border-color: var(--secondary); /* يقلب ذهبي */
        background: rgba(255, 215, 0, 0.05);
        border-width: 2px;
    }
}
/* =========================================
   FIX BUTTONS TEXT SIZE ON MOBILE
   ========================================= */
@media (max-width: 768px) {
    
    /* تصغير زراير الهيدر (Our Team & Back to Info) */
    .terminal-header .tiny-btn {
        font-size: 0.65rem !important; /* تصغير الخط */
        padding: 5px 10px !important;  /* تقليل الحواشي */
        white-space: nowrap;           /* منع النص ينزل سطرين */
        line-height: 1;                /* ضبط الارتفاع */
        min-width: auto;               /* إلغاء أي عرض أدنى */
        display: flex;
        align-items: center;
        gap: 5px;
    }

    /* تصغير الأيقونة اللي جوه الزرار كمان */
    .terminal-header .tiny-btn i {
        font-size: 0.8rem !important;
    }
}
/* =========================================
   FIX TEAM SCROLLBAR (SLIDER)
   ========================================= */

/* 1. ضبط الحاوية الخلفية عشان السكرول يشتغل صح */
.terminal-back {
    display: flex;
    flex-direction: column;
    /* الكود ده بيجبر كارت الشاشة يعالج الصفحة فبيمنع التعليق */
    transform: rotateY(180deg) translateZ(1px) !important; 
}

/* 2. منطقة الأسماء (اللي فيها السكرول) */
.team-body {
    flex-grow: 1;      /* تاخد باقي المساحة المتاحة */
    height: 0;         /* خدعة CSS عشان تحسب الطول صح */
    min-height: 0;
    overflow-y: auto;  /* تشغيل السكرول العمودي */
    overflow-x: hidden;
    padding: 20px;
    
    /* نعومة في السكرول */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* عشان الموبايل يبقى ناعم */
}

/* 3. تصميم السكرول بار (الشريط الجانبي) */
/* العرض */
.team-body::-webkit-scrollbar {
    width: 8px; /* عرض واضح */
}

/* الخلفية (المسار) */
.team-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.6); 
    border-left: 1px solid rgba(0, 243, 255, 0.1);
}

/* الزرار نفسه (اللي بيتحرك) */
.team-body::-webkit-scrollbar-thumb {
    background: var(--primary); /* لون السيان المضيء */
    border-radius: 4px;
    box-shadow: 0 0 5px var(--primary); /* توهج */
    border: 2px solid #000; /* عشان يبان مقسم */
}

/* لما تقف عليه */
.team-body::-webkit-scrollbar-thumb:hover {
    background: #fff;
}
/* =========================================
   ARABIC & RTL SUPPORT (ADD TO END OF CSS)
   ========================================= */

/* 1. Arabic Font Import (Already added in HTML Link) */
/* Cairo Font Setup for RTL */
[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

[dir="rtl"] .mega-title,
[dir="rtl"] .section-title,
[dir="rtl"] .cyber-heading,
[dir="rtl"] .hologram-box h2,
[dir="rtl"] .cybr-btn, 
[dir="rtl"] .neon-btn,
[dir="rtl"] .nav-btn,
[dir="rtl"] h3 {
    font-family: 'Cairo', sans-serif;
    letter-spacing: 0; /* Arabic connects letters, remove spacing */
    font-weight: 800;
}

[dir="rtl"] .cyber-subtitle,
[dir="rtl"] p,
[dir="rtl"] li {
    letter-spacing: 0;
    line-height: 1.8;
}

/* 2. Layout Mirroring for RTL */

/* Flip Navigation */
[dir="rtl"] .nav-modules {
    flex-direction: row-reverse;
}
[dir="rtl"] .brand {
    flex-direction: row-reverse;
}

/* Flip Corner Brackets */
[dir="rtl"] .top-left { 
    right: 20px; left: auto; 
    border-right: 2px solid var(--primary); border-left: none; 
}
[dir="rtl"] .top-right { 
    left: 20px; right: auto; 
    border-left: 2px solid var(--primary); border-right: none; 
}
[dir="rtl"] .bottom-left { 
    right: 20px; left: auto; 
    border-right: 2px solid var(--primary); border-left: none; 
}
[dir="rtl"] .bottom-right { 
    left: 20px; right: auto; 
    border-left: 2px solid var(--primary); border-right: none; 
}

/* Flip Hologram Box Border */
[dir="rtl"] .hologram-box {
    border-left: none;
    border-right: 2px solid var(--primary);
    text-align: right;
    background: linear-gradient(to left, rgba(0,243,255,0.05) 0%, transparent 100%);
}

/* Flip Lists */
[dir="rtl"] .tech-list li,
[dir="rtl"] .service-list li {
    flex-direction: row;
}
[dir="rtl"] .service-list {
    text-align: right;
}
[dir="rtl"] .service-list li span {
    margin-right: 0;
    margin-left: 10px;
    transform: rotate(180deg); /* Flip arrow icon */
    display: inline-block;
}

/* Flip Terminal & Forms */
[dir="rtl"] .terminal-header {
    flex-direction: row-reverse;
}
[dir="rtl"] .terminal-body {
    text-align: right;
}
[dir="rtl"] .dots {
    margin-right: 0; margin-left: 20px;
}
[dir="rtl"] .justified {
    text-align: right;
}

/* Glitch Effect Alignment */
[dir="rtl"] .glitch-wrapper {
    align-items: center; /* Keep centered in Home */
}

/* Contact Form Input Line */
[dir="rtl"] .input-group input:focus + .input-line {
    right: 0; left: auto;
}

/* Mobile Fixes for Arabic */
@media (max-width: 768px) {
    [dir="rtl"] .nav-modules {
        flex-direction: row; /* Keep nav logical on mobile */
    }
    [dir="rtl"] .hud-grid {
        text-align: center;
    }
    [dir="rtl"] .hologram-box {
        text-align: center;
        border-right: 1px solid var(--primary);
        border-left: 1px solid var(--primary);
    }
}
/* =========================================
   تعديل الناف بار للغة العربية (إضافة للنهاية)
   ========================================= */
@media (min-width: 769px) {
    /* يجعل اللوجو يمين والقائمة يسار (الوضع الطبيعي للعربي) */
    [dir="rtl"] .cyber-nav {
        flex-direction: row; 
    }

    /* يعكس ترتيب الأزرار نفسها لتكون: الرئيسية (يمين) -> تواصل (يسار) */
    [dir="rtl"] .nav-modules {
        flex-direction: row; 
    }
}