/* ReplyAIme live demo chat widget */

.raime-chat-launcher {
  position: fixed;
  bottom: 22px;
  inset-inline-end: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 10px 30px rgba(var(--shadow-color), 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: transform 0.25s var(--ease);
}
.raime-chat-launcher:hover { transform: scale(1.06); }
.raime-chat-launcher svg { width: 26px; height: 26px; }
.raime-chat-launcher .raime-icon-close { display: none; }
.raime-chat-launcher.is-open .raime-icon-chat { display: none; }
.raime-chat-launcher.is-open .raime-icon-close { display: block; }

.raime-chat-badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -4px;
  background: #E4544A;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  font-family: var(--font-body);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.raime-chat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-body);
}
html[dir="rtl"] .raime-chat-panel { font-family: var(--font-ar); }

.raime-chat-panel-floating {
  position: fixed;
  bottom: 94px;
  inset-inline-end: 22px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  box-shadow: 0 24px 60px rgba(var(--shadow-color), 0.28);
  z-index: 998;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.raime-chat-panel-floating.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.raime-chat-panel-inline {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 560px;
  margin: 0 auto;
  box-shadow: 0 30px 70px rgba(var(--shadow-color), 0.22);
}

.raime-chat-header {
  padding: 16px 18px;
  background: var(--text);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.raime-chat-header .raime-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #4ADE80;
  flex-shrink: 0;
}
.raime-chat-header-text { flex: 1; min-width: 0; }
.raime-chat-header-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  margin: 0;
}
.raime-chat-header-sub {
  font-size: 0.75rem;
  opacity: 0.72;
  margin: 2px 0 0;
}

.raime-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--base);
}

.raime-msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.raime-msg-bot {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
html[dir="rtl"] .raime-msg-bot { border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.raime-msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
html[dir="rtl"] .raime-msg-user { align-self: flex-start; border-bottom-right-radius: 14px; border-bottom-left-radius: 4px; }

.raime-msg-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 11px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.raime-msg-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-soft);
  animation: raime-bounce 1.1s infinite ease-in-out;
}
.raime-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.raime-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes raime-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.raime-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.raime-chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 15px;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  background: var(--base);
  color: var(--text);
}
.raime-chat-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.raime-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.raime-chat-send:disabled { opacity: 0.5; cursor: default; }
.raime-chat-send svg { width: 16px; height: 16px; }
html[dir="rtl"] .raime-chat-send svg { transform: scaleX(-1); }

.raime-chat-footer {
  padding: 7px 16px 10px;
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-soft);
  background: var(--surface);
}

@media (max-width: 480px) {
  .raime-chat-panel {
    inset-inline-end: 16px;
    bottom: 88px;
    width: calc(100vw - 32px);
  }
  .raime-chat-launcher { inset-inline-end: 16px; bottom: 16px; }
}
