/* =========================================
   MOSTEFAI WEB STUDIO - 2026 ULTIMATE THEME
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Kufi+Arabic:wght@300;400;600;800&display=swap');

:root {
    /* --- إعدادات الوضع النهاري (Modern Light Mesh) --- */
    --bg-color: #F8FAFC;  /* لون أساسي فاتح */
    /* سر الخلفية العصرية: تدرج شبكي ناعم جداً يدمج الأزرق والوردي */
    --bg-image: radial-gradient(at 20% 30%, rgba(37, 99, 235, 0.06) 0%, transparent 50%),
                radial-gradient(at 80% 80%, rgba(244, 114, 182, 0.06) 0%, transparent 50%),
                linear-gradient(to bottom, #F8FAFC, #F1F5F9);

    --surface-color: rgba(255, 255, 255, 0.8); /* كروت شبه شفافة */
    --surface-border: rgba(255, 255, 255, 0.4); /* حدود زجاجية */
    --surface-hover: #FFFFFF;
    
    /* ظل ناعم فخم للوضع النهاري */
    --card-shadow: 0 12px 34px -10px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.02);
    
    --text-main: #0F172A; /* كحلي غامق جداً */
    --text-muted: #64748B;
    --border-light: #E2E8F0;

    --primary: #2563EB; /* أزرق */
    --accent: #EC4899;  /* وردي */
    
    --radius-lg: 24px;
    --container-width: 1200px;
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- إعدادات الوضع الليلي (Tech Dark Beam) --- */
[data-theme="dark"] {
    --bg-color: #050505; /* أسود عميق */
    --bg-image: none;    /* إلغاء خلفية النهار */
    
    --surface-color: #121212;
    --surface-border: #27272A;
    --surface-hover: #1E1E1E;
    
    --card-shadow: none; /* لا نحتاج لظل في الليل */
    
    --text-main: #FFFFFF;
    --text-muted: #A1A1AA;
    --border-light: #27272A;
}

* {
    margin: 0; padding: 0; box-sizing: border-box; outline: none;
    /* تنعيم التحويل بين الوضعين */
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: 'Noto Kufi Arabic', 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-color);
    /* تطبيق الخلفية العصرية في النهار */
    background-image: var(--bg-image);
    background-attachment: fixed; /* تثبيت الخلفية أثناء التمرير */
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

/* --- Header --- */
.main-header {
    position: fixed; top: 20px; left: 0; right: 0; z-index: 1000; padding: 0 20px;
}
.header-inner {
    max-width: var(--container-width); margin: 0 auto;
    background: var(--surface-color);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); /* تأثير الزجاج */
    border: 1px solid var(--surface-border);
    border-radius: 100px; padding: 12px 30px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--card-shadow);
}
[data-theme="dark"] .header-inner { background: rgba(18, 18, 18, 0.8); border-color: rgba(255, 255, 255, 0.08); }
.logo a { font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; color: var(--text-main); }
.logo img { height: 32px; }
.navbar ul { display: flex; gap: 32px; align-items: center; }
.nav-link { font-size: 0.95rem; font-weight: 500; color: var(--text-muted); position: relative; }
.nav-link:hover { color: var(--text-main); }
.theme-toggle { cursor: pointer; font-size: 1.2rem; padding: 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border-light); color: var(--text-main); transition: 0.3s; }
.theme-toggle:hover { background: var(--surface-hover); }
.cta-btn a { background: var(--primary); color: #fff; padding: 10px 24px; border-radius: 100px; font-weight: 600; box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3); }
.cta-btn a:hover { transform: scale(1.05); }

/* =========================================
   ✨ HERO SECTION - The Magic Happens Here
   ========================================= */
.hero {
    padding-top: 200px; padding-bottom: 140px;
    text-align: center; position: relative;
    overflow: hidden; /* مهم جداً لقص الشعاع */
    z-index: 1;
}

/* 🔥 تأثير الشعاع الأزرق (Blue Beam Glow) - يظهر فقط في الوضع الليلي 🔥 */
[data-theme="dark"] .hero::before {
    content: '';
    position: absolute;
    top: -150px;    /* يبدأ من فوق الشاشة */
    left: 50%;
    transform: translateX(-50%); /* توسيط */
    width: 800px;   /* عرض الشعاع */
    height: 600px;  /* ارتفاع الشعاع */
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.25) 0%, rgba(0, 0, 0, 0) 60%);
    filter: blur(100px); /* ضبابية عالية جداً لخلق التوهج النيون */
    z-index: -1; /* خلف النص */
    pointer-events: none;
    opacity: 0; /* مخفي افتراضياً */
    animation: glowFadeIn 1s ease-out forwards 0.5s; /* حركة ظهور ناعمة */
}

