/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    /* ألوان التصميم الفاتح (Light Mode) */
    --bg-page: #ffffff;
    --bg-secondary: #f9fafb;  /* رمادي فاتح جداً */
    --bg-tertiary: #f3f4f6;   /* رمادي للتفريق */
    
    --primary: #2563eb;       /* أزرق أساسي */
    --primary-soft: #eff6ff;
    --primary-strong: #1e40af;
    
    --text-main: #1f2937;     /* رمادي غامق للنصوص */
    --text-header: #111827;   /* أسود تقريباً للعناوين */
    --text-muted: #4b5563;    /* رمادي متوسط للوصف */
    
    --border-subtle: #e5e7eb;
    --container-width: 1200px;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0; overflow-x: hidden;
}

body {
    min-height: 100vh;
    font-family: "Inter", system-ui, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-size: 16px;
    line-height: 1.6;
}

/* كلاس لمنع السكرول عند فتح القائمة */
body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
}

a { color: inherit; text-decoration: none; transition: 0.2s; }
img { max-width: 100%; display: block; }

.container {
    width: 100%; max-width: var(--container-width);
    margin: 0 auto; padding: 0 1.5rem;
}

@keyframes fade-up {
    0% { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* =========================================
   2. PRELOADER
   ========================================= */
body.loading-active { overflow: hidden !important; height: 100vh; }

#preloader {
    position: fixed; inset: 0; background-color: #ffffff; z-index: 9999999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.4s ease 0.2s, visibility 0.4s ease 0.2s;
}

body.loaded #preloader { opacity: 0; visibility: hidden; }

.loader-wrapper {
    display: flex; justify-content: center; align-items: center;
    transition: transform 0.5s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.5s ease;
}

body.loaded .loader-wrapper { transform: scale(25); opacity: 0; }

.tech-loader {
    display: block; position: relative; width: 110px; height: 110px;
    border-radius: 50%; border: 4px solid transparent; border-top-color: var(--primary); 
    animation: spin 1.5s linear infinite; 
}
.tech-loader:before {
    content: ""; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px;
    border-radius: 50%; border: 4px solid transparent; border-top-color: var(--text-header); 
    animation: spin 2s linear infinite; 
}
.tech-loader:after {
    content: ""; position: absolute; top: 26px; left: 26px; right: 26px; bottom: 26px;
    border-radius: 50%; border: 4px solid transparent; border-top-color: var(--primary); 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* =========================================
   3. NAVBAR
   ========================================= */
.navbar {
    position: sticky; top: 0; z-index: 40;
    backdrop-filter: blur(18px); background: rgba(255,255,255,0.95);
    border-bottom: 1px solid rgba(229,231,235,0.8); width: 100%;
}
.navbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 0.8rem; padding-bottom: 0.8rem;
}
.logo-img { height: 22px; width: auto; display: block; }

.nav-links { display: flex; align-items: center; gap: 2rem; font-size: 0.95rem; font-weight: 600; }
.nav-links a { position: relative; color: var(--text-muted); }
.nav-links a::after {
    content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
    border-radius: 999px; background: var(--primary); transition: width 0.18s ease;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 1rem; }

/* Buttons */
.btn {
    border-radius: 999px; padding: 0.6rem 1.5rem; border: 1px solid transparent;
    font-size: 0.9rem; font-weight: 700; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    transition: all 0.2s ease; background: transparent; white-space: nowrap;
}

.btn-outline {
    border-color: var(--border-subtle); background: #ffffff; color: var(--text-main);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #f8fafc; }

/* Animated Gradient Button */
#btnStartNow {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 0.8rem 2rem; border-radius: 50px; border: none; outline: none; cursor: pointer;
    font-family: inherit; font-size: 1rem; font-weight: 800; letter-spacing: 0.5px;
    color: #ffffff; background: transparent; z-index: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35); text-decoration: none;
}
#btnStartNow::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit;
    background: linear-gradient(115deg, #2563eb, #3b82f6, #60a5fa, #2563eb);
    background-size: 300% 300%; animation: btnBorderShift 8s linear infinite; z-index: -2;
}
#btnStartNow::after {
    content: ""; position: absolute; inset: 2px; border-radius: inherit;
    background: linear-gradient(135deg, #1e40af, #2563eb); z-index: -1;
    transition: background 0.25s ease;
}
#btnStartNow:hover { transform: translateY(-2px); box-shadow: 0 15px 40px rgba(37, 99, 235, 0.45); }
#btnStartNow.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; filter: grayscale(100%); }

@keyframes btnBorderShift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }

