/* WS AI Chatbot v1.2 — premium Tidio-style design (WebSergeon navy/gold) */
#ws-chatbot-root, #ws-chatbot-root * { box-sizing: border-box; }
#ws-chatbot-root {
  position: fixed; z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Panel ---------- */
#ws-cb-panel {
  position: fixed; right: 24px; bottom: 100px;
  width: 390px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 140px);
  background: #fff; border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 28px 80px rgba(10,1,24,.45);
  border: 1px solid rgba(10,1,24,.1);
  transform-origin: bottom right;
}
#ws-cb-panel:not(.ws-cb-hidden) { animation: ws-cb-in .32s cubic-bezier(.2,.9,.3,1.15); }
@keyframes ws-cb-in {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}
#ws-cb-panel.ws-cb-hidden { display: none; }

/* ---------- Premium header ---------- */
#ws-cb-header {
  background: linear-gradient(150deg, #2b1354 0%, #12041f 60%, #0A0118 100%);
  padding: 0; flex: 0 0 auto; position: relative; overflow: hidden;
}
#ws-cb-header::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 70% at 85% -10%, rgba(252,208,59,.22), transparent 60%);
  pointer-events: none;
}
.ws-cb-headtop {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px 12px 16px; position: relative;
}
.ws-cb-brand { display: flex; align-items: center; gap: 12px; }
.ws-cb-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto;
  overflow: hidden; border: 2.5px solid #FCD03B;
  box-shadow: 0 3px 14px rgba(252,208,59,.4); background: #1c0b33;
  position: relative;
}
.ws-cb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-cb-avatar .ws-cb-online {
  position: absolute; bottom: 1px; right: 1px; width: 13px; height: 13px;
  border-radius: 50%; background: #25d366; border: 2.5px solid #160a2a;
}
.ws-cb-titlewrap { display: flex; flex-direction: column; gap: 1px; }
.ws-cb-chatwith { color: rgba(255,255,255,.65); font-size: 12px; }
.ws-cb-title { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.ws-cb-headbtns { display: flex; gap: 6px; }
.ws-cb-hbtn {
  background: #fff; border: none; color: #111;
  width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.ws-cb-hbtn:hover { background: #e6e6e6; }
.ws-cb-onlinebar {
  position: relative; margin: 0; padding: 9px 16px;
  background: linear-gradient(90deg, rgba(252,208,59,.16), rgba(252,208,59,.05));
  border-top: 1px solid rgba(252,208,59,.25);
  color: #fff; font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px;
}
.ws-cb-onlinebar i {
  width: 8px; height: 8px; border-radius: 50%; background: #25d366;
  box-shadow: 0 0 8px #25d366; animation: ws-cb-blinkdot 2s infinite;
}
@keyframes ws-cb-blinkdot { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- Messages ---------- */
#ws-cb-messages { flex: 1 1 auto; overflow-y: auto; padding: 18px 14px 10px; background: #f7f5f0; }
#ws-cb-messages::-webkit-scrollbar { width: 6px; }
#ws-cb-messages::-webkit-scrollbar-thumb { background: #d8d2c0; border-radius: 3px; }
.ws-cb-msg { margin-bottom: 10px; display: flex; align-items: flex-end; gap: 8px; }
.ws-cb-bot { justify-content: flex-start; }
.ws-cb-user { justify-content: flex-end; }
.ws-cb-ava {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
  border: 2px solid #FCD03B; background: #1c0b33;
}
.ws-cb-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ws-cb-bubble {
  max-width: 78%; padding: 11px 15px; border-radius: 18px;
  font-size: 14px; line-height: 1.5; word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.ws-cb-bot .ws-cb-bubble {
  background: #fff; color: #262626;
  border: 1px solid #ece7d8; border-bottom-left-radius: 6px;
}
.ws-cb-user .ws-cb-bubble {
  background: linear-gradient(135deg, #2b1354, #0A0118); color: #fff;
  border-bottom-right-radius: 6px;
}
.ws-cb-bubble a { color: #0a58ca; text-decoration: underline; }
.ws-cb-user .ws-cb-bubble a { color: #FCD03B; }

/* typing indicator */
.ws-cb-dots { display: inline-flex; align-items: center; gap: 5px; padding: 5px 3px; }
.ws-cb-dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b9b2a0; animation: ws-cb-blink 1.2s infinite;
}
.ws-cb-dots i:nth-child(2) { animation-delay: .2s; }
.ws-cb-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ws-cb-blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Rich cards ---------- */
.ws-cb-cards { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 12px 40px; max-width: 82%; }
.ws-cb-card {
  background: #fff; border: 1px solid #ece7d8; border-radius: 16px; overflow: hidden;
  box-shadow: 0 3px 14px rgba(10,1,24,.1);
}
.ws-cb-card img.ws-cb-cardimg { width: 100%; height: 110px; object-fit: cover; display: block; }
.ws-cb-cardbody { padding: 12px 14px 14px; }
.ws-cb-cardtitle { font-weight: 700; font-size: 14px; color: #0A0118; margin-bottom: 4px; }
.ws-cb-carddesc { font-size: 12.5px; color: #6b6558; line-height: 1.45; margin-bottom: 10px; }
.ws-cb-cardbtn {
  display: block; width: 100%; text-align: center;
  background: linear-gradient(135deg, #FCD03B, #eda12c); color: #0A0118 !important;
  font-weight: 700; font-size: 13px; padding: 9px 0; border-radius: 10px;
  border: none; cursor: pointer; text-decoration: none !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.ws-cb-cardbtn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(252,208,59,.5); }

/* ---------- Quick replies (in-panel navy chips) ---------- */
#ws-cb-quick { flex: 0 0 auto; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px; background: #f7f5f0; }
#ws-cb-quick:empty { display: none; }
.ws-cb-chip {
  background: #0A0118 !important; border: none !important; color: #fff !important;
  border-radius: 20px; padding: 8px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
  box-shadow: 0 2px 8px rgba(10,1,24,.25);
  transition: all .18s ease;
}
.ws-cb-chip:hover { background: #FCD03B; color: #0A0118; transform: translateY(-1px); }

/* ---------- Proactive teaser above the floating button ---------- */
#ws-cb-teaser {
  position: fixed; right: 24px; bottom: 24px; z-index: 999998;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  animation: ws-cb-teaser-in .45s ease;
}
#ws-cb-teaser.ws-cb-hidden { display: none; }
#ws-cb-teaser.ws-cb-min #ws-cb-teaser-close,
#ws-cb-teaser.ws-cb-min .ws-cb-tbubble { display: none; }
@keyframes ws-cb-teaser-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
#ws-cb-teaser-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff !important; border: none !important;
  font-size: 18px; cursor: pointer; color: #444 !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.22); margin-bottom: 2px; padding: 0;
  display: flex; align-items: center; justify-content: center; line-height: 1;
  font-family: inherit;
}
.ws-cb-tbubble {
  background: #ffffff !important; color: #23233a !important; border: none !important; border-radius: 999px;
  padding: 11px 24px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 3px 12px rgba(10,1,24,.14);
  transition: transform .18s ease, box-shadow .18s ease;
  font-family: inherit;
}
.ws-cb-tbubble:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(10,1,24,.2); }
.ws-cb-tcta {
  display: inline-flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #16345f 0%, #0A0118 70%) !important; color: #fff !important;
  border: 1.5px solid rgba(252,208,59,.55) !important; border-radius: 999px;
  padding: 7px 7px 7px 26px; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(10,1,24,.35);
  transition: transform .18s ease, box-shadow .18s ease;
  font-family: inherit;
}
.ws-cb-tcta img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid #FCD03B; display: block; pointer-events: none; }
.ws-cb-tcta:hover { transform: translateY(-1px) scale(1.02); box-shadow: 0 8px 24px rgba(10,1,24,.42); }

/* ---------- Appointment booking confirmation card ---------- */
.ws-cb-bookcard {
  background: #fff; border: 1px solid #ece7d8; border-left: 4px solid #FCD03B;
  border-radius: 12px; padding: 12px 14px; box-shadow: 0 3px 10px rgba(10,1,24,.08);
  max-width: 88%;
}
.ws-cb-bookcard h4 { margin: 0 0 6px; font-size: 13px; color: #0A0118; letter-spacing: .3px; }
.ws-cb-bkrow { display: flex; justify-content: space-between; gap: 14px; font-size: 12.5px; padding: 3px 0; color: #5a5a6e; }
.ws-cb-bkrow b { color: #0A0118; text-align: right; font-weight: 700; }

/* ---------- Input row ---------- */
#ws-cb-inputrow {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: #fff; border-top: 1px solid #ece7d8;
}
#ws-cb-input {
  flex: 1; border: 1.5px solid #ddd6c2; border-radius: 24px;
  padding: 11px 16px; font-size: 14px; outline: none; font-family: inherit;
  background: #faf9f5; transition: border-color .2s ease, box-shadow .2s ease;
}
#ws-cb-input:focus { border-color: #0A0118; background: #fff; box-shadow: 0 0 0 3px rgba(10,1,24,.06); }

/* ---------- v2.2.3: mic button, WhatsApp header button, quote card ---------- */
#ws-cb-mic {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  background: #f1ede2; border: none; cursor: pointer; color: #0A0118;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s ease, color .18s ease;
}
#ws-cb-mic:hover { background: #e9e2cf; }
#ws-cb-mic.ws-cb-listening {
  background: #e33535; color: #fff;
  animation: ws-cb-pulse 1.1s ease-out infinite;
}
@keyframes ws-cb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(227,53,53,.35); }
  100% { box-shadow: 0 0 0 12px rgba(227,53,53,0); }
}
.ws-cb-hbtn.ws-cb-wabtn { color: #25d366; }
.ws-cb-hbtn.ws-cb-wabtn:hover { background: rgba(37,211,102,.18); }
.ws-cb-quote h4 {
  margin: 0 0 8px; font-size: 14px; color: #0A0118; letter-spacing: .4px;
}
.ws-cb-qprice {
  font-size: 22px; font-weight: 800; color: #0A0118; margin-bottom: 6px;
}
.ws-cb-qprice span { font-size: 13px; font-weight: 600; color: #8a8474; }
.ws-cb-quote p { margin: 0; font-size: 12.5px; color: #6b6558; }
#ws-cb-send {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, #FCD03B, #eda12c); color: #0A0118;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(252,208,59,.45);
  transition: transform .18s ease, box-shadow .18s ease;
}
#ws-cb-send:hover { transform: scale(1.08) rotate(-8deg); box-shadow: 0 6px 18px rgba(252,208,59,.6); }
#ws-cb-send:active { transform: scale(.96); }

/* ---------- Footer ---------- */
#ws-cb-foot {
  flex: 0 0 auto; text-align: center; padding: 8px 0 10px;
  font-size: 10.5px; color: #b3ad9c; background: #fff; letter-spacing: 1.2px;
  border-top: 1px solid #f0ece0; font-weight: 600;
}
#ws-cb-foot b { color: #0A0118; }

/* ---------- Mobile: compact panel that never slides under the site header ---------- */
@media (max-width: 480px) {
  #ws-cb-panel {
    right: 12px; bottom: 92px; width: calc(100vw - 24px);
    height: min(560px, calc(100vh - 200px));   /* fallback */
    height: min(560px, calc(100dvh - 200px));  /* leaves room for header + teaser */
    border-radius: 20px;
  }
  #ws-cb-teaser { right: 16px; bottom: 18px; }
  .ws-cb-tcta img { width: 36px; height: 36px; }
  #ws-cb-tip { display: none; }
  .ws-cb-cards { margin-left: 0; max-width: 92%; }
  .ws-cb-bubble { font-size: 13.5px; }
  #ws-cb-messages { padding: 14px 12px; }
  #ws-cb-inputrow { padding: 8px 10px; }
  #ws-cb-foot { font-size: 9.5px; padding: 6px 0 8px; }
  /* Quick-reply chips: smaller + single line on mobile */
  #ws-cb-quick { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 8px 10px; scrollbar-width: none; }
  #ws-cb-quick::-webkit-scrollbar { display: none; }
  .ws-cb-chip { flex: 0 0 auto; font-size: 11.5px; padding: 6px 12px; border-radius: 16px; white-space: nowrap; }
}

/* ---------- v2.2.5: bulletproof header buttons (beat any stale combined CSS) ---------- */
#ws-cb-panel .ws-cb-headbtns .ws-cb-hbtn { background: #fff !important; color: #111 !important; }
#ws-cb-panel .ws-cb-headbtns .ws-cb-hbtn:hover { background: #e6e6e6 !important; }
#ws-cb-panel .ws-cb-headbtns .ws-cb-hbtn.ws-cb-wabtn { color: #25d366 !important; }
#ws-cb-panel .ws-cb-headbtns .ws-cb-hbtn.ws-cb-wabtn:hover { background: rgba(37,211,102,.18) !important; }
