:root {
    --primary: #00ADEF; /* Logo Sky Blue */
    --secondary: #0072BC; /* Logo Royal Blue */
    --deep-navy: #0B1F3A; /* Dark Corporate Blue */
    --silver: #E2E8F0;
    --accent: #00ADEF; /* تعريف اللون المفقود لضمان ظهور خلفية قسم الاتصال */
    --bg-main: #FFFFFF;
    --bg-card: #FFFFFF;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --gradient: linear-gradient(135deg, #00ADEF 0%, #0072BC 100%);
    --gradient-dark: linear-gradient(135deg, #0B1F3A 0%, #0072BC 100%);
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --text-dark: #F8FAFC;
    --text-muted: #94A3B8;
}

body {
    font-family: 'Inter', 'Cairo', sans-serif;
    background-color: var(--bg-main);
    color: #1E293B; /* نصوص أكثر نعومة ووضوحاً */
    transition: var(--transition);
    overflow-x: hidden;
    line-height: 1.8; /* زيادة المسافة بين الأسطر لمنع التداخل */
    -webkit-font-smoothing: antialiased;
}

.text-accent { color: var(--accent); }

.btn-primary { background-color: var(--secondary); border-color: var(--secondary); }

/* Modern Performance Optimization: Content Visibility */
#products, #why-us, #gallery, #about {
    content-visibility: visible;
    contain-intrinsic-size: 1px 500px;
}

/* Grain Texture Overlay */
body::before {
    content: "";
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04; pointer-events: none; z-index: 9999;
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0; left: 0; width: 0%; height: 4px;
    background: var(--primary);
    z-index: 9999;
}

/* Glass Nav */
.glass-nav {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    transition: var(--transition);
}

.nav-scrolled { padding: 8px 0; box-shadow: var(--shadow); }

.navbar-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.05));
    transition: var(--transition);
    transform: translateZ(0); /* تحفيز كرت الشاشة لتحسين جودة العرض */
}

.navbar-nav .nav-link {
    padding-left: 25px !important; /* زيادة التباعد الأفقي بين الروابط */
    padding-right: 25px !important;
    font-weight: 600;
}

/* تحسين استجابة القائمة على الشاشات المتوسطة لتجنب التداخل */
@media (max-width: 1199.98px) {
    .navbar-logo {
        height: 70px !important;
    }
    .navbar-nav .nav-link {
        padding-left: 12px !important;
        padding-right: 12px !important;
        font-size: 0.95rem;
    }
}

@media (max-width: 991.98px) {
    .navbar-logo {
        height: 60px !important;
    }
    /* القائمة تتقلص تلقائياً هنا في Bootstrap إلى زر القائمة */
}

.nav-scrolled .navbar-logo {
    height: 65px !important;
}

[data-theme="dark"] .glass-nav {
    background: rgba(15, 23, 42, 0.8);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    padding-top: 100px;
    position: relative;
}

.hero-bg-shapes .shape {
    position: absolute;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.15;
}

.s1 { top: -10%; left: -5%; width: 40%; height: 50%; background: var(--primary); border-radius: 50%; }
.s2 { bottom: 10%; right: -5%; width: 30%; height: 40%; background: var(--secondary); border-radius: 50%; }

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    display: inline-block;
    padding-bottom: 5px;
}

.hero-title { 
    line-height: 1.2 !important; /* تم تعديلها من 0.95 لمنع التداخل */
    letter-spacing: -1px; 
}

/* Bento Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 24px;
}

.feature-tag {
    background: #F1F5F9;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 16px;
    transition: var(--transition);
}

.feature-tag:hover { background: white; transform: scale(1.02); }

.glass-card {
    background: var(--bg-card);
    border-radius: 32px;
    border: 1px solid rgba(0, 173, 239, 0.1);
    box-shadow: var(--shadow);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-dark);
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 114, 188, 0.2);
    border-color: var(--primary);
}

.icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: var(--transition);
}

.icon-circle-sm {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 50px; left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.mouse {
    width: 25px; height: 45px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute; top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 8px;
    background: var(--primary);
    border-radius: 2px;
    animation: scrollWheel 2s infinite;
}

/* Grayscale effect for logos in footer */
.grayscale { filter: grayscale(1) brightness(2); opacity: 0.6; transition: var(--transition); }
.grayscale:hover { filter: none; opacity: 1; }

/* Main Hero Image Effect */
.main-hero-img {
    box-shadow: 0 50px 100px -20px rgba(50, 50, 93, 0.25), 0 30px 60px -30px rgba(0, 0, 0, 0.3);
    border: 8px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(15px); }
}

.product-card {
    border-radius: 32px;
    background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.03);
    transition: var(--transition);
}

.product-card:hover {
    background: var(--primary) !important;
    color: white !important;
}

.product-card:hover p { color: rgba(255,255,255,0.8) !important; }

.product-card i { transition: var(--transition); }
.product-card:hover i { transform: scale(1.2); color: white; }

.icon-wrap {
    width: 60px; height: 60px;
    background: #EEF7FA;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--primary);
}

/* Floating Elements */
.hero-image-wrapper { position: relative; }
.rounded-custom { border-radius: 40px; }
.floating-glass {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 20px;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.c1 { top: 10%; left: -30px; animation: float 6s ease-in-out infinite; }
.c2 { bottom: 15%; right: -20px; animation: float 6s ease-in-out infinite reverse; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Contact & Footer */
.btn-gradient {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    transition: var(--transition);
}

.btn-gradient:hover {
    filter: brightness(1.1);
    color: white;
    transform: scale(1.05);
}

.footer {
    background: var(--deep-navy); /* تغيير اللون للأزرق الداكن ليتناسب مع فخامة الموقع */
    color: white;
    border-top: 4px solid var(--primary); /* إضافة خط جمالي بلون اللوجو */
    position: relative;
}

.social-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    color: white; text-decoration: none;
    transition: var(--transition);
}

.social-icon:hover { background: var(--primary); }

.whatsapp-float {
    position: fixed; bottom: 30px; left: 30px;
    width: 60px; height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    transition: var(--transition);
    animation: whatsapp-pulse 2s infinite;
    text-decoration: none;
}

.whatsapp-float:hover {
    background: #128C7E;
    color: white;
    transform: scale(1.1) translateY(-5px);
}

@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 50px; height: 50px;
    border-radius: 50%; background: var(--bg-card);
    border: 1px solid rgba(0,0,0,0.1); display: none;
    z-index: 1000;
}

/* Forms */
.form-control:focus {
    box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.15);
    background-color: white !important;
}

/* RTL Adjustments */
[dir="rtl"] .me-lg-3 { margin-left: 1rem !important; margin-right: 0 !important; }
[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* Typography Helpers */
.fw-black { font-weight: 900; }
.py-100 { padding: 120px 0; } /* زيادة التباعد بين الأقسام */

/* Timeline Styling */
.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 25px;
    border-left: 2px solid var(--primary);
}

[dir="rtl"] .timeline-item {
    padding-left: 0; padding-right: 30px;
    border-left: none; border-right: 2px solid var(--primary);
}

.timeline-item .dot {
    position: absolute; top: 5px; left: -9px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--primary);
}

[dir="rtl"] .timeline-item .dot { left: auto; right: -9px; }

/* Feature tags */
.feature-tag {
    padding: 12px 20px;
    background: rgba(0, 159, 227, 0.05);
    border-radius: 12px;
    font-weight: 600;
    color: var(--text-dark);
}