/* Language Dropdown */
.lang-dropdown-wrap { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 8px;
    background: #f1f5f9; padding: 6px 14px 6px 10px; border-radius: 99px;
    font-weight: 700; font-size: 0.85rem; color: var(--text-main); cursor: pointer; border: none;
}
.lang-menu {
    position: absolute; top: 140%; right: 0;
    background: #fff; border: 1px solid var(--border-subtle);
    border-radius: 12px; box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    width: 160px; padding: 6px; opacity: 0; visibility: hidden; 
    transform: translateY(10px); transition: 0.25s ease; z-index: 50;
}
.lang-dropdown-wrap:hover .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-muted);
}
.lang-opt:hover { background: #f8fafc; color: var(--primary); }

/* =========================================
   4. MOBILE MENU
   ========================================= */
.hamburger-btn { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--text-main); }

.mobile-sidebar {
    z-index: 10000;
    position: fixed; top: 0; bottom: 0; left: -280px; /* Start Hidden */
    width: 280px;
    background: #fff;
    transition: left 0.3s ease;
    display: flex; flex-direction: column; padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 5px 0 20px rgba(0,0,0,0.1);
}
.mobile-menu-open .mobile-sidebar { left: 0; }

.mobile-menu-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    z-index: 9999; display: none; opacity: 0;
    transition: opacity 0.3s ease; backdrop-filter: blur(2px);
}
.mobile-menu-overlay.active { display: block; opacity: 1; }

.sidebar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 1rem; }
.close-btn { background: none; border: none; font-size: 1.8rem; cursor: pointer; color: var(--text-muted); }

.sidebar-links a { display: block; padding: 0.8rem 0; font-size: 1.1rem; font-weight: 600; color: var(--text-main); border-bottom: 1px dashed var(--border-subtle); }

.mob-lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1.5rem; }
.mob-lang { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 8px; font-weight: 600; font-size: 0.9rem; }
.mob-lang.active { border-color: var(--text-main); background: var(--text-main); color: #fff; }

@media (max-width: 992px) {
    .nav-links, .nav-actions { display: none; }
    .hamburger-btn { display: block; }
}

/* =========================================
   5. HERO SECTION (DARK with VIDEO)
   ========================================= */
.hero { position: relative; height: 700px; overflow: hidden; display: flex; align-items: center; justify-content: center; margin-top: 0; }

.hero-bg-video { position: absolute; inset: 0; overflow: hidden; z-index: -2; }
.hero-video { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.3); }
.hero-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); z-index: -1; }

.hero-content {
    position: relative; z-index: 10; text-align: center; color: #fff; max-width: 800px; padding: 0 1.5rem;
    animation: fade-up 0.8s ease-out both;
}

.hero-pill {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 1rem;
    border-radius: 999px; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.3);
    color: #fff; font-size: 0.9rem; font-weight: 700; margin-bottom: 1.5rem; backdrop-filter: blur(5px);
}
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900; line-height: 1.1; margin: 0 0 1.2rem; }
.hero-sub { font-size: 1.2rem; color: #cbd5e1; margin: 0 auto 2rem; max-width: 650px; }
.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

.btn-hero-glass {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 0.85rem 2.2rem; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.3); color: #fff;
    font-weight: 700; font-size: 1rem;
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px);
    transition: transform 0.2s ease, background 0.2s ease;
}
.btn-hero-glass:hover { transform: translateY(-3px); background: rgba(255,255,255,0.2); border-color: #ffffff; }

/* =========================================
   6. FEATURES SECTION (LIGHT MODE + FORCED COLORS)
   ========================================= */
.features-sec { 
    padding: 5rem 0; 
    background: var(--bg-page) !important;
    color: var(--text-main) !important;
}

.sec-head { text-align: center; margin-bottom: 3rem; }

/* استخدام !important لإلغاء أي تأثير قديم يسبب الشطب */
.sec-title { 
    font-size: 2.2rem; 
    font-weight: 800; 
    margin: 0 0 0.5rem; 
    color: var(--text-header) !important;
}

.sec-desc { 
    color: var(--text-muted) !important; 
    font-size: 1.1rem; 
}

.f-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 2rem; 
}

