/* Wrapper اصلی چت‌بات */
#chat-support-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'IRANSans','Vazir',sans-serif;
  direction: rtl;
  overflow-anchor: none;
}

/* آیکون شناور */
#chat-icon {
  width: 56px;
  height: 56px;
  background: #007aff;
  color: #fff;
  font-size: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform .3s ease, background-color .3s ease;
  z-index: 10000;
}
#chat-icon:hover {
  transform: scale(1.1);
  background-color: #005ecb;
}

/* کانتینر چت: فلکس عمودی */
#chat-container {
  position: fixed;
  bottom: 15px;
  right: 20px;
  width: 410px;
  height: 520px;
  background: #fff;
  border-radius: 16px;          /* گوشه‌های گرد */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* سایه‌ی جزئی */
  font-family: 'IRANSans','sans-serif';
  display: flex;
  flex-direction: column;

  /* مخفی/نمایان */
  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .3s ease, opacity .3s ease, visibility .3s ease;
}
#chat-container.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* هدر چت */
#chat-header {
  border-radius: 15px;
  position: relative;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  flex: 0 0 auto;
}
#chat-close {
  font-size: 18px;
  cursor: pointer;
  color: #999;
}
.chat-info {
  text-align: right;
  flex-grow: 1;
  margin-right: 10px;
}
.chat-title {
  font-weight: bold;
  color: #111;
}
.chat-subtitle {
  font-size: 13px;
  color: #888;
}
.chat-avatar img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}


/* بدنه چت */
#chat-log {
  flex: 1 1 auto;
  height: 320px;
  overflow-y: auto;
  padding: 16px;
  background-color: #dfdfdf;
  direction: rtl;
  text-align: right;
  border-radius: 0 0 16px 16px; /* گرد کردن گوشه‌های پایین */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* حباب‌های پیام */
.bot-msg,
.user-msg {
  padding: 10px 14px;
  border-radius: 12px;
  margin: 6px 0;
  max-width: 85%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 14px;
  position: relative;
  line-height: 1.4;
  word-break: break-word;
}
.bot-msg {
  background: #fff;
  color: #333;
}
.user-msg {
  margin-left: auto;
  background: #007aff;
  color: #fff;
}
/* آیکون ربات کنار پیام */
.bot-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  position: absolute;
  top: -20px;
  right: 0;
}

/* فوتر چت */
#chat-footer {
  flex: 0 0 auto;
  border-top: 1px solid #ddd;
  background: #fff;
  position: relative;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.05);
}
#chat-input {
  border-radius: 15px;
  border: none;
  padding: 12px 16px;
  width: 100%;
  box-sizing: border-box;
  font-size: 14px;
  outline: none;
}
/* پنل ایموجی */
#emoji-picker {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #eee;
}
#emoji-picker .emoji {
  font-size: 20px;
  cursor: pointer;
  transition: transform .2s ease;
}
#emoji-picker .emoji:hover {
  transform: scale(1.2);
}

/* بسته‌بندی ورودی و دکمه */
#input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}

/* ورودی پیام */
#chat-input {
  flex: 1;
  border-radius: 15px;
  border: 1px solid #ddd;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

/* دکمه ارسال */
#chat-send {
  background: #007aff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background .2s ease, transform .2s ease;
}
#chat-send:hover {
  background: #005ecb;
  transform: scale(1.1);
}
#chat-send {
  display: inline-flex;        /* حتماً inline-flex یا flex */
  align-items: center;         /* تراز عمودی */
  justify-content: center;     /* تراز افقی */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  line-height: 1;              /* جلوگیری از اضافه‌شدن فضا */
  padding: 0;                  /* حذف padding اضافی */
}

/* در صورت نیاز می‌توانید اندازه آیکن را هم کمی بزرگ‌تر کنید */
#chat-send {
  font-size: 20px;             /* یا هر عدد دلخواه */
}
/* پالت کامل ایموجی با Emoji Button */
.emoji-picker {
  position: absolute;
  bottom: 56px;      /* بالای ورودی */
  left: 16px;
  z-index: 10001;
}

/* دکمه‌ی ایموجی */
#chat-emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  margin-right: 8px;
  padding: 4px;
  transition: transform .2s ease;
}
#chat-emoji-btn:hover {
  transform: scale(1.2);
}

/* بسته‌بندی ورودی پیام و دکمه‌های ارسال/ایموجی */
#input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
}
/* حفظ خطوط جدید (\n) در داخل حباب پیام */
.chat-bubble {
  white-space: pre-line;
  line-height: 1.6;
  font-size: 14px;
}

/* ورودی پیام */
#chat-input {
  flex: 1;
  border-radius: 15px;
  border: 1px solid #ddd;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
/* ==== افزایش فاصله بین پیام‌ها ==== */
.bot-msg,
.user-msg {
  margin: 12px 0;      /* فاصله عمودی بیشتر */
}

/* ==== تراز پیام‌ها ==== */
.bot-msg {
  margin-right: auto;  /* پاسخ ربات به سمت چپ */
}

.user-msg {
  margin-left: auto;   /* پیام کاربر به سمت راست */
}

/* در صورت نیاز می‌توانید مقدار 12px را به 10px یا 14px تغییر دهید */

/* دکمه ارسال */
#chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background .2s ease, transform .2s ease;
}
#chat-send:hover {
  background: #005ecb;
  transform: scale(1.1);
}
/* استایل آیتم‌های ایموجی */
#chat-emoji-picker .emoji-item {
  display: inline-block;
  font-size: 20px;
  margin: 4px;
  cursor: pointer;
  transition: transform .1s;
}
#chat-emoji-picker .emoji-item:hover {
  transform: scale(1.2);
}
/* ===== استایل هدر پاسخ ربات ===== */
.bot-msg .bot-header {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 8px 0px;
  border-bottom: 1px solid #eee;
  border-radius: 12px 12px 0 0;
  margin-bottom: 4px;
}

.bot-msg .bot-header .bot-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.bot-msg .bot-header .bot-name {
  margin-right: 8px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
}

/* حذف آواتار قدیمی */
.bot-msg .bot-avatar {
  display: none;
}

/* حباب پیام ربات گردی گوشه‌های پایین */
.bot-msg .chat-bubble {
  border-radius: 0 0 16px 16px;
  margin: 0;
}

/* غیرفعال کردن Scroll Anchoring کل صفحه */
html, body {
  overflow-anchor: none;
}
