/* ── Bandicoot Chatbot v1.1 ─────────────────────────────────── */

#bbc-widget {
  position: fixed;
  bottom: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#bbc-widget.bbc-pos-right { right: 24px; }
#bbc-widget.bbc-pos-left  { left: 24px; }

/* ── Bubble ─────────────────────────────────────────────────── */
#bbc-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--bbc-primary);
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: transform .2s, background .2s;
  position: relative;
}
#bbc-bubble:hover { transform: scale(1.08); background: var(--bbc-accent); }

#bbc-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e53e3e;
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Panel ──────────────────────────────────────────────────── */
#bbc-panel {
  width: 340px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  margin-bottom: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 520px;
}

/* ── Header ─────────────────────────────────────────────────── */
#bbc-header {
  background: var(--bbc-primary);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
#bbc-avatar {
  font-size: 22px;
  width: 38px; height: 38px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#bbc-header-info { flex: 1; }
#bbc-header-info strong { display: block; font-size: 14px; }
#bbc-header-info span   { font-size: 11px; opacity: .85; }

/* WhatsApp icon button in header */
#bbc-wa-header-btn {
  color: #fff;
  opacity: .9;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity .2s;
  text-decoration: none;
}
#bbc-wa-header-btn:hover { opacity: 1; }

/* ── Messages ────────────────────────────────────────────────── */
#bbc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f5f5f5;
}

.bbc-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}
.bbc-msg-bot {
  background: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.bbc-msg-user {
  background: var(--bbc-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* ── Lead form ───────────────────────────────────────────────── */
#bbc-lead-form {
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
#bbc-lead-form input,
#bbc-lead-form textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  box-sizing: border-box;
  font-family: inherit;
  resize: none;
}
#bbc-lead-form input:focus,
#bbc-lead-form textarea:focus {
  outline: none;
  border-color: var(--bbc-primary);
}
#bbc-lead-submit {
  background: var(--bbc-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
#bbc-lead-submit:hover { background: var(--bbc-accent); }

/* ── WhatsApp bar ────────────────────────────────────────────── */
#bbc-wa-bar {
  background: #f0faf0;
  border-top: 1px solid #d4edda;
  padding: 9px 14px;
  display: flex;
  justify-content: center;
}
#bbc-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, transform .15s;
  box-shadow: 0 2px 8px rgba(37,211,102,.3);
}
#bbc-wa-btn:hover {
  background: #1da855;
  transform: translateY(-1px);
  color: #fff;
}

/* ── Input bar ───────────────────────────────────────────────── */
#bbc-inputbar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #eee;
  align-items: center;
}
#bbc-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}
#bbc-input:focus { border-color: var(--bbc-primary); }
#bbc-send {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bbc-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
#bbc-send:hover { background: var(--bbc-accent); }

/* ── Footer note ─────────────────────────────────────────────── */
#bbc-footer-note {
  text-align: center;
  font-size: 10.5px;
  color: #aaa;
  padding: 4px 0 7px;
  background: #fff;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 400px) {
  #bbc-panel { width: calc(100vw - 32px); }
  #bbc-widget.bbc-pos-right { right: 16px; }
  #bbc-widget.bbc-pos-left  { left: 16px; }
}
