 
 @font-face {
  font-family: "IBM Plex Sans";
  src: url("./fonts/IBMPlexSansArabic-Medium.ttf")
 }
   

/* ===========================
   🟩 صندوق الشات الرئيسي
=========================== */
#chat-widget {
  width: 420px;
  height: 600px;
  position: fixed;
  right: 28px;
  bottom: 70px;
  border-radius: 18px;
  background: #ffffff;
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 26px rgba(0,0,0,0.22);
  overflow: hidden;
  resize: both;
  z-index: 9999;
  transition: all 0.2s ease;
}

.avatar_image
{
      background-color: #fff;
    display: flex;
    align-items: normal;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-top: 8px;
}
.avatar_image img{
      direction: rtl;
    right: 0;
    left: 0;
    float: right;
    width: auto;
    height: auto;
    padding: 3px;
    border-radius: 50%;
    position: relative;
}
/* ===========================
   🟦 الهيدر — مكبّر حسب طلبك
=========================== */
#chat-header {
    background-color: #1b8354;
  color: #fff;
  padding: 12px 14px;   /* كان 6px 10px — الآن أكبر */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: grab;
  user-select: none;
}

.header-title {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  flex-grow: 2;
  min-width: 0;
  max-width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

#chat-header button {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
   font-family: inherit;
  padding: 0;
}

/* زر تسجيل الخروج */
.logout-btn {
  width: auto !important;
  padding: 2px 10px !important;
  font-size: 14px !important;
  font-weight: 700;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   🟨 شريط الخدمة
=========================== */
#service-bar {
  display: none;
  background: #e9f6f0;
  border-bottom: 1px solid #cfe9dc;
  padding: 7px 10px;
}

#service-title {
  font-size: 14px;
  font-weight: 700;
  color: #0b5f3c;
}

#cancel-service {
  background: #c0392b;
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ===========================
   🟧 الرسائل
=========================== */
#chat-messages {
  flex: 1;
  padding: 10px;
  padding-bottom: 45px; /* كان 60px — الآن أقرب لمربع الإدخال */
  overflow-y: auto;
  background: #f5fbf8;
}

.message {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 90%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}

.user {
  background: #e6f4ee;
  margin-left: auto;
}

.bot {
  background: #ffffff;
  margin-right: auto;
  border: 1px solid #dfeee8;
}

.bot.success {
  background: #e9f6f0;
  border-right: 5px solid #0b5f3c;
}

/* الروابط داخل الرسائل */
.message a {
  color: #0b5f3c;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid #0b5f3c;
  padding-bottom: 2px;
  transition: 0.2s;
}

/* ===========================
   🟪 الخيارات — 2×2
=========================== */
#options {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.option-btn {
  padding: 8px 4px;
    background-color: #1b8354;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-weight: 400;
}

/* ===========================
   🟥 الإدخال — مصغّر ليظهر زر الإرسال
   (تم تعديل هذه الأقسام فقط لعرض "إرسال" كامل)
=========================== */
.chat-input {
  display: flex;
  border-top: 1px solid #cfe9dc;
  padding: 2px 3px;     /* كان 0px 2px — الآن أريح وأقصر */
  gap: 3px;
  background: #ffffff;
  align-items: center;
  min-height: 24px;     /* كان 26px — الآن أقل عموديًا */
}

.chat-input input {
  flex: 1;
  padding: 4px 6px;     /* تم زيادة بسيطة للراحة لكن بدون طغيان على الزر */
  font-size: 13px;      /* حجم خط مناسب يظهر النص بدون زيادة ارتفاع مبالغ */
  border: none;
  border-radius: 6px;
  background: #ffffff;
    font-family: inherit;
  font-weight: 400;
}
.chat-input input:focus,
.chat-input input:focus-visible,
.chat-input input:focus{
    outline: unset;
    box-shadow: unset;
}
/* زر الصوت */
.voice-btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  border: none;
  border-radius: 6px;
  background: #ffffff;
  color: #0b5f3c;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}

/* زر الإرسال */
.chat-input button {
      background-color: #1b8354;
  color: white;
  border: none;
  font-size: 16px;      /* كان 16px — تناسق أفضل مع الارتفاع الجديد */
  font-weight: 700;
  cursor: pointer;
  min-width: 56px;      /* كافٍ لعرض "إرسال" بالكامل */
  height: 34px;         /* متناسق مع input */
  border-radius: 6px;
  padding: 0 10px;
    font-family: inherit;
 
}

/* ===========================
   💬 أيقونة الفتح
=========================== */
#minimized-widget {
  width: 66px;
  height: 66px;
  border-radius: 50%;
    background-color: #1B8354;
  position: fixed;
  right: 28px;
  bottom: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  z-index: 9999;
}

/* ===========================
   🌙 الوضع الليلي
=========================== */
body.dark #chat-widget { background: #1f1f1f; color: white; }
body.dark #chat-messages { background: #2a2a2a; }
body.dark .bot { background: #2f2f2f; color: white; border-color: #444; }
body.dark .user { background: #0b5f3c; color: white; }
body.dark .chat-input { background: #2a2a2a; }
body.dark .chat-input input { background: #2f2f2f; color: white; }
body.dark .voice-btn { background: #3a3a3a; color: #0b5f3c; }
body.dark .chat-input button { background-color: #0b5f3c; }
body.dark .option-btn { background: #0b5f3c; }
body.dark .option-btn:hover { background: #094a30; }

/* ===========================
   🔊 فقاعة الصوت
=========================== */
.audio-message {
  background: #eef3ff;
  padding: 12px 15px;
  border-radius: 16px;
  margin: 10px 0;
  width: fit-content;
  max-width: 80%;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
  border: 1px solid #d6e2ff;
}

.audio-message .play-audio {
  background: #4a6cf7;
  color: white;
  border: none;
  padding: 7px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: 0.2s;
}

.audio-message .play-audio:hover {
  background: #3a57d0;
}

/* ===========================
   📱 استجابة الشاشات الصغيرة
=========================== */
@media (max-width: 480px) {
  #chat-widget {
    right: 12px;
    left: 12px;
    width: auto;
    height: 70vh;
    bottom: 80px;
  }

  #minimized-widget {
    right: 12px;
  }

  #chat-header .header-title {
    max-width: 220px;
  }
}

/* ===========================
   ✅ تحسين عرض نتائج الخدمات (آمن)
=========================== */
.bot {
  line-height: 1.85;
}

.bot strong {
  font-weight: 800;
}

.bot br {
  line-height: 2;
}
