/* AI Chatbot Pro - Frontend Widget */
#aicb-root * { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

/* ── Launcher ──────────────────────────────────────────────── */
.aicb-launcher {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 99999;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--aicb-primary, #6C63FF);
  color: #fff;
  border: none; border-radius: 50px;
  padding: 0 22px;
  height: 56px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
  transition: transform .2s, box-shadow .2s;
  font-size: 15px; font-weight: 600;
}
.aicb-launcher-circle {
  border-radius: 50%;
  width: 56px; height: 56px;
  padding: 0;
}
.aicb-launcher:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(108,99,255,0.45); }
.aicb-launcher-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.aicb-launcher-icon svg, .aicb-launcher-icon img { width: 24px; height: 24px; }
.aicb-launcher-text { white-space: nowrap; }
.aicb-pos-bottom-left  { right: auto !important; left: 24px; }
.aicb-pos-top-right    { bottom: auto !important; top: 24px; }
.aicb-pos-top-left     { bottom: auto !important; top: 24px; right: auto !important; left: 24px; }

/* ── Chat window ────────────────────────────────────────────── */
.aicb-window {
  position: fixed;
  bottom: 90px; right: 24px;
  z-index: 99998;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 580px;
  max-height: calc(100vh - 120px);
  background: var(--aicb-bg, #ffffff);
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.aicb-window.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }
.aicb-win-bottom-left { right: auto; left: 24px; }
.aicb-win-top-right   { bottom: auto; top: 90px; }
.aicb-win-top-left    { bottom: auto; top: 90px; right: auto; left: 24px; }

/* ── Header ─────────────────────────────────────────────────── */
.aicb-header {
  background: var(--aicb-primary, #6C63FF);
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.aicb-header-left { display: flex; align-items: center; gap: 12px; }
.aicb-header-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.aicb-header-avatar img { width: 100%; height: 100%; object-fit: cover; }
.aicb-avatar-initials { color: #fff; font-size: 15px; font-weight: 700; }
.aicb-header-name   { color: #fff; font-size: 15px; font-weight: 700; margin: 0; }
.aicb-header-status { color: rgba(255,255,255,0.85); font-size: 12px; display: flex; align-items: center; gap: 5px; }
.aicb-status-dot    { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
#aicb-header-close  {
  background: rgba(255,255,255,0.2); border: none; color: #fff; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; padding: 0; flex-shrink: 0;
}
#aicb-header-close:hover { background: rgba(255,255,255,0.35); }

/* ── Messages ────────────────────────────────────────────────── */
.aicb-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f8f7ff;
}
.aicb-messages::-webkit-scrollbar { width: 4px; }
.aicb-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.aicb-msg { display: flex; }
.aicb-msg-bot  { justify-content: flex-start; }
.aicb-msg-user { justify-content: flex-end; }
.aicb-bubble {
  max-width: 78%; padding: 11px 15px;
  border-radius: 16px; font-size: 14px; line-height: 1.55;
  word-break: break-word;
}
.aicb-msg-bot  .aicb-bubble { background: #fff; color: var(--aicb-text, #1a1a2e); border-radius: 4px 16px 16px 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.07); }
.aicb-msg-user .aicb-bubble { background: var(--aicb-primary, #6C63FF); color: #fff; border-radius: 16px 16px 4px 16px; }

/* ── Typing indicator ────────────────────────────────────────── */
.aicb-typing-bubble { display: flex; gap: 5px; align-items: center; padding: 13px 16px; }
.aicb-dot { width: 7px; height: 7px; border-radius: 50%; background: #bbb; animation: aicb-bounce .9s infinite; }
.aicb-dot:nth-child(2) { animation-delay: .15s; }
.aicb-dot:nth-child(3) { animation-delay: .30s; }
@keyframes aicb-bounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }

/* ── Quick replies ───────────────────────────────────────────── */
#aicb-quick-replies { padding: 8px 16px 0; display: flex; flex-wrap: wrap; gap: 8px; background: #f8f7ff; }
.aicb-quick-btn {
  background: #fff; border: 1.5px solid var(--aicb-primary, #6C63FF);
  color: var(--aicb-primary, #6C63FF); border-radius: 50px;
  padding: 6px 16px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.aicb-quick-btn:hover { background: var(--aicb-primary, #6C63FF); color: #fff; }

/* ── Action buttons ─────────────────────────────────────────── */
.aicb-action-btns-wrap { padding: 8px 16px; background: #f8f7ff; }
.aicb-action-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.aicb-action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 50px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: opacity .15s, transform .1s; border: none;
}
.aicb-action-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.aicb-action-booking  { background: var(--aicb-primary, #6C63FF); color: #fff; }
.aicb-action-whatsapp { background: #25D366; color: #fff; }
.aicb-action-contact  { background: #374151; color: #fff; }
.aicb-action-icon     { width: 18px; height: 18px; object-fit: contain; }

/* ── Contact form ───────────────────────────────────────────── */
.aicb-contact-form {
  background: #fff; border-radius: 12px; padding: 16px;
  margin: 8px 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 10px;
}
.aicb-contact-title { font-weight: 700; font-size: 14px; color: var(--aicb-text, #1a1a2e); margin: 0; }
.aicb-contact-input {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid #e2e5ef; border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color .15s;
}
.aicb-contact-input:focus { border-color: var(--aicb-primary, #6C63FF); }
.aicb-contact-textarea { min-height: 70px; resize: vertical; }
.aicb-contact-consent  { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #6b7280; cursor: pointer; }
.aicb-contact-consent input { margin-top: 2px; flex-shrink: 0; }
.aicb-contact-submit {
  background: var(--aicb-primary, #6C63FF); color: #fff;
  border: none; border-radius: 8px; padding: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s; width: 100%;
}
.aicb-contact-submit:hover { opacity: 0.9; }
.aicb-contact-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.aicb-hp { display: none !important; }

/* ── Input bar ───────────────────────────────────────────────── */
.aicb-input-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: var(--aicb-bg, #fff);
  border-top: 1px solid #f0eeff; flex-shrink: 0;
}
#aicb-input {
  flex: 1; border: 1.5px solid #e2e5ef; border-radius: 50px;
  padding: 10px 16px; font-size: 14px; outline: none;
  background: #f8f7ff; color: var(--aicb-text, #1a1a2e);
  transition: border-color .15s;
}
#aicb-input:focus { border-color: var(--aicb-primary, #6C63FF); background: #fff; }
#aicb-input::placeholder { color: #aaa; }
#aicb-input:disabled { opacity: 0.5; cursor: not-allowed; }
.aicb-send-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--aicb-primary, #6C63FF);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform .15s;
}
.aicb-send-btn:hover { transform: scale(1.08); }
.aicb-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Branding ────────────────────────────────────────────────── */
.aicb-branding { text-align: center; font-size: 11px; color: #aaa; padding: 6px; background: var(--aicb-bg, #fff); }
.aicb-branding a { color: #aaa; text-decoration: none; }

/* ── Lead form ───────────────────────────────────────────────── */
.aicb-lead-form-wrap { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; width: 100%; }
.aicb-lead-prompt    { font-size: 14px; color: var(--aicb-text, #1a1a2e); line-height: 1.5; }
.aicb-lead-input {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid #e2e5ef; border-radius: 10px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color .15s; background: #fff;
}
.aicb-lead-input:focus { border-color: var(--aicb-primary, #6C63FF); }
.aicb-lead-submit {
  padding: 11px 16px; width: 100%;
  background: var(--aicb-primary, #6C63FF); color: #fff;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.aicb-lead-submit:hover { opacity: 0.9; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .aicb-window { width: calc(100vw - 20px); right: 10px; bottom: 80px; height: calc(100vh - 100px); }
  .aicb-launcher { padding: 0 18px; height: 52px; font-size: 14px; }
  .aicb-launcher-circle { width: 52px; height: 52px; padding: 0; }
}
