/* =========================================
   1. المتخدمات والإعدادات العامة (Root & Global)
   ========================================= */
:root {
    --primary: #2c3e50; 
    --secondary: #a26bda; 
    --accent: #dbb9fa; 
    --navbar-bg: #d2abf3; 
    --white: #ffffff;
    --text-primary: #5c3c78; 
    --shadow: 0 10px 40px rgba(162, 107, 218, 0.1); 
}

* { box-sizing: border-box; }

body {
    font-family: 'Cairo', sans-serif;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    color: #333;
    background-image: url("img.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed; 
    background-repeat: no-repeat;
    background-size: cover, auto; /* حجم جزيئات الشبكة */

}

/* الأقسام العامة */
section { 
    display: none; 
    padding: 80px 10%; 
    min-height: calc(100vh - 70px); 
    align-items: center; 
    justify-content: center; 
    animation: fadeIn 0.4s ease-in-out;
}

section.active { display: flex; animation: fadeIn 0.5s ease-in-out; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.clear-container {
    background: rgba(255, 255, 255, 0.4); /* شفافية عالية جداً */
    backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.6); /* خط أبيض رقيق جداً */
    box-shadow: 0 20px 50px rgba(162, 107, 218, 0.05); /* ظل خفيف جداً لا يكاد يُرى */
    border-radius: 40px; /* زوايا دائرية أكثر نعومة */
}

/* =========================================
   2. شريط التنقل (Navbar) - مع بقاء اللوغو ظاهراً
   ========================================= */
nav {
    display: flex;
    direction: rtl; 
    justify-content: flex-start;
    background: var(--navbar-bg);
    padding: 8px 2%;
    gap: 15px;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1100; /* رفعنا الـ z-index ليكون فوق القائمة دائماً */
    box-shadow: 0 4px 15px rgba(162, 107, 218, 0.15);
    border-bottom: 2px solid var(--accent);
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    padding: 10px 0;
    z-index: 1200; /* لضمان بقاء زر المنيو فوق القائمة أيضاً */
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: 0.3s;
    border-radius: 2px;
}

.logo { 
    font-size: 1.6rem; 
    font-weight: 700; 
    color: var(--text-primary); 
    text-transform: uppercase; 
    letter-spacing: 1px;
    z-index: 1200; /* اللوغو يظل فوق كل شيء */
}

/* القائمة الجانبية (الطولية) */
.nav-links {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50px; /* تبدأ من أعلى الشاشة تماماً */
    right: -260px; /* مخفية */
    width: 180px;
    height: 95vh ;
    padding: 30px 20px 20px 20px; /* ترك مساحة علوية (100px) لكي لا تغطي الشريط العلوي */
    gap: 25px;
    list-style: none;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000; /* أقل من الـ nav بـ 100 درجة لتنزلق خلف اللوغو */
    background: rgba(210, 171, 243, 0.8); /* أرجواني شفاف */
    backdrop-filter: blur(15px);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.02); /* ظل ناعم جداً */

}

.nav-links.active {
    right: 0;
    display: flex;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    transition: 0.3s;
    padding: 12px 15px;
    border-radius: 8px;
    display: block;
    text-align: right;
    border-bottom: 1px solid rgba(162, 107, 218, 0.1); /* خط خفيف بين العناصر */
}

.nav-links li a:hover, .nav-links li a.active-link { 
    color: var(--white); 
    background-color: var(--secondary); 
}
/* =========================================
   3. الصفحة الرئيسية (Hero Section) - التعديل النهائي للتناسق
   ========================================= */
#home { 
    background: transparent; 
    display: flex; /* لضمان تمركز الحاوية */
    justify-content: center;
    align-items: center;
}
#home.active { display: flex; }

/* حاوية المحتوى الرئيسية */
#home .clear-container {
    width: 90%; /* لضمان التجاوب */
    max-width: 1200px;
    margin: 0 auto;
    /* التخفيف الرقيق كما طلبتِ */
    background: rgba(255, 255, 255, 0.4); 
    backdrop-filter: blur(10px); 
    padding: 60px 50px; /*Padding داخلي كافٍ لتنفس النص*/
    border-radius: 40px; 
    box-shadow: 0 20px 50px rgba(162, 107, 218, 0.05); 
    border: 1px solid rgba(255, 255, 255, 0.6);
    /* لضمان التنسيق الطولي للنصوص */
    display: block; 
    text-align: right; 
    overflow: hidden; /* لمنع النص من الخروج عن الحدود */
}