.f-card {
    padding: 2rem; 
    border-radius: 20px; 
    background: var(--bg-secondary) !important; 
    border: 1px solid var(--border-subtle); 
    transition: transform 0.2s;
}

.f-card:hover { 
    transform: translateY(-5px); 
    background: #ffffff !important; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.08); 
}

.f-icon { 
    width: 50px; height: 50px; 
    background: rgba(37, 99, 235, 0.1); 
    color: var(--primary); 
    border-radius: 12px; 
    display: grid; place-items: center; 
    font-size: 1.4rem; margin-bottom: 1rem; 
}

.f-card h3 { 
    margin: 0 0 0.5rem; 
    font-size: 1.2rem; 
    font-weight: 700; 
    color: var(--text-header) !important; 
}

.f-card p { 
    margin: 0; 
    color: var(--text-muted) !important; 
}

/* =========================================
   7. THEMES SECTION (LIGHT MODE)
   ========================================= */
.themes-sec { 
    padding: 5rem 0; 
    background: var(--bg-tertiary); /* خلفية رمادية للفصل */
    color: var(--text-main); 
}

.theme-grid { 
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2.5rem; margin-top: 3rem; 
}

.theme-card {
    background: #ffffff;
    border-radius: 16px; 
    overflow: hidden; 
    border: 1px solid var(--border-subtle); 
    transition: 0.3s; 
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.theme-card:hover { 
    border-color: var(--primary); 
    transform: translateY(-5px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.1); 
}

.theme-card.selected { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2); 
}

