/* إضافة خط عربي جذاب */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');

/* ======================================================= */
/* FIX: منع التمرير الأفقي غير المرغوب فيه على مستوى عام */
/* ======================================================= */
body {
    font-family: 'Cairo', sans-serif;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* إضافة قواعد لضمان عدم وجود عناصر تخرج عن نطاق الرؤية */
html {
    overflow-x: hidden;
}

/* قاعدة عامة للتدقيق على أي عنصر قد يتسبب في تجاوز العرض */
* {
    max-width: 100%;
}


/* الوضع الليلي للألوان الأساسية */
.dark body {
    background-color: theme('colors.background-dark');
    color: theme('colors.gray.100');
}

.dark .bg-white {
    background-color: theme('colors.surface-dark');
}

.dark .text-gray-800 {
    color: theme('colors.gray.100');
}

.dark .shadow-xl {
    box-shadow: 0 10px 15px -3px rgba(255, 255, 255, 0.05), 0 4px 6px -2px rgba(255, 255, 255, 0.02);
}

.dark .bg-background-light {
    background-color: theme('colors.gray.800');
}

.dark .bg-primary\/5 {
    background-color: theme('colors.secondary') + '08';
    /* البرتقالي الشفاف */
}


.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 4px;
    background-color: theme('colors.secondary');
    border-radius: 9999px;
}

.cta-button {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.speaker-card,
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.speaker-card:hover,
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.1);
}

.icon-box {
    color: white;
}

.countdown-digit {
    min-width: 60px;
    /* Tailwind CSS classes are NOT used directly here as this is a separate CSS file. */
    font-size: 2.25rem; /* text-4xl */
    line-height: 2.5rem; /* text-4xl */
    font-weight: 900; /* font-black */
    color: #1D4ED8; /* text-primary */
    background-color: #fff; /* bg-white */
    padding: 1rem; /* p-4 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-xl */
    border-bottom-width: 4px; /* border-b-4 */
    border-color: #F97316; /* border-secondary */
    transition: all 0.5s ease-in-out; /* transition duration-500 ease-in-out */
}
@media (min-width: 640px) {
    .countdown-digit {
        font-size: 3rem; /* sm:text-5xl */
        line-height: 1; /* sm:text-5xl */
    }
}
.dark .countdown-digit {
    background-color: #1F2937; /* dark:bg-surface-dark */
}


.countdown-label {
    /* Tailwind CSS classes are NOT used directly here as this is a separate CSS file. */
    font-size: 0.875rem; /* text-sm */
    line-height: 1.25rem; /* text-sm */
    color: #4B5563; /* text-gray-600 */
    margin-top: 0.5rem; /* mt-2 */
    font-weight: 500; /* font-medium */
}
@media (min-width: 640px) {
    .countdown-label {
        font-size: 1rem; /* sm:text-base */
        line-height: 1.5rem; /* sm:text-base */
    }
}
.dark .countdown-label {
    color: #9CA3AF; /* dark:text-gray-400 */
}


/* ============================================== */
/* تنسيق الصفحة الجانبية (Sidebar) */
/* ============================================== */
.sidebar-menu {
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%);
    /* يبدأ مخفياً إلى اليمين */
}

.sidebar-menu.open {
    transform: translateX(0);
}

/* ============================================== */
/* تنسيق شات خدمة العملاء (الاحترافي الجانبي) */
/* ============================================== */

/* زر فتح الدردشة - في الأسفل اليسار */
#chat-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
}

/* نافذة الدردشة - شريط جانبي يخرج من اليسار */
#chat-window {
    width: 90vw;
    /* عرض 90% من الشاشة */
    max-width: 380px;
    /* الحد الأقصى للعرض */
    height: 80vh;
    /* ارتفاع 80% من الشاشة */
    max-height: 600px;
    /* الحد الأقصى للارتفاع */
    
    /* تصميم واتساب */
    background-image: url('https://placehold.co/400x600/e5ddd5/e5ddd5?text=');
    background-size: cover;
    background-color: #e5ddd5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    
    /* موضع ثابت في الزاوية السفلية اليسرى (جانبي) */
    position: fixed;
    bottom: 100px; /* فوق زر الفتح قليلاً */
    left: 30px;
    
    display: none; /* يتم إظهارها وإخفاؤها عبر JS */
    overflow: hidden;
    flex-direction: column;
    
    /* انيميشن احترافي - يبدأ مخفياً للأسفل */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#chat-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.dark #chat-window {
    background-image: url('https://placehold.co/400x600/111b21/111b21?text=');
    background-color: #111b21;
}

/* الهيدر بتصميم واتساب */
#chat-header {
    background-color: #075E54;
    /* شريط واتساب العلوي */
    color: white;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-header-info {
    display: flex;
    align-items: center;
}

#chat-status {
    color: #dcf8c6;
    /* لون "متصل" فاتح */
}

#chat-body {
    flex-grow: 1;
    padding: 10px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    /* لعرض الرسائل من الأسفل */
}

/* رسالة المستخدم */
.user-message {
    background-color: #dcf8c6;
    /* لون فقاعة المستخدم */
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px 8px 0 8px;
    /* شكل فقاعة واتساب */
    align-self: flex-end;
    margin-bottom: 8px;
    word-wrap: break-word;
    text-align: right;
    color: #000;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    position: relative;
    white-space: pre-wrap; /* للحفاظ على تنسيق الأسطر الجديدة */
}

/* رسالة الروبوت (أشجان) */
.bot-message {
    background-color: #fff;
    /* لون فقاعة الروبوت */
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 8px 8px 8px 0;
    /* شكل فقاعة واتساب */
    align-self: flex-start;
    margin-bottom: 8px;
    word-wrap: break-word;
    text-align: right;
    color: #000;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    position: relative;
    white-space: pre-wrap; /* للحفاظ على تنسيق الأسطر الجديدة */
}

.dark .bot-message {
    background-color: #202c33;
    color: #e9edef;
}

.dark .user-message {
    background-color: #005c4b;
    color: #e9edef;
}

/* منطقة الإدخال */
#chat-input-area {
    display: flex;
    padding: 10px;
    background: #f0f0f0;
    /* شريط إدخال فاتح */
    border-top: 1px solid #ddd;
}

.dark #chat-input-area {
    background: #1e2428;
    /* شريط إدخال داكن */
    border-top: 1px solid #262d31;
}

/* إخفاء النافذة على الأجهزة الأصغر حجماً (Mobile) - يجب إظهار زر الفتح فقط */
@media (max-width: 640px) {
    #chat-window {
        width: 90vw;
        height: 90vh;
        max-height: 90vh;
        left: 50%;
        bottom: 50%;
        transform: translate(-50%, 50%);
        border-radius: 12px;
    }
    
    #chat-window.open {
        transform: translate(-50%, 50%) scale(1); /* يتم توسيطه بالكامل */
        opacity: 1;
    }
}

/* تنسيق إظهار المزيد للمتحدثين (لضمان عمله بعد الإزالة السابقة) */
.hidden-speaker {
    display: none;
}