/* ─────────────────────────────────────────────
   Bhavwana Chatbot — Widget Styles
───────────────────────────────────────────── */
#bhav-root * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

/* ── Launcher ── */
#bhav-launcher {
  position: fixed; z-index: 99999;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #1a3c8f, #2f6bdf);
  border: none; cursor: pointer;
  box-shadow: 0 4px 20px rgba(30,80,200,.38);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
  color: #fff;
}
#bhav-launcher:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(30,80,200,.48); }
#bhav-launcher svg { width: 26px; height: 26px; }

#bhav-badge {
  position: absolute; top: -4px; right: -4px;
  background: #e84545; color: #fff; font-size: 10px; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ── Chat container ── */
#bhav-container {
  position: fixed; z-index: 99998;
  width: 380px; max-height: 640px;
  background: #fff; border-radius: 20px;
  box-shadow: 0 12px 48px rgba(20,50,140,.18), 0 2px 8px rgba(0,0,0,.08);
  display: flex; flex-direction: column; overflow: hidden;
  transform: scale(0.88) translateY(30px); opacity: 0; pointer-events: none;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), opacity .2s ease;
}
#bhav-container.open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

@media (max-width: 440px) {
  #bhav-container { width: calc(100vw - 20px); bottom: 90px !important; right: 10px !important; left: 10px !important; }
}

/* ── Header ── */
.bhav-header {
  padding: 16px 18px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, #1a3c8f 0%, #2f6bdf 100%);
}
.bhav-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.bhav-header-info h3 { color: #fff; font-size: 15px; font-weight: 600; }
.bhav-online { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.bhav-online-dot { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; animation: bhav-pulse 2s infinite; }
@keyframes bhav-pulse { 0%,100%{opacity:1}50%{opacity:.4} }
.bhav-online p { color: rgba(255,255,255,.75); font-size: 12px; }
.bhav-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.8); font-size: 22px; line-height: 1; padding: 4px;
  transition: color .15s;
}
.bhav-close:hover { color: #fff; }

/* ── Progress ── */
.bhav-progress { height: 3px; background: #eef0f8; flex-shrink: 0; }
.bhav-progress-fill { height: 100%; background: linear-gradient(90deg,#2f6bdf,#4ade80); transition: width .4s ease; width: 0%; }

/* ── Messages ── */
.bhav-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 260px; max-height: 400px; scroll-behavior: smooth;
}
.bhav-messages::-webkit-scrollbar { width: 4px; }
.bhav-messages::-webkit-scrollbar-thumb { background: #dde4f5; border-radius: 4px; }

.bhav-msg { max-width: 85%; display: flex; flex-direction: column; gap: 3px; animation: bhav-fadeUp .2s ease; }
@keyframes bhav-fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.bhav-msg.bot  { align-self: flex-start; }
.bhav-msg.user { align-self: flex-end; }
.bhav-msg-bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5;
}
.bhav-msg.bot  .bhav-msg-bubble { background: #f0f4ff; color: #1a2a5e; border-bottom-left-radius: 4px; }
.bhav-msg.user .bhav-msg-bubble { background: linear-gradient(135deg,#1a3c8f,#2f6bdf); color: #fff; border-bottom-right-radius: 4px; }
.bhav-msg-time { font-size: 10px; color: #aab; padding: 0 4px; }
.bhav-msg.user .bhav-msg-time { align-self: flex-end; }

/* ── Typing indicator ── */
.bhav-typing {
  display: flex; align-items: center; gap: 4px;
  padding: 10px 14px; background: #f0f4ff; border-radius: 16px;
  border-bottom-left-radius: 4px; width: fit-content;
}
.bhav-dot { width: 6px; height: 6px; background: #6a82c8; border-radius: 50%; animation: bhav-bounce 1.2s infinite; }
.bhav-dot:nth-child(2) { animation-delay: .2s; }
.bhav-dot:nth-child(3) { animation-delay: .4s; }
@keyframes bhav-bounce { 0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-5px)} }

/* ── Options ── */
.bhav-opts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.bhav-opt {
  background: #fff; border: 1.5px solid #c2d0f5; color: #1a3c8f;
  border-radius: 20px; padding: 7px 14px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.bhav-opt:hover { background: #1a3c8f; color: #fff; border-color: #1a3c8f; }
.bhav-opt:disabled { opacity: .5; cursor: default; }

/* ── Score card ── */
.bhav-score-card {
  margin: 4px 0; padding: 12px 14px;
  background: linear-gradient(135deg,#f0f4ff,#e8f0ff);
  border: 1px solid #c2d0f5; border-radius: 12px; font-size: 13px;
}
.bhav-score-card strong { color: #1a3c8f; display: block; margin-bottom: 6px; font-size: 14px; }
.bhav-score-row { display: flex; justify-content: space-between; margin: 3px 0; color: #445; }
.bhav-score-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: 700; font-size: 13px; margin-top: 8px; }
.bhav-hot  { background: #fee2e2; color: #991b1b; }
.bhav-warm { background: #fef3c7; color: #92400e; }
.bhav-cold { background: #dbeafe; color: #1e3a8a; }

/* ── Input area ── */
.bhav-input-area {
  padding: 12px 14px; border-top: 1px solid #eef0f8;
  display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0;
}
.bhav-text-input {
  flex: 1; border: 1.5px solid #dde4f5; border-radius: 12px;
  padding: 10px 14px; font-size: 14px; font-family: inherit;
  resize: none; outline: none; max-height: 90px; line-height: 1.4;
  transition: border-color .15s; color: #1a2a5e; background: #f8faff;
}
.bhav-text-input:focus { border-color: #2f6bdf; background: #fff; }
.bhav-text-input::placeholder { color: #aab; }
.bhav-text-input:disabled { opacity: .5; }
.bhav-send-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg,#1a3c8f,#2f6bdf);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: transform .15s, opacity .15s; color: #fff;
}
.bhav-send-btn:hover  { transform: scale(1.05); }
.bhav-send-btn:disabled { opacity: .5; cursor: default; }
.bhav-send-btn svg { width: 18px; height: 18px; }
