#swcb-box,
#swcb-toggle,
#swcb-box * {
  box-sizing: border-box;
}

#swcb-toggle,
#swcb-box {
  font-family: inherit;
  /* پیروی از فونت قالب */
  direction: rtl;
}

#swcb-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--swcb-main-color);
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  font-size: 28px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, filter 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

#swcb-toggle:hover {
  filter: brightness(110%);
  transform: scale(1.05);
}

#swcb-box {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 340px;
  height: 480px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transform: scale(0.95);
  transform-origin: bottom right;
  opacity: 0;
  transition: all 0.25s ease-in-out;
  visibility: hidden;
}

#swcb-box.show {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
}

#swcb-header {
  background-color: var(--swcb-main-color);
  color: #fff;
  padding: 12px 15px;
  border-radius: 15px 15px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
}

#swcb-close {
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #fff;
  /* آیکون سفید */
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

#swcb-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

#swcb-log {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  background: #f7f9fc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 15px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background-color: var(--swcb-main-color);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.bot {
  align-self: flex-start;
  background: #E9ECEF;
  color: #343A40;
  border-bottom-left-radius: 4px;
}

#swcb-input {
  display: flex;
  border-top: 1px solid #dee2e6;
  background: #fff;
  border-radius: 0 0 15px 15px;
}

#swcb-input input {
  flex: 1;
  padding: 14px;
  border: none;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  background: transparent;
}

#swcb-input button {
  width: 55px;
  background-color: transparent;
  color: var(--swcb-main-color);
  border: none;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.2s ease;
  border-right: 1px solid #dee2e6;
}

#swcb-input button:hover {
  transform: scale(1.1);
}



/* استایل دکمه‌های پاسخ سریع */
#swcb-quick-replies {
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid #dee2e6;
  background: #fdfdfd;
}

#swcb-quick-replies button {
  background: #f0f0f1;
  border: 1px solid #d1d1d1;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  font-family: inherit;
  color: #333;
}

#swcb-quick-replies button:hover {
  background: var(--swcb-main-color);
  color: #fff;
  border-color: var(--swcb-main-color);
}



/* جدید: استایل برای پیام‌های چپ‌چین (انگلیسی) */
.chat-msg.ltr {
  direction: ltr;
  text-align: left;
}

/* اصلاح گوشه‌های گرد برای پیام‌های کاربر که چپ‌چین هستند */
.chat-msg.user.ltr {
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 4px;
}

/* جدید: استایل دکمه‌های پاسخ سریع */
#swcb-quick-replies {
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid #dee2e6;
  background: #fdfdfd;
}

#swcb-quick-replies button {
  background: #f0f0f1;
  border: 1px solid #d1d1d1;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  font-family: inherit;
  color: #333;
}

#swcb-quick-replies button:hover {
  background: var(--swcb-main-color);
  color: #fff;
  border-color: var(--swcb-main-color);
}