/* Check Icon */
.theme-check-icon {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px; height: 80px;
    background: #16a34a; /* Green */
    color: #ffffff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 900;
    opacity: 0; transition: 0.25s ease;
    pointer-events: none; z-index: 5;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.theme-card.selected .theme-check-icon { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.theme-thumb { 
    height: 350px; background: var(--border-subtle); 
    position: relative; overflow: hidden; 
}
.theme-thumb img { 
    width: 100%; height: 100%; object-fit: cover; object-position: top; 
    transition: 1.5s; opacity: 1; 
}
.theme-card:hover .theme-thumb img { object-position: bottom; }

.theme-info { padding: 1.5rem; text-align: center; }

.theme-title { 
    font-size: 1.2rem; font-weight: 700; margin: 0 0 1rem; 
    color: var(--text-header) !important;
}

.theme-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

/* Theme Buttons */
.theme-btn {
    padding: 0.6rem 0.5rem;
    border-radius: 50px;
    border: 2px solid var(--primary);
    background: var(--primary);
    color: #ffffff;
    font-weight: 700; font-size: 0.85rem; width: 100%;
    cursor: pointer; transition: 0.2s ease;
}
.theme-btn:hover { background: #ffffff; color: var(--primary); border-color: var(--primary); }
.theme-card.selected .theme-btn { background: var(--primary-strong); color: #ffffff; border-color: var(--primary-strong); }

/* Create Green Button Special Class */
.theme-btn.theme-create-red {
    background: #16a34a !important; color: #fff !important; border: none !important;
}
.theme-btn.theme-create-red:hover { background: #15803d !important; transform: translateY(-2px); }

/* Preview Button */
.theme-preview-btn {
    padding: 0.6rem 0.5rem; border-radius: 50px; 
    border: 1px solid var(--border-subtle);
    color: var(--text-muted); font-weight: 600; font-size: 0.85rem; 
    background: transparent; transition: 0.2s; 
    width: 100%; text-decoration: none; 
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.theme-preview-btn:hover { background: var(--bg-secondary); border-color: #9ca3af; color: #000; }

/* CTA Button */
.theme-cta-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 1rem 2.8rem; border-radius: 14px;
    font-size: 1.15rem; font-weight: 700;
    text-decoration: none; cursor: pointer;
    background: #ffffff; color: var(--primary-strong);
    border: 1px solid var(--border-subtle);
    transition: all 0.28s; box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.theme-cta-btn:hover {
    background: var(--primary); color: #ffffff; border-color: var(--primary);
    transform: translateY(-3px); box-shadow: 0 12px 25px rgba(37, 99, 235, 0.25);
}
.theme-cta-btn.disabled { background: var(--bg-tertiary); color: #9ca3af; border-color: var(--border-subtle); cursor: not-allowed; box-shadow: none; }


/* =========================================
   LOAD MORE BUTTON (LIGHT MODE STYLE)
   ========================================= */
.theme-load-more-btn {
    padding: 12px 45px;          /* زر عريض قليلاً */
    background: transparent;     /* خلفية شفافة */
    border: 2px solid var(--primary); /* حدود زرقاء */
    color: var(--primary);       /* ✅ النص أزرق ليظهر بوضوح */
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

/* عند تمرير الماوس */
.theme-load-more-btn:hover {
    background: var(--primary);  /* تعبئة زرقاء */
    color: #ffffff;              /* النص يصبح أبيض */
    transform: translateY(-3px); /* حركة خفيفة للأعلى */
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2); /* ظل ناعم */
}



/* =========================================
   CTA SECTION (MODERN CORPORATE - CLEARER BG)
   ========================================= */
.cta-section {
    position: relative;
    /* زدنا المساحة العلوية والسفلية ليعطي فخامة */
    padding: 9rem 0;
    text-align: center;
    overflow: hidden;
    
    /* --- إعدادات الصورة --- */
    /* الصورة الآن ستكون أوضح */
    background-image: url('https://images.unsplash.com/photo-1519500528352-2d1460418d41?q=80&w=1170&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
    background-size: cover;
    background-position: center;
    /* تأثير التمرير الثابت (اختياري، يمكن حذفه إذا سبب مشاكل في الموبايل) */
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* الطبقة الشفافة (أصبحت أخف وزناً) */
.cta-section::before {
    content: "";
    position: absolute;
    inset: 0;
    
    /* تدرج أزرق داكن لكن بشفافية أقل ليكشف الصورة */
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.80) 0%,   /* شفافية 80% بدل 95% */
        rgba(30, 58, 138, 0.65) 100% /* شفافية 65% بدل 85% */
    );
    
    /* تغبيش خفيف جداً فقط لتنعيم التفاصيل الحادة في الصورة */
    backdrop-filter: blur(1px);
    z-index: 1;
}

.relative-z {
    position: relative;
    z-index: 2;
}

/* العنوان الرئيسي (أنيق وبارز) */
.cta-title {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    margin-bottom: 1.5rem;
    /* سمك خط أنيق (ليس ضخماً جداً) */
    font-weight: 800; 
    color: #ffffff !important;
    letter-spacing: -0.02em;
    line-height: 1.15;
    /* ظل ناعم للنص لضمان قراءته فوق الأجزاء الفاتحة من الصورة */
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* الوصف (واضح ونقي) */
.cta-desc {
    /* لون أبيض نقي */
    color: #f1f5f9 !important;
    margin-bottom: 4rem; /* مسافة أكبر قبل الزر */
    font-size: 1.3rem;   /* حجم أكبر قليلاً */
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
    line-height: 1.7;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* الزر الجديد كلياً (Modern Gradient Pill) */
.cta-main-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 3.8rem !important; /* زر عريض */
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    /* شكل كبسولة دائري بالكامل */
    border-radius: 999px !important;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none !important;
    
    /* تدرج لوني أزرق حديث */
    background: linear-gradient(to right, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    
    /* ظل ملون (Glow) يعطي عمقاً */
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5) !important;
}

/* تأثير الهوفر على الزر */
.cta-main-btn:hover {
    /* يرتفع للأعلى */
    transform: translateY(-4px) scale(1.02);
    /* تدرج أغمق قليلاً */
    background: linear-gradient(to right, #1d4ed8, #1e40af) !important;
    /* زيادة التوهج */
    box-shadow: 0 20px 35px -10px rgba(37, 99, 235, 0.7) !important;
}

/* =========================================
   8. FOOTER
   ========================================= */
.footer { 
    border-top: 1px solid var(--border-subtle); 
    padding: 2rem 0; 
    background: #ffffff; 
    margin-top: auto; 
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-links a { 
    margin-left: 1.5rem; font-size: 0.9rem; font-weight: 600; 
    color: var(--text-muted); text-decoration: none; 
}
.footer-links a:hover { color: var(--primary); }
.agent-link { color: var(--primary) !important; font-weight: 700 !important; }

@media (max-width: 600px) {
    .footer-inner { flex-direction: column; text-align: center; }
    .footer-links a { margin: 0 0.8rem; }
}