/* ===================================================================
   Shivam Care Assistant — Patient Care Chatbot
   Palette matches the main site: deep blue + teal, Figtree type.
=================================================================== */

:root {
  --primary: #013f77;
  --primary-700: #012f5a;
  --ink: #0F1320;
  --accent: #00b3ac;
  --text: #334155;
  --muted: #64748B;
  --line: #E8EEF1;
  --bg: #FFFFFF;
  --bot-bubble: #F1F5F8;

  --r-md: 20px;
  --r-pill: 50px;

  --shadow-sm: 0 10px 30px rgba(12, 36, 52, 0.06);
  --shadow-md: 0 18px 44px rgba(12, 36, 52, 0.16);

  --font: 'Figtree', sans-serif;
}

/* ================= CHATBOT WIDGET ================= */
.chatbot-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  font-family: var(--font);
}

/* Floating action button */
.chatbot-fab {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  animation: chatbot-pulse 2.6s infinite;
}
.chatbot-fab-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #e0475c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
@keyframes chatbot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 179, 172, 0.35), var(--shadow-md); }
  70%  { box-shadow: 0 0 0 14px rgba(0, 179, 172, 0), var(--shadow-md); }
  100% { box-shadow: 0 0 0 0 rgba(0, 179, 172, 0), var(--shadow-md); }
}

/* Chat panel */
.chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.chatbot-widget.is-open .chatbot-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.chatbot-widget.is-open .chatbot-fab-badge { display: none; }

.chatbot-header {
  background: var(--primary);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chatbot-header-info { display: flex; align-items: center; gap: 12px; }
.chatbot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
}
.chatbot-header-info h6 { margin: 0; font-weight: 700; font-size: 15px; color: #fff; }
.chatbot-status {
  font-size: 12px;
  opacity: .85;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chatbot-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}
.chatbot-header-actions { display: flex; align-items: center; gap: 10px; }
.chatbot-call-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 14px;
}
.chatbot-close {
  border: none;
  background: transparent;
  color: #fff;
  opacity: .85;
  font-size: 15px;
  cursor: pointer;
}
.chatbot-close:hover { opacity: 1; }

.chatbot-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fbfcfd;
}
.chatbot-msg { display: flex; max-width: 86%; }
.chatbot-msg.bot { align-self: flex-start; }
.chatbot-msg.user { align-self: flex-end; }
.chatbot-msg .bubble {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}
.chatbot-msg.bot .bubble {
  background: var(--bot-bubble);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chatbot-msg.user .bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatbot-msg .bubble a { color: inherit; font-weight: 700; text-decoration: underline; }

.chatbot-typing .bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 13px 16px;
}
.chatbot-typing .bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  animation: chatbot-typing 1.2s infinite ease-in-out;
}
.chatbot-typing .bubble span:nth-child(2) { animation-delay: .15s; }
.chatbot-typing .bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes chatbot-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chatbot-quickreplies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}
.chatbot-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.chatbot-chip:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.chatbot-callbar {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px;
  flex-shrink: 0;
}
.chatbot-callbar-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 10px;
  border-radius: var(--r-pill);
  text-decoration: none;
}
.chatbot-callbar-btn--ghost {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--line);
}

.chatbot-inputbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.chatbot-inputbar input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 11px 16px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
}
.chatbot-inputbar input:focus { border-color: var(--accent); }
.chatbot-inputbar button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.chatbot-inputbar button:hover { background: var(--primary-700); }

@media (max-width: 420px) {
  .chatbot-widget { right: 14px; bottom: 14px; }
  .chatbot-panel { width: calc(100vw - 28px); bottom: 76px; }
}
