/* ==========================================================================
   ملف تنسيق سي ميديا - (النسخة المعتمدة النهائية)
   ========================================================================== */

/* ----------------------------------------------------------
   1. أساسيات الموقع (الخط والاتجاه)
   ---------------------------------------------------------- */
body, h1, h2, h3, h4, h5, h6, p, a, span, div, li, button, input, textarea, .btn {
    font-family: 'Cairo', sans-serif !important;
}

body {
    text-align: right;
}

input, textarea {
    direction: rtl;
    text-align: right;
}

.fa, .fab, .fas, .far {
    margin-left: 5px;
    margin-right: 0;
}

/* ----------------------------------------------------------
   2. القائمة العلوية - للكمبيوتر (Desktop)
   ---------------------------------------------------------- */
/* حماية القائمة لتبقى LTR برمجياً */
nav, .navbar, header, #header {
    direction: ltr !important; 
}

/* الشعار يمين - القائمة يسار */
.navbar > .container, .navbar > .container-fluid {
    display: flex !important;
    flex-direction: row-reverse !important; 
    justify-content: space-between !important;
}

/* ترتيب الروابط */
.navbar-nav, .menu {
    display: flex !important;
    flex-direction: row-reverse !important;
    align-items: center !important;
    gap: 30px !important;  
    margin: 0 !important;
}

.nav-link {
    padding: 0 !important;
    text-align: right !important;
}

/* ----------------------------------------------------------
   3. القائمة العلوية - للموبايل (Mobile)
   ---------------------------------------------------------- */
@media (max-width: 991px) {
    
    /* أ. الشريط العلوي المغلق (زر القائمة يمين - الشعار يسار) */
    .navbar > .container, .navbar > .container-fluid {
        flex-direction: row !important; 
    }

    /* ب. القائمة المفتوحة (تفعيل العربية) */
    .navbar-collapse {
        direction: rtl !important;
        text-align: right !important;
    }

    /* ج. رأس القائمة (الشعار وزر الإغلاق) */
    .navbar-collapse .navbar-header,
    .offcanvas-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* د. (تعديلك الذكي) ضبط مسافة الشعار */
    .navbar-collapse .navbar-brand,
    .navbar-brand img {
        /* هنا تضع المسافة التي نجحت معك */
        margin-right: 20px !important; /* عدل هذا الرقم حسب رغبتك */
        margin-left: 0 !important;
    }

    /* هـ. زر الإغلاق */
    .navbar-collapse button, 
    .navbar-collapse .close {
        margin: 0 !important;
    }

    /* و. الروابط */
    .navbar-nav {
        flex-direction: column !important;
        gap: 0 !important;
        padding-right: 0 !important;
        margin-top: 10px !important;
    }

    .nav-link {
        padding: 10px 15px !important;
        border-bottom: 1px solid rgba(0,0,0,0.05);
        text-align: right !important;
        display: block;
    }
}








.chat-window {
    position: fixed;
    bottom: 110px; /* ترتفع عن الزر قليلاً */
    left: 40px;    /* محاذاة لليسار */
    width: 300px;
    height: 400px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    display: none;       /* سنجعلها ظاهرة مؤقتاً لنرى التصميم */
    flex-direction: column;
    overflow: hidden;
    font-family: sans-serif;
    border: 1px solid #eee;
}

/* رأس النافذة (أزرق) */
.chat-header {
    background-color: #4F46E5;
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* منطقة الرسائل (الوسط) */
.chat-body {
    flex: 1; /* تأخذ المساحة المتبقية */
    padding: 15px;
    background-color: #f9f9f9;
    overflow-y: auto; /* السماح بالتمرير إذا كثرت الرسائل */
}

/* شكل رسالة البوت */
.bot-message {
    background-color: #e0e7ff;
    color: #333;
    padding: 10px 15px;
    border-radius: 15px 15px 15px 0;
    margin-bottom: 10px;
    font-size: 14px;
    width: fit-content;
    max-width: 85%;
    line-height: 1.5;
}

/* منطقة الكتابة (الأسفل) */
.chat-footer {
    padding: 10px;
    border-top: 1px solid #eee;
    background: white;
    display: flex;
    gap: 5px;
}

.chat-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.send-btn {
    background: #4F46E5;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
}