/* ===================================================================
   Chennai Web Design — Smart FAQ Chatbot widget
   Self-contained styling; reuses the site's CSS variables (see
   assets/css/style.css :root) so it stays on-brand automatically.
   =================================================================== */

.cwd-bot-launcher {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 1100;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: var(--grad-primary, linear-gradient(135deg,#16A34A,#4ADE80,#00C896));
  color: #fff;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(22,163,74,.4);
  transition: transform .25s ease, box-shadow .25s ease;
}
.cwd-bot-launcher:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 34px rgba(22,163,74,.5); }
.cwd-bot-launcher .cwd-bot-badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #FF5A5F; border: 2px solid #fff;
}
.cwd-bot-launcher .fa-xmark { display: none; }
.cwd-bot-launcher.open .fa-comment-dots { display: none; }
.cwd-bot-launcher.open .fa-xmark { display: inline-block; }

/* Give the WhatsApp float and back-to-top buttons room to breathe now
   that the chat launcher also lives in the bottom-right corner */
.whatsapp-float { right: 26px; bottom: 100px; }
.back-to-top { bottom: 178px; }

.cwd-bot-panel {
  position: fixed;
  right: 26px;
  bottom: 100px;
  z-index: 1099;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: var(--radius-lg, 24px);
  box-shadow: 0 24px 60px rgba(15,23,42,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  font-family: var(--font-body, 'Inter', sans-serif);
}
.cwd-bot-panel.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.cwd-bot-head {
  background: var(--grad-dark, linear-gradient(180deg,#0B1220,#111827));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cwd-bot-head-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad-primary, linear-gradient(135deg,#16A34A,#4ADE80));
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex-shrink: 0;
}
.cwd-bot-head-text h6 { margin: 0; font-family: var(--font-display,'Poppins',sans-serif); font-size: .95rem; color: #fff; }
.cwd-bot-head-text p { margin: 0; font-size: .74rem; color: #AEB9C9; display:flex; align-items:center; gap:5px; }
.cwd-bot-head-text p .dot { width:7px; height:7px; border-radius:50%; background:#4ADE80; display:inline-block; }
.cwd-bot-close { margin-left: auto; background: none; border: none; color: #AEB9C9; font-size: 1.1rem; cursor: pointer; padding: 4px; }
.cwd-bot-close:hover { color: #fff; }

.cwd-bot-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #F7F9FC;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cwd-bot-body::-webkit-scrollbar { width: 6px; }
.cwd-bot-body::-webkit-scrollbar-thumb { background: #D7DEE8; border-radius: 6px; }

.cwd-msg { max-width: 86%; display: flex; flex-direction: column; gap: 6px; }
.cwd-msg.bot { align-self: flex-start; }
.cwd-msg.user { align-self: flex-end; }

.cwd-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: .87rem;
  line-height: 1.5;
}
.cwd-msg.bot .cwd-msg-bubble { background: #fff; color: var(--dark,#111827); border: 1px solid var(--border,#E5EAF1); border-bottom-left-radius: 4px; }
.cwd-msg.user .cwd-msg-bubble { background: var(--primary,#16A34A); color: #fff; border-bottom-right-radius: 4px; }
.cwd-msg-bubble a { color: var(--primary,#16A34A); font-weight: 600; }
.cwd-msg.user .cwd-msg-bubble a { color: #fff; text-decoration: underline; }
.cwd-msg-bubble ul { margin: 4px 0 0; padding-left: 18px; }
.cwd-msg-bubble p { margin: 0 0 6px; }
.cwd-msg-bubble p:last-child { margin-bottom: 0; }

.cwd-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cwd-chip {
  background: #fff; border: 1px solid var(--border,#E5EAF1); color: var(--primary,#16A34A);
  font-size: .77rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.cwd-chip:hover { background: var(--primary,#16A34A); color: #fff; }

.cwd-typing { display: flex; gap: 4px; padding: 12px 14px; background: #fff; border: 1px solid var(--border,#E5EAF1); border-radius: 16px; border-bottom-left-radius: 4px; width: fit-content; }
.cwd-typing span { width: 6px; height: 6px; border-radius: 50%; background: #B9C2CE; animation: cwdTyping 1s infinite ease-in-out; }
.cwd-typing span:nth-child(2) { animation-delay: .15s; }
.cwd-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cwdTyping { 0%,60%,100%{ transform: translateY(0); opacity:.5; } 30%{ transform: translateY(-4px); opacity:1; } }

.cwd-bot-foot {
  flex-shrink: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--border,#E5EAF1);
  background: #fff;
  display: flex;
  gap: 8px;
  align-items: center;
}
.cwd-bot-foot input {
  flex: 1;
  border: 1px solid var(--border,#E5EAF1);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: .87rem;
  outline: none;
  font-family: inherit;
}
.cwd-bot-foot input:focus { border-color: var(--primary,#16A34A); }
.cwd-bot-foot button {
  flex-shrink: 0;
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--primary,#16A34A); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .95rem;
  transition: background .15s ease;
}
.cwd-bot-foot button:hover { background: var(--primary-dark,#116C36); }
.cwd-bot-foot-note { text-align:center; font-size:.68rem; color:#9AA5B1; padding: 2px 0 8px; background:#fff; }

@media (max-width: 480px) {
  .cwd-bot-panel { right: 12px; left: 12px; width: auto; bottom: 88px; }
  .cwd-bot-launcher { right: 16px; bottom: 16px; }
  .whatsapp-float { right: 16px; bottom: 82px; }
  .back-to-top { bottom: 144px; right: 16px; }
}