/* تنسيق العنوان الرئيسي (PNEIA منصة ذكاء اصطناعي) */
.hero-title { 
    width: 100%; /* النص يأخذ كامل العرض المتاح */
    font-size: 2.8rem; 
    margin-bottom: 25px; 
    font-weight: 700; 
    color: var(--text-primary); 
    line-height: 1.3; 
}

/* تنسيق النص التعريفي الطويل (نوظف منهجية...) */
.hero-desc { 
    width: 100%; /* النص يأخذ كامل العرض المتاح */
    font-size: 1.25rem; 
    margin-bottom: 45px; /* مسافة قبل الزر */
    opacity: 0.9; 
    color: #1d1d1d; /* لون أخف للقراءة الطويلة */
    line-height: 1.8; /* مسافة أسطر مريحة للقراءة */
}

/* --- تنسيق الزر المحوط (Outlined Button) --- */
/* (الحدود محوطة وتأثير الحوم يملأ الزر) */
.btn {
    padding: 14px 35px; border-radius: 50px; cursor: pointer;
    font-weight: 700; transition: 0.4s ease; border: none; text-decoration: none; display: inline-block;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
}

/* تنسيق الزر الأساسي */
.btn-outline-colored {
    display: inline-block; /* ضروري جداً لكي يعمل التأثير */
    padding: 12px 30px;
    border: 2px solid var(--secondary); /* حدود أرجوانية */
    background: transparent;
    color: var(--secondary);
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease; /* سرعة استجابة التأثير */
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    margin-top: 20px;
}

/* تأثير تحريك الفأرة (الذي تفتقدينه) */
.btn-outline-colored:hover {
    background-color: var(--secondary); /* يمتلئ اللون */
    color: #ffffff !important; /* النص يصبح أبيض */
    transform: translateY(-3px); /* يرتفع قليلاً */
    box-shadow: 0 10px 20px rgba(162, 107, 218, 0.3); /* توهج خفيف */
}
/* =========================================
   4. صفحة التسجيل (Login Page)
   ========================================= */