@keyframes glowFadeIn { to { opacity: 1; } }

/* تنسيقات نصوص الهيرو */
.hero h1 {
    font-size: clamp(2.8rem, 6vw, 5rem);
    font-weight: 900; margin-bottom: 24px;
    line-height: 1.1; letter-spacing: -1px;
    color: var(--text-main);
}

/* تأثير تدرج لوني للنص في الوضع الليلي فقط */
[data-theme="dark"] .hero h1 {
    background: linear-gradient(to bottom right, #FFFFFF 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p { font-size: 1.25rem; color: var(--text-muted); max-width: 650px; margin: 0 auto 40px; }
.hero-btns { display: flex; gap: 16px; justify-content: center; }
.btn-primary { background: var(--text-main); color: var(--bg-color); padding: 16px 32px; border-radius: 12px; font-weight: 700; transition: 0.3s; display: flex; align-items: center; gap: 8px; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 10px 20px -10px rgba(0,0,0,0.3); }
.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border-light); padding: 16px 32px; border-radius: 12px; font-weight: 600; backdrop-filter: blur(10px); }
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--text-main); }

/* --- Bento Grid Cards --- */
.services-preview { padding: 100px 0; position: relative; z-index: 2; }
.section-title { font-size: 2.5rem; font-weight: 700; text-align: center; margin-bottom: 60px; color: var(--text-main); }
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.bento-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg); padding: 32px;
    transition: 0.4s var(--ease-spring);
    /* تطبيق الظل الفخم في النهار فقط */
    box-shadow: var(--card-shadow); 
}
.bento-card:hover { background: var(--surface-hover); transform: translateY(-5px); border-color: var(--primary); }
[data-theme="dark"] .bento-card { box-shadow: none; background: #121212; border-color: #27272A; }
[data-theme="dark"] .bento-card:hover { background: #1E1E1E; border-color: #3B82F6; }

.card-large { grid-column: span 2; }
/* تمييز الكارت الكبير في الوضع النهاري */
body:not([data-theme="dark"]) .card-large { background: linear-gradient(135deg, #F8FAFC, #EFF6FF); }

.icon-box { font-size: 2rem; margin-bottom: 20px; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: rgba(128, 128, 128, 0.08); }
.bento-card h3 { font-size: 1.4rem; margin-bottom: 10px; color: var(--text-main); font-weight: 700; }
.bento-card p { color: var(--text-muted); font-weight: 500; }

/* --- Footer --- */
.main-footer { border-top: 1px solid var(--border-light); padding: 80px 0 30px; margin-top: 80px; background: var(--surface-color); }
[data-theme="dark"] .main-footer { background: #0A0A0A; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; margin-bottom: 60px; }
.footer-links h4 { color: var(--text-main); margin-bottom: 20px; font-weight: 700; }
.footer-links a { color: var(--text-muted); font-weight: 500; }
.footer-links a:hover { color: var(--primary); }
.copyright { text-align: center; border-top: 1px solid var(--border-light); padding-top: 30px; color: var(--text-muted); }

/* --- Mobile --- */
@media (max-width: 768px) {
    .main-header { top: 0; padding: 0; }
    .header-inner { border-radius: 0; border: none; border-bottom: 1px solid var(--border-light); background: var(--bg-color) !important; box-shadow: none; }
    .navbar { position: fixed; top: 70px; left: 0; width: 100%; height: 100vh; background: var(--bg-color); flex-direction: column; padding: 40px 20px; display: none; border-top: 1px solid var(--border-light); }
    .navbar.active { display: flex; }
    .hero { padding-top: 150px; }
    .hero h1 { font-size: 3rem; }
    [data-theme="dark"] .hero::before { width: 100%; height: 400px; top: -100px; filter: blur(80px); }
    .bento-grid { grid-template-columns: 1fr; }
    .card-large { grid-column: span 1; }
    .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 40px; }
}

/* =========================================
   تنسيق زر الهامبورغر (Mobile Menu Toggle)
   ========================================= */
/* إخفاء الزر في الشاشات الكبيرة */
.hamburger {
    display: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    /* إظهار الزر في الموبايل */
    .hamburger {
        display: block;
        z-index: 1001; /* فوق كل شيء */
        margin-left: 20px; /* مسافة بينه وبين زر الثيم */
    }

    /* شكل الأشرطة */
    .bar {
        display: block;
        width: 25px;
        height: 2px; /* سمك الخط */
        margin: 6px auto;
        -webkit-transition: all 0.3s ease-in-out;
        transition: all 0.3s ease-in-out;
        background-color: var(--text-main); /* يأخذ لون النص حسب الوضع (أبيض/أسود) */
        border-radius: 2px;
    }

    /* --- حركة التحول إلى X عند الفتح --- */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0; /* إخفاء الخط الأوسط */
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg); /* دوران الخط الأول */
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg); /* دوران الخط الثالث */
    }
}

/* =========================================
   MODERN TIMELINE & SERVICES 2.0
   ========================================= */

/* --- 1. التايم لاين الجديد (Journey Style) --- */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    direction: ltr; /* للحفاظ على الهيكلية */
    padding: 20px 0;
}

