/* landing.css - الصفحة الترحيبية (النسخة النهائية المصححة بالكامل) */
/* =============================================== */

/* ============ CSS Variables - ألوان محسنة ============ */
:root {
    /* Light Mode Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary: #8b5cf6;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --card-bg: #ffffff;
    --glow-blue: rgba(37, 99, 235, 0.3);
    --glow-purple: rgba(139, 92, 246, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hero: 0 25px 50px -12px rgba(37, 99, 235, 0.25);
}

/* ============ Dark Mode - ألوان أذكى مع طبقات واضحة ============ */
body.dark-mode {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #a78bfa;
    --bg-primary: #0b1120;      /* ✅ أعمق للتباين */
    --bg-secondary: #111827;     /* ✅ طبقة ثانية واضحة */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: #1f2a3e;
    --border-strong: #2d3a4e;
    --card-bg: #172033;          /* ✅ بين bg-primary و bg-secondary */
    --glow-blue: rgba(59, 130, 246, 0.2);
    --glow-purple: rgba(167, 139, 250, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25), 0 2px 6px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 32px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-hero: 0 25px 50px -12px rgba(59, 130, 246, 0.3);
}

/* ============ Base Styles ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.8;           /* ✅ line-height محسن */
    letter-spacing: -0.01em;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ تطبيق الألوان مع طبقات واضحة ============ */
.main-header {
    background-color: transparent;
    transition: all 0.3s ease;
}

.hero-section,
.features-section,
.howitworks-section,
.ai-showcase-section,
.subjects-section,
.testimonials-section,
.faq-section,
.final-cta-section,
.main-footer {
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

/* طبقات متناوبة لإعطاء عمق */
.features-section,
.testimonials-section,
.final-cta-section,
.main-footer {
    background-color: var(--bg-secondary);
}

/* ============ Custom Cursor ============ */
.custom-cursor {
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.2s, width 0.2s, height 0.2s, background-color 0.2s;
    transform: translate(-50%, -50%);
    display: none;
}

@media (min-width: 1024px) {
    .custom-cursor {
        display: block;
    }
}

.custom-cursor.hover {
    width: 32px;
    height: 32px;
    background-color: rgba(37, 99, 235, 0.15);
    backdrop-filter: blur(4px);
}

/* ============ Typography محسن ============ */
.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.section-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ============ Header - تصحيح كامل ============ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 0;
}

body.dark-mode .main-header.scrolled {
    background: rgba(11, 17, 32, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--primary);
}

.main-nav {
    display: flex;
    gap: 32px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
    font-size: 0.95rem;
}

.main-nav a:hover {
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ✅ زر دخول محسن - أقوى بصرياً */
.btn-login {
    padding: 8px 20px;
    background-color: transparent;
    border: 1.5px solid var(--border-strong);
    border-radius: 40px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

body.dark-mode .btn-login {
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-login:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 0 12px var(--glow-blue);
}

.btn-register {
    padding: 8px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 40px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--glow-blue);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
}

.theme-toggle:hover {
    border-color: var(--primary);
    transform: rotate(15deg);
}




/* ============ تحسينات الـ Header للهواتف ============ */

/* للشاشات المتوسطة */
@media (max-width: 992px) {
    .main-nav {
        gap: 20px;
    }
    
    .main-nav a {
        font-size: 0.85rem;
    }
    
    .btn-login span,
    .btn-register span {
        display: inline;
    }
}

/* للشاشات الصغيرة (هواتف) */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 12px;
    }
    
    /* ✅ إخفاء الـ navigation على الموبايل وإضافة زر هامبرغر (اختياري) */
    .main-nav {
        display: none;
    }
    
    /* ✅ أو بدلاً من الإخفاء، نجعله يظهر بشكل عمودي تحت */
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 16px;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
    }
    
    .main-nav a {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .btn-login,
    .btn-register {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    
    .btn-login span,
    .btn-register span {
        display: inline;
    }
    
    .theme-toggle {
        width: 34px;
        height: 34px;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 576px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .main-nav {
        justify-content: center;
        gap: 12px;
    }
    
    .main-nav a {
        font-size: 0.75rem;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .btn-login,
    .btn-register {
        padding: 5px 12px;
        font-size: 0.75rem;
    }
    
    .btn-login i,
    .btn-register i {
        font-size: 0.7rem;
    }
}





/* ============ Hero Section ============ */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.06), transparent 60%);
    padding: 140px 0 100px;
}