/* 1. إزالة أي خلفية من الحاوية الكبيرة ليبقى المربع فقط */
#signup .clear-container {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* 2. تصميم المربع (login-card) ليكون عريضاً وشفافاً كما طلبتِ */
.login-card {
    /* أولاً: التحكم في الأبعاد لجعلها مربعة */
    width: 95%;
    max-width: 520px; /* عرض كافٍ للمربع */
    min-height: 520px; /* نفس قيمة العرض لضمان شكل المربع */
    aspect-ratio: 1 / 1; /* إجبار المتصفح على شكل المربع */
    
    /* ثانياً: ضغط المحتوى لتقليل الطول الزائد */
    display: flex;
    flex-direction: column;
    justify-content: center; /* توسيط العناصر عمودياً */
    align-items: center;
    padding: 30px 40px; /* تقليل الـ padding العلوي والسفلي */
    margin: 40px auto;

    /* ثالثاً: الشفافية والزجاج (نفس الإعدادات التي نجحت معك) */
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

/* رابعاً: تقليل المسافات بين العناصر الداخلية لتقصير الطول */
.login-title { 
    font-size: 2.2rem; 
    margin-bottom: 20px; /* تقليل المسافة تحت العنوان */
}

.input-group-line { 
    width: 100%; 
    margin-bottom: 15px; /* تقليل المسافة بين الحقول */
}

.divider-text { 
    margin: 15px 0; /* تقليل مسافة الفاصل */
}

.input-group-line { 
    width: 100%; 
    margin-bottom: 15px; /* تقليل المسافة بين الحقول */
}

.divider-text { 
    margin: 15px 0; /* تقليل مسافة الفاصل */
}

.input-group-line:focus-within { border-bottom-color: var(--secondary); }
.input-group-line input { width: 100%; border: none; background: transparent; padding: 10px 5px; font-family: 'Cairo', sans-serif; font-size: 1rem; outline: none; color: #4a5568; }

.btn-login-purple {
    background-color: #a26bda; color: white; width: 100%; padding: 14px;
    border: none; border-radius: 10px; font-size: 1.1rem; font-weight: bold;
    cursor: pointer; margin-top: 10px; transition: opacity 0.3s;
}
.btn-login-purple:hover { opacity: 0.9; }

.divider-text { margin: 25px 0; color: #718096; font-size: 0.9rem; position: relative; }
.social-login-row { display: flex; justify-content: center; gap: 20px; margin-bottom: 25px; }
.social-btn img { width: 38px; height: 38px; transition: transform 0.2s; }
.social-btn:hover img { transform: scale(1.1); }
/* =========================================
   5. صفحة الخدمات (Workspace / Services)
   ========================================= */
/*.workspace-modern { width: 100%; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

.input-wrapper {
    background: #fff; border: 1.5px solid #e0e0e0; border-radius: 16px;
    padding: 15px; display: flex; flex-direction: column; transition: 0.3s;
}
.input-wrapper:focus-within { border-color: var(--secondary); box-shadow: 0 4px 15px rgba(0,0,0,0.05); }

#textInput { width: 100%; min-height: 120px; border: none; outline: none; resize: none; font-size: 1.1rem; font-family: 'Cairo', sans-serif; }
*/
/* تعديل منطقة العمل وإدخال النص */
.workspace-modern {
    width: 100%;
    max-width: 1000px; /* جعلها أعرض لاستيعاب النصوص */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-wrapper {
    background: rgba(255, 255, 255, 0.8); /* جعلها بيضاء أكثر لسهولة القراءة */
    border: 1px solid rgba(162, 107, 218, 0.2);
    border-radius: 25px;
    padding: 25px;
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

#textInput {
    width: 100%;
    min-height: 200px; /* زيادة الارتفاع الافتراضي */
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.15rem;
    font-family: 'Cairo', sans-serif;
    line-height: 1.7;
    resize: vertical; /* السماح للمستخدم بتكبيرها طولياً فقط */
}
.input-actions-row { display: flex; justify-content: flex-end; align-items: center; gap: 20px; padding-top: 10px; border-top: 1px solid #f0f0f0; }

.send-btn {
    background: var(--secondary); color: white; border: none; width: 45px; height: 45px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 4px 10px rgba(162, 107, 218, 0.3);
}
.send-btn:hover { transform: translateY(-3px); background: var(--text-primary); }

.icon-btn { cursor: pointer; font-size: 1.4rem; color: var(--secondary); transition: 0.3s; display: flex; align-items: center; justify-content: center; padding: 8px; }
.icon-btn:hover { color: var(--text-primary); transform: rotate(-15deg); }

.options-bar { display: flex; justify-content: center; gap: 25px; font-size: 0.95rem; color: #555; }

.results-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 10px; }
.res-card { background: #fdfdfd; border: 1px solid #eee; border-radius: 12px; padding: 15px; min-height: 200px; opacity: 0; transform: translateY(20px); transition: all 0.6s ease-out; }
.res-card.visible { opacity: 1; transform: translateY(0); }
.res-data { font-size: 0.9rem; color: #444; line-height: 1.6; margin-top: 10px; }

/* =========================================
   6. صفحة الاشتراكات (Pricing Page)
   ========================================= */
.pricing-wrapper { display: flex; justify-content: center; gap: 30px; padding: 30px 0; margin-top: -30px; }

.pricing-card {
    background: #fff; border-radius: 12px; padding: 30px; width: 320px; min-height: 400px; height: auto;
    position: relative; box-shadow: 0 4px 15px rgba(162, 107, 218, 0.15); transition: transform 0.3s;
    border: 2px solid transparent; text-align: right; display: flex; flex-direction: column;
}
.pricing-card:hover { transform: translateY(-5px); border-color: rgba(162, 107, 218, 0.15); }

.price-header { text-align: center; margin-bottom: 25px; }
.price-header .amount { font-size: 2.8rem; font-weight: 700; }

.pricing-card .features { list-style: none; padding: 0; margin-top: 20px; margin-bottom: auto; }
.pricing-card .features li { padding: 10px 0; border-bottom: 1px solid #e2e8f0; font-size: 0.95rem; color: #4a5568; }

.btn-subscribe {
    width: 100%; padding: 14px; border: none; border-radius: 10px; font-family: 'Cairo', sans-serif;
    font-weight: 700; font-size: 1.1rem; cursor: pointer; transition: all 0.3s ease; margin-top: auto;
    background-color: #f8fafc; color: var(--text-primary); border: 1px solid var(--accent);
}

.pricing-card.basic { border-top: 5px solid #9766c9; }
.basic .btn-subscribe:hover { background-color: #9766c9; color: white; }

.pricing-card.professional { border-top: 5px solid #755299; }
.professional .btn-subscribe:hover { background-color: var(--secondary); color: white; }

.pricing-card.advanced { border-top: 5px solid #592f83; }
.advanced .btn-subscribe:hover { background-color: #592f83; color: white; }

/* =========================================
   7. النوافذ المنبثقة والدفع (Modals & Payment)
   ========================================= */
.modal {
    display: none; position: fixed; z-index: 3000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(92, 60, 120, 0.6); backdrop-filter: blur(8px);
}

.modal-content {
    background-color: #ffffff; margin: 8% auto; padding: 40px; border-radius: 25px;
    width: 90%; max-width: 500px; text-align: center; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideUp { from { transform: translateY(100px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.close-modal { position: absolute; left: 20px; top: 15px; font-size: 30px; cursor: pointer; color: var(--text-primary); transition: 0.3s; }
.close-modal:hover { color: #ff4d4d; }

.payment-methods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin: 30px 0; }
.method-card { border: 2px solid #f0f0f0; padding: 20px; border-radius: 15px; cursor: pointer; transition: 0.3s ease; display: flex; flex-direction: column; align-items: center; }
.method-card:hover { border-color: var(--secondary); background: #fdfaff; transform: translateY(-5px); }
.method-card img { width: 50px; height: 50px; margin-bottom: 10px; object-fit: contain; }

#paymentDetails { background: var(--accent); padding: 20px; border-radius: 15px; margin-top: 20px; display: none; border: 1px dashed var(--secondary); animation: fadeIn 0.3s; }

/* =========================================
   8. صفحة من نحن والتذييل (About & Footer)
   ========================================= */
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin: 40px 0; }
.about-card { background: #fdfaff; padding: 30px; border-radius: 20px; border: 1px solid var(--accent); transition: 0.3s; }
.about-card:hover { transform: translateY(-10px); box-shadow: 0 10px 25px rgba(162, 107, 218, 0.1); }
.about-card i { font-size: 2.5rem; color: var(--secondary); margin-bottom: 20px; }

.social-links-modern { margin-top: 50px; border-top: 1px solid #eee; padding-top: 30px; }
.icons-row { display: flex; justify-content: center; gap: 25px; margin-top: 15px; }
.icons-row a { font-size: 1.8rem; color: var(--secondary); transition: 0.3s; text-decoration: none; }
.icons-row a:hover { color: var(--primary); transform: scale(1.2); }
.footer-note { margin-top: 40px; font-size: 0.85rem; color: #888; }

/* =========================================
   9. شاشة التحميل (Loader) - مع الشعار الخاص بك
   ========================================= */
#loader-wrapper { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #e9c6de; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
    transition: opacity 0.8s ease-out, visibility 1s; 
}

.loader-content { 
    text-align: center; 
}

/* تعديل هنا: وضعنا الصورة بدل الدائرة */
.loader-logo-img { 
    width: 300px; /* يمكنك تكبير أو تصغير الشعار من هنا */
    height: auto;
    margin-bottom: 20px;
    animation: ai-pulse 4s infinite; /* تطبيق نفس تأثير النبض على صورتك */
}

.loader-text { 
    font-size: 1.8rem; 
    font-weight: 700;
    color: var(--text-primary); 
    letter-spacing: 3px; 
    margin-top: 10px;
}

/* تأثير النبض للصورة */
@keyframes ai-pulse {
    0% { 
        transform: scale(0.95); 
        filter: drop-shadow(0 0 0px rgba(162, 107, 218, 0.4)); 
    }
    70% { 
        transform: scale(1.05); 
        filter: drop-shadow(0 0 20px rgba(162, 107, 218, 0.3)); 
    }
    100% { 
        transform: scale(0.95); 
        filter: drop-shadow(0 0 0px rgba(162, 107, 218, 0.4)); 
    }
}

.loader-hidden { opacity: 0; visibility: hidden; }
/* =========================================
   10. التجاوب مع الموبايل (Responsive)
   ========================================= */
@media (max-width: 768px) {
    .results-layout { grid-template-columns: 1fr; }
    .options-bar { flex-direction: column; align-items: center; gap: 10px; }
    .pricing-wrapper { flex-direction: column; align-items: center; }
}