/* الخط المتدرج */
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent)); /* تدرج لوني */
    top: 0; bottom: 0; left: 50%; margin-left: -1px;
    z-index: 0;
    box-shadow: 0 0 15px var(--primary-glow);
}

.timeline-item {
    padding: 20px 50px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

/* بطاقات المراحل (Glassmorphism) */
.timeline-content {
    direction: rtl; text-align: right;
    padding: 30px;
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden; /* للأرقام الخلفية */
    transition: 0.4s var(--ease-spring);
}

.timeline-content:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 10px 40px var(--primary-glow);
}

/* الرقم الكبير في الخلفية (Watermark Number) */
.step-number {
    position: absolute;
    top: -10px; left: -10px;
    font-size: 6rem;
    font-weight: 900;
    color: var(--text-muted);
    opacity: 0.05; /* شفاف جداً */
    line-height: 1;
    z-index: 0;
}

/* النصوص */
.timeline-content h3 { position: relative; z-index: 1; color: var(--text-main); margin-bottom: 10px; }
.timeline-content p { position: relative; z-index: 1; color: var(--text-muted); margin: 0; }

/* النقطة المضيئة في الوسط */
.timeline-icon {
    position: absolute; top: 30px;
    width: 20px; height: 20px;
    background: var(--bg-color);
    border: 4px solid var(--primary);
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* ضبط الأماكن */
.timeline-item:nth-child(odd) { left: 50%; }
.timeline-item:nth-child(even) { left: 0; }
.timeline-item:nth-child(odd) .timeline-icon { left: -10px; }
.timeline-item:nth-child(even) .timeline-icon { right: -10px; }

/* السهم */
.timeline-content::before {
    content: " "; position: absolute; top: 34px; width: 0; height: 0; z-index: 1;
    border-style: solid;
}
.timeline-item:nth-child(odd) .timeline-content::before {
    left: -10px; border-width: 10px 10px 10px 0; border-color: transparent var(--surface-color) transparent transparent;
}
.timeline-item:nth-child(even) .timeline-content::before {
    right: -10px; border-width: 10px 0 10px 10px; border-color: transparent transparent transparent var(--surface-color);
}

/* الموبايل */
@media (max-width: 768px) {
    .timeline::after { left: 30px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 20px; left: 0 !important; }
    .timeline-icon { left: 20px !important; right: auto !important; }
    .timeline-content::before { display: none; } /* إخفاء السهم في الموبايل */
}

/* =========================================
   1. إصلاح قائمة الموبايل (Hamburger Menu)
   ========================================= */
@media (max-width: 900px) {
    .navbar {
        position: fixed;
        top: 0;
        right: -100%; /* مخفية خارج الشاشة */
        width: 280px; /* عرض القائمة */
        height: 100vh; /* طول كامل الشاشة */
        background: var(--surface-color); /* لون الخلفية حسب الثيم */
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        padding: 80px 20px 20px 20px;
        transition: 0.4s ease;
        z-index: 1000;
        display: flex;
        flex-direction: column; /* جعل العناصر عمودية */
        align-items: center; /* توسيط العناصر */
    }

    .navbar.active {
        right: 0; /* إظهار القائمة */
    }

    .navbar ul {
        display: flex;
        flex-direction: column; /* ترتيب الروابط عمودياً */
        gap: 25px; /* مسافة بين الروابط */
        width: 100%;
        text-align: center;
        padding: 0;
    }

    .navbar ul li {
        width: 100%;
    }

    /* زر الإغلاق X (اختياري، الهمبرغر يتحول عادة) */
    .hamburger { z-index: 1001; }
}

/* =========================================
   2. تخصيص بطاقة SEO في الوضع الليلي
   ========================================= */
/* الوضع العادي (Light) */
.seo-special-card {
    background: var(--surface-color);
    transition: 0.3s;
}

/* الوضع الليلي (Dark) - تعديل خاص حسب طلبك */
[data-theme="dark"] .seo-special-card {
    background-color: #333333 !important; /* خلفية رمادية واضحة وليست سوداء */
    border: 1px solid #444;
}

[data-theme="dark"] .seo-special-card h3,
[data-theme="dark"] .seo-special-card p,
[data-theme="dark"] .seo-special-card .icon-box {
    color: #ffffff !important; /* كتابة بيضاء ناصعة */
}

/* لون الأيقونة يبقى مميزاً */
[data-theme="dark"] .seo-special-card .icon-box {
    background: rgba(255, 255, 255, 0.1);
}


    @media (max-width: 768px) {
        .footer-grid { grid-template-columns: 1fr !important; text-align: center; }
        .footer-col ul { align-items: center; }
        div[style*="justify-content: space-between"] { flex-direction: column; text-align: center; }
    }
    
    /* تصغير اسم الشعار في الهيدر */
.logo span {
    font-size: 1.1rem !important; /* كان 1.2rem أو أكبر سابقاً */
    font-weight: 700; /* سمك الخط */
    letter-spacing: -0.5px; /* تقليل المسافة بين الحروف قليلاً */
}

/* في الموبايل، نصغره أكثر قليلاً لتجنب الزحام */
@media (max-width: 480px) {
    .logo span {
        font-size: 0.95rem !important;
    }
    .logo img {
        height: 30px !important; /* تصغير الأيقونة أيضاً لتتناسب معه */
    }
}

/* =========================================
   تحديث: التحكم في أيقونات الوضع الليلي
   ========================================= */

/* الوضع الافتراضي (النهاري): الشمس مخفية، القمر ظاهر */
.icon-sun { display: none; }
.icon-moon { display: block; }

/* الوضع الليلي: اعكس الآية (أظهر الشمس واخفِ القمر) */
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* تحسين شكل الزر */
.theme-toggle {
    cursor: pointer;
    border: none;
    background: transparent;
    font-size: 1.4rem;
    color: var(--text-main);
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}