/* ✅ Floating Orbs - شفافية وبلور مناسب */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}

body.dark-mode .floating-orb {
    opacity: 0.2;
}

.orb-1 {
    width: 350px;
    height: 350px;
    background-color: var(--primary);
    top: 10%;
    left: -10%;
}

.orb-2 {
    width: 280px;
    height: 280px;
    background-color: var(--secondary);
    bottom: 10%;
    right: -5%;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background-color: var(--primary-light);
    top: 50%;
    left: 30%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(20px, -30px) rotate(5deg); }
    66% { transform: translate(-15px, 20px) rotate(-3deg); }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 24px;
}

body.dark-mode .hero-badge {
    background-color: rgba(59, 130, 246, 0.12);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 40px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: var(--shadow-hero);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 25px 40px -12px var(--glow-blue);
}

.btn-secondary {
    padding: 12px 28px;
    background-color: transparent;
    border: 1.5px solid var(--border-strong);
    border-radius: 40px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-3px);
}

.btn-large {
    padding: 14px 36px;
    font-size: 1rem;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ✅ Hero Illustration مع Floating Elements محسنة */
.hero-illustration {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.illustration-inner {
    width: 100%;
    padding-bottom: 100%;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(139, 92, 246, 0.8));
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: floatIllustration 6s ease-in-out infinite;
    box-shadow: var(--shadow-lg);
}

.illustration-inner i {
    font-size: 6rem;
    color: white;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* ✅ Floating Elements - Glass Effect صحيح (شفافة ومرئية في الوضعين) */
.floating-element {
    position: absolute;
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    animation: floatElement 4s ease-in-out infinite;
}

body.dark-mode .floating-element {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.floating-element i {
    font-size: 3rem;
    color: white;
}

.elem-1 {
    top: -15px;
    right: -15px;
    animation-delay: 0s;
}

.elem-2 {
    bottom: -15px;
    left: -15px;
    animation-delay: -1s;
}

.elem-3 {
    top: 40%;
    right: -25px;
    animation-delay: -2s;
}

@keyframes floatIllustration {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes floatElement {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}







.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border);
        padding: 20px;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        z-index: 100;
    }
    
    .main-nav.active {
        display: flex;
    }
}










/* ============ تحسينات الـ Hero Section للهواتف ============ */

/* للشاشات المتوسطة */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-desc {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 30px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
}

/* للشاشات الصغيرة (هواتف) */
@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0 60px;
        min-height: auto;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-content {
        order: 1;
    }
    
    .hero-visual {
        order: 0;
        margin-bottom: 20px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-desc {
        font-size: 0.9rem;
        line-height: 1.6;
        padding: 0 10px;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .hero-buttons a {
        width: 80%;
        justify-content: center;
    }
    
    .hero-stats {
        gap: 20px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .stat-item {
        min-width: 80px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* ✅ تحسين الصورة / الأيقونة */
    .hero-illustration {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .illustration-inner {
        border-radius: 40px;
    }
    
    .illustration-inner i {
        font-size: 3.5rem;
    }
    
    /* ✅ إخفاء بعض الـ Floating Elements على الموبايل عشان ما يضيقوش الشاشة */
    .floating-element.elem-3 {
        display: none;
    }
    
    .floating-element {
        width: 40px;
        height: 40px;
    }
    
    .floating-element i {
        font-size: 1.2rem;
    }
    
    .elem-1 {
        top: -10px;
        right: -10px;
    }
    
    .elem-2 {
        bottom: -10px;
        left: -10px;
    }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 576px) {
    .hero-section {
        padding: 80px 0 50px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-desc {
        font-size: 0.85rem;
    }
    
    .hero-buttons a {
        width: 100%;
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .hero-stats {
        gap: 15px;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .hero-illustration {
        max-width: 220px;
    }
    
    .illustration-inner i {
        font-size: 2.8rem;
    }
    
    .floating-element {
        width: 32px;
        height: 32px;
    }
    
    .floating-element i {
        font-size: 1rem;
    }
    
    .elem-2 {
        display: none;
    }
}

/* تحسين الـ Floating Orbs على الموبايل */
@media (max-width: 768px) {
    .floating-orb {
        filter: blur(60px);
        opacity: 0.15;
    }
    
    .orb-1 {
        width: 200px;
        height: 200px;
    }
    
    .orb-2 {
        width: 180px;
        height: 180px;
    }
    
    .orb-3 {
        width: 150px;
        height: 150px;
    }
}





/* ============ إصلاح تداخل العناصر الطافية مع الـ Header على الموبايل ============ */

/* للشاشات المتوسطة والصغيرة */
@media (max-width: 992px) {
    /* ✅ منع العناصر الطافية من تجاوز الـ Hero Section */
    .hero-section {
        overflow: hidden;
        position: relative;
        isolation: isolate;
    }
    
    /* ✅ تأكد أن الـ Header فوق الجميع */
    .main-header {
        position: relative;
        z-index: 100;
        background-color: transparent;
    }
    
    /* ✅ تقييد العناصر الطافية داخل الـ Hero فقط */
    .floating-orb,
    .floating-element {
        position: absolute;
        z-index: 0;
    }
    
    /* ✅ منع العناصر من الطفو فوق الـ Header */
    .hero-section .floating-orb,
    .hero-section .floating-element {
        z-index: 0;
    }
    
    /* ✅ تقليل حجم العناصر الطافية */
    .floating-orb {
        opacity: 0.2;
    }
    
    .orb-1 {
        width: 150px;
        height: 150px;
        top: 20%;
        left: -20%;
    }
    
    .orb-2 {
        width: 120px;
        height: 120px;
        bottom: 20%;
        right: -15%;
    }
    
    .orb-3 {
        width: 100px;
        height: 100px;
        top: 60%;
        left: 10%;
        display: none; /* إخفاء الثالثة على الموبايل */
    }
    
    /* ✅ العناصر الطافية الصغيرة */
    .floating-element {
        width: 35px;
        height: 35px;
    }
    
    .floating-element i {
        font-size: 1rem;
    }
    
    /* ✅ تعديل مواقعها عشان ما تخرجش بره */
    .elem-1 {
        top: 5%;
        right: 5%;
    }
    
    .elem-2 {
        bottom: 5%;
        left: 5%;
    }
    
    .elem-3 {
        display: none; /* إخفاء الثالثة */
    }
}

/* للشاشات الصغيرة جداً (هواتف) */
@media (max-width: 768px) {
    /* ✅ إخفاء كل العناصر الطافية على الموبايل (الحل الأضمن) */
    .floating-orb,
    .floating-element {
        display: none;
    }
    
    /* ✅ أو إذا عايز تخليها موجودة بس آمنة */
    .hero-section {
        overflow-x: clip;
    }
    
    .orb-1 {
        width: 100px;
        height: 100px;
        top: 30%;
        left: -30%;
        display: block;
    }
    
    .orb-2 {
        width: 80px;
        height: 80px;
        bottom: 30%;
        right: -25%;
        display: block;
    }
    
    /* ✅ باقي العناصر مخفية */
    .orb-3,
    .elem-1,
    .elem-2,
    .elem-3 {
        display: none;
    }
}

/* للشاشات الصغيرة جداً (أقل من 576px) */
@media (max-width: 576px) {
    /* ✅ إخفاء كل العناصر الطافية تماماً عشان ما تبوظش التصميم */
    .floating-orb,
    .floating-element {
        display: none !important;
    }
    
    .hero-section {
        overflow: visible;
    }
}

/* ✅ كمان تأكد إن الـ Header يفضل فوق الكل */
.main-header {
    position: relative;
    z-index: 100;
    background-color: transparent;
}

.main-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
}

body.dark-mode .main-header.scrolled {
    background: rgba(11, 17, 32, 0.95);
}

/* ✅ ملف container يبقى فوق العناصر الطافية */
.container {
    position: relative;
    z-index: 5;
}








/* ============ إصلاح الشامل للعناصر الطافية ============ */

/* كل العناصر الطافية تكون تحت المحتوى */
.hero-section {
    position: relative;
    isolation: isolate;
}

.hero-section > *:not(.floating-orb):not(.floating-element) {
    position: relative;
    z-index: 10;
}

.floating-orb,
.floating-element {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

/* منع العناصر الطافية من تجاوز حدود الـ Hero */
.hero-section {
    overflow-x: clip;
    overflow-y: visible;
}






/* ============ إصلاح ظهور أيقونات الـ Hero Illustration على الموبايل ============ */

/* للشاشات المتوسطة */
@media (max-width: 992px) {
    .hero-illustration {
        max-width: 320px;
    }
    
    .illustration-inner {
        border-radius: 40px;
    }
    
    .illustration-inner i {
        font-size: 4rem;
    }
    
    .floating-element {
        width: 45px;
        height: 45px;
    }
    
    .floating-element i {
        font-size: 1.3rem;
    }
}

/* للشاشات الصغيرة (هواتف) */
@media (max-width: 768px) {
    .hero-visual {
        order: 0;
        margin-bottom: 20px;
        display: flex;
        justify-content: center;
    }
    
    .hero-illustration {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .illustration-inner {
        border-radius: 35px;
        box-shadow: var(--shadow-md);
    }
    
    .illustration-inner i {
        font-size: 3rem;
    }
    
    /* ✅ إظهار العناصر الطافية الصغيرة */
    .floating-element {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        display: flex !important; /* تأكيد الظهور */
    }
    
    .floating-element i {
        font-size: 1.2rem;
    }
    
    /* تعديل مواقعها عشان تتلائم مع الحجم الأصغر */
    .elem-1 {
        top: -10px;
        right: -10px;
    }
    
    .elem-2 {
        bottom: -10px;
        left: -10px;
    }
    
    .elem-3 {
        top: 40%;
        right: -15px;
        display: flex !important;
    }
}

/* للشاشات الصغيرة جداً */
@media (max-width: 576px) {
    .hero-illustration {
        max-width: 220px;
    }
    
    .illustration-inner {
        border-radius: 30px;
    }
    
    .illustration-inner i {
        font-size: 2.5rem;
    }
    
    .floating-element {
        width: 32px;
        height: 32px;
    }
    
    .floating-element i {
        font-size: 1rem;
    }
    
    .elem-1 {
        top: -8px;
        right: -8px;
    }
    
    .elem-2 {
        bottom: -8px;
        left: -8px;
    }
    
    .elem-3 {
        display: none; /* إخفاء الثالثة على الشاشات الصغيرة جداً عشان الزحمة */
    }
}

/* تأكيد إظهار العناصر حتى لو كان فيه إخفاء عام */
@media (max-width: 768px) {
    .hero-illustration .floating-element {
        display: flex !important;
    }
}






/* بدل ما تخفي كل العناصر الطافية */
@media (max-width: 768px) {
    /* ✅ إخفاء العناصر الطافية الكبيرة (الـ Orbs) فقط، مش اللي جوه الـ illustration */
    .hero-section > .floating-orb {
        display: none;
    }
    
    /* ✅ العناصر جوه الـ illustration تفضل ظاهرة */
    .hero-illustration .floating-element {
        display: flex !important;
    }
}








/* ============ Trust Section ============ */
.trust-section {
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.trust-text {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.trust-badges {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.trust-badges span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.trust-badges span:hover {
    opacity: 1;
}

/* ============ Features Section ============ */
.features-section {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    opacity: 0;
    transform: translateY(30px);
    box-shadow: var(--shadow-sm);
}

.feature-card.show {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

/* ✅ Feature Main Card - Saturation أقل */
.feature-main {
    grid-column: span 2;
    grid-row: span 2;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(59, 130, 246, 0.78));
}

.feature-main h3,
.feature-main p {
    color: white;
}

.feature-main .feature-icon {
    background-color: rgba(255, 255, 255, 0.2);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: var(--primary);
    transition: all 0.3s;
}

body.dark-mode .feature-icon {
    background-color: rgba(59, 130, 246, 0.12);
}

.feature-card:hover .feature-icon {
    transform: rotate(5deg) scale(1.05);
    background-color: var(--primary);
    color: white;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.feature-tag {
    display: inline-block;
    margin-top: 16px;
    padding: 4px 12px;
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============ How It Works Section - نسخة مبسطة ونظيفة ============ */
.howitworks-section {
    padding: 80px 0;
}

.steps-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* ✅ الرقم - كبير وواضح */
.step-number {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-md);
}

/* ✅ الأيقونة */
.step-icon {
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: var(--primary);
    transition: all 0.3s;
}

.step:hover .step-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.step h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* استجابة */
@media (max-width: 768px) {
    .steps-container {
        flex-direction: column;
        align-items: center;
    }
    
    .step {
        max-width: 320px;
        width: 100%;
    }
}

/* ============ AI Showcase Section ============ */
.ai-showcase-section {
    padding: 80px 0;
}

.ai-showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 60px;
}

.ai-content h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.ai-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.8;
}

.ai-features {
    list-style: none;
    margin-bottom: 32px;
}

.ai-features li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.ai-features li i {
    color: var(--primary);
    font-size: 1.1rem;
}


/* ============ Glow Effect للرسايل ============ */
@keyframes messageGlow {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.chat-message {
    animation: messageGlow 0.5s ease-out;
}

/* تأثير glow إضافي للـ Chat Container في الوضعين */
.ai-chat-preview {
    position: relative;
    transition: box-shadow 0.3s ease;
}

.ai-chat-preview:hover {
    box-shadow: 0 0 30px var(--glow-blue);
}

/* تأثير الكتابة */
.typing-indicator span {
    box-shadow: 0 0 5px var(--primary);
    animation: typing 1.4s infinite, glowPulse 1.4s infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 2px var(--primary);
    }
    50% {
        box-shadow: 0 0 10px var(--primary);
    }
}

/* ============ AI Showcase Section - Chat Box بحجم ثابت ============ */
.ai-chat-preview {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 20px;
    box-shadow: var(--shadow-md);
    height: 420px;
    max-height: 420px;
    min-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.3s ease;
}

/* شريط تمرير مخصص داخل الصندوق */
.ai-chat-preview::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-preview::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.ai-chat-preview::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

.ai-chat-preview::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* الرسايل - تتوسع بشكل طبيعي جوا الصندوق */
.chat-message {
    animation: messageGlow 0.5s ease-out;
    flex-shrink: 0;
}

/* الرسايل الطويلة تاخذ مساحتها من غير ما تكبر الصندوق */
.chat-message p {
    word-wrap: break-word;
    max-width: 85%;
}

/* تأثير glow */
@keyframes messageGlow {
    0% {
        opacity: 0;
        filter: blur(8px);
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

/* تأثير الكتابة */
.typing-indicator span {
    box-shadow: 0 0 5px var(--primary);
    animation: typing 1.4s infinite, glowPulse 1.4s infinite;
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 2px var(--primary);
    }
    50% {
        box-shadow: 0 0 10px var(--primary);
    }
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .ai-chat-preview {
        height: 380px;
        max-height: 380px;
        min-height: 380px;
    }
}

/* ============ تصميم المحادثة - متوافق مع RTL ============ */
.ai-chat-preview {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 24px;
    box-shadow: var(--shadow-md);
}

/* رسالة البوت (على اليمين في RTL) */
.chat-message.bot {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-start;
}

.chat-message.bot i {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-message.bot p {
    background-color: var(--bg-secondary);
    padding: 10px 18px;
    border-radius: 22px;
    border-bottom-right-radius: 4px;
    max-width: 80%;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

/* رسالة المستخدم (على اليسار في RTL) */
.chat-message.user {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: flex-end;
}

.chat-message.user p {
    background-color: var(--primary);
    padding: 10px 18px;
    border-radius: 22px;
    border-bottom-left-radius: 4px;
    max-width: 80%;
    color: white;
    font-size: 0.9rem;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

/* مؤشر الكتابة */
.chat-message.bot.typing {
    display: flex;
    align-items: center;
    gap: 12px;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 10px 18px;
    background-color: var(--bg-secondary);
    border-radius: 22px;
    border-bottom-right-radius: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--text-tertiary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}



/* ============ تحسينات الـ Responsive لقسم الـ AI Chat ============ */

/* للشاشات المتوسطة (تابلت) */
@media (max-width: 992px) {
    .ai-chat-preview {
        height: 380px;
        max-height: 380px;
        min-height: 380px;
        padding: 16px;
    }
    
    .chat-message.bot p,
    .chat-message.user p {
        max-width: 85%;
        font-size: 0.85rem;
        padding: 8px 14px;
    }
    
    .chat-message.bot i {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* للشاشات الصغيرة (هواتف) */
@media (max-width: 768px) {
    .ai-showcase-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .ai-chat-preview {
        height: 350px;
        max-height: 350px;
        min-height: 350px;
        padding: 14px;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    .chat-message {
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .chat-message.bot p,
    .chat-message.user p {
        max-width: 90%;
        font-size: 0.8rem;
        padding: 8px 12px;
        line-height: 1.5;
    }
    
    .chat-message.bot i {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .typing-indicator {
        padding: 8px 14px;
        gap: 4px;
    }
    
    .typing-indicator span {
        width: 6px;
        height: 6px;
    }
    
    /* تحسين عرض المحتوى النصي داخل الـ AI */
    .ai-content h2 {
        font-size: 1.6rem;
    }
    
    .ai-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .ai-features li {
        font-size: 0.85rem;
        gap: 8px;
        margin-bottom: 10px;
        text-align: right;
        justify-content: flex-start;
    }
    
    .ai-features li i {
        font-size: 0.9rem;
        flex-shrink: 0;
    }
}

/* للشاشات الصغيرة جداً (هواتف ضيقة) */
@media (max-width: 576px) {
    .ai-chat-preview {
        height: 320px;
        max-height: 320px;
        min-height: 320px;
        padding: 12px;
    }
    
    .chat-message.bot p,
    .chat-message.user p {
        max-width: 95%;
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .chat-message.bot i {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .typing-indicator {
        padding: 6px 12px;
    }
    
    .typing-indicator span {
        width: 5px;
        height: 5px;
    }
    
    .ai-content h2 {
        font-size: 1.4rem;
    }
    
    .ai-content .btn-primary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* تحسين شريط التمرير للهواتف */
@media (max-width: 768px) {
    .ai-chat-preview::-webkit-scrollbar {
        width: 4px;
    }
    
    .ai-chat-preview::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .ai-chat-preview::-webkit-scrollbar-thumb {
        background: var(--border-strong);
        border-radius: 4px;
    }
}

/* ============ Subjects Section ============ */
.subjects-section {
    padding: 80px 0;
}

.subjects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.subject-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.subject-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.subject-icon {
    width: 64px;
    height: 64px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem;
    color: var(--primary);
    transition: all 0.3s;
}

.subject-card:hover .subject-icon {
    transform: scale(1.05);
    background-color: var(--primary);
    color: white;
}

body.dark-mode .subject-icon {
    background-color: rgba(59, 130, 246, 0.12);
}

.subject-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.subject-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.subject-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
}

/* ============ Stats Section ============ */
.stats-section {
    padding: 70px 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 40px;
}

.stat-number-stat {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat-label-stat {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* ============ Testimonials Section ============ */
.testimonials-section {
    padding: 80px 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.testimonial-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.testimonial-avatar {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.testimonial-stars {
    color: #fbbf24;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.testimonial-text {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 0.9rem;
}

.testimonial-name {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.testimonial-role {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============ FAQ Section ============ */
.faq-section {
    padding: 80px 0;
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.3s;
    color: var(--text-primary);
}

.faq-question:hover {
    background-color: rgba(37, 99, 235, 0.04);
}

.faq-question i {
    transition: transform 0.3s;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.faq-item.active .faq-answer {
    padding: 0 24px 20px;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ============ Final CTA Section ============ */
.final-cta-section {
    padding: 80px 0;
}

.cta-card {
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    border-radius: 32px;
    padding: 60px 48px;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* تأثير خلفي خفيف */
.cta-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15), transparent 60%);
    pointer-events: none;
}

/* تنسيق خاص للوضع المظلم - خلفية مناسبة */
body.dark-mode .cta-card {
    background: linear-gradient(135deg, #3b82f6, #a78bfa);
}

.cta-card h2 {
    font-size: 2.2rem;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: white;
}

.cta-card p {
    margin-bottom: 32px;
    opacity: 0.92;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============ أزرار CTA - متوافقة مع التصميم العام ============ */

/* زر Primary في CTA - أبيض مع لون نص أزرق (مناسب ليلاً ونهاراً) */
.cta-card .btn-primary {
    background: white;
    color: #1d4ed8;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cta-card .btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    background: white;
    color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* زر Secondary في CTA - شفاف مع حدود بيضاء */
.cta-card .btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(4px);
}

.cta-card .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    color: white;
}

/* ============ تنسيق خاص للوضع المظلم (تأكيد فقط) ============ */
body.dark-mode .cta-card .btn-primary {
    background: white;
    color: #2563eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .cta-card .btn-primary:hover {
    background: white;
    color: #2563eb;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

body.dark-mode .cta-card .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

body.dark-mode .cta-card .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: white;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .cta-card {
        padding: 40px 24px;
    }
    
    .cta-card h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .cta-buttons a {
        width: 100%;
        justify-content: center;
    }
}

/* ============ Footer ============ */
.main-footer {
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.footer-logo span:first-child {
    font-size: 1.5rem;
}

.footer-logo span span {
    color: var(--primary);
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 280px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    width: 38px;
    height: 38px;
    background-color: rgba(37, 99, 235, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.social-links a:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

body.dark-mode .social-links a {
    background-color: rgba(59, 130, 246, 0.1);
}

.footer-col h4 {
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ============ Scrollbar محسن ============ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background-color: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary);
}

/* ============ Responsive ============ */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-main {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .hero-section {
        padding: 120px 0 60px;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-desc {
        font-size: 1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 32px;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .steps-container {
        flex-direction: column;
        gap: 32px;
    }
    
    .step-connector {
        display: none;
    }
    
    .ai-showcase-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    
    .ai-features {
        text-align: right;
        display: inline-block;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 32px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-desc {
        max-width: 100%;
    }
    
    .cta-card {
        padding: 40px 24px;
    }
    
    .cta-card h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 100px 0 50px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 16px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .hero-buttons a {
        width: 100%;
        justify-content: center;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .stat-number-stat {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .cta-buttons a {
        width: 100%;
    }
    
    .floating-element {
        width: 40px;
        height: 40px;
    }
    
    .floating-element i {
        font-size: 1rem;
    }
    
    .elem-3 {
        display: none;
    }
}












/* ========================================= */
/* 🚀 تحسينات إضافية للهيدر الثابت (Fixed) */
/* ========================================= */

/* ✅ التأكد من أن المحتوى يبدأ تحت الهيدر */
.hero-section {
    padding-top: 130px;
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 100px;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding-top: 90px;
    }
}

/* ✅ منع العناصر الطافية من عمل سكرول أفقي */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* ✅ تصغير العناصر الطافية على الموبايل */
@media (max-width: 576px) {
    .floating-orb {
        display: none;
    }
    
    .hero-illustration .floating-element {
        width: 35px;
        height: 35px;
    }
    
    .hero-illustration .floating-element i {
        font-size: 1rem;
    }
    
    .hero-illustration .elem-1 {
        top: -5px;
        right: -5px;
    }
    
    .hero-illustration .elem-2 {
        bottom: -5px;
        left: -5px;
    }
    
    .hero-illustration .elem-3 {
        display: none;
    }
    
    /* ✅ تحسين الهيدر على الموبايل الصغير */
    .header-content {
        gap: 8px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .logo-icon {
        font-size: 1.3rem;
    }
    
    .btn-login,
    .btn-register {
        padding: 5px 10px;
        font-size: 0.7rem;
    }
    
    .btn-login span,
    .btn-register span {
        display: inline;
    }
}








/* ============ تأكيد ثبات الهيدر (Force Fixed) ============ */
.main-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}














/* ============ تحكم ذكي في الهيدر (شاشات كبيرة = Fixed / موبايل = Relative) ============ */

/* 1. الكمبيوتر والتابلت (أكبر من 768px): يظل ثابت Fixed */
.main-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
}

/* 2. الموبايل والشاشات الصغيرة (768px فأقل): يتحول لعادي Relative */
@media (max-width: 768px) {
    .main-header {
        position: relative !important;
        background-color: var(--bg-primary) !important; /* لون ثابت بدل الشفافية */
        padding: 16px 0 !important;
    }
    
    /* إلغاء تأثير السكرول (البلور) على الموبايل لأن الهيدر لم يعد ينزل مع الشاشة */
    .main-header.scrolled {
        backdrop-filter: none !important;
        background: var(--bg-primary) !important;
    }
    
    body.dark-mode .main-header,
    body.dark-mode .main-header.scrolled {
        background-color: var(--bg-primary) !important;
    }

    /* تقليل المسافة العلوية للـ Hero لأن الهيدر أخذ مساحته الطبيعية ولم يعد يطفو فوقه */
    .hero-section {
        padding-top: 40px !important; 
    }
}

@media (max-width: 576px) {
    /* ضبط المسافة للشاشات الأصغر جداً */
    .hero-section {
        padding-top: 30px !important;
    }
}