/* ─── WebBuilderHero Chat Widget ──────────────────────────────────────────── */
#wbh-chat-widget * { box-sizing: border-box; 
  /* margin: 0; 
  padding: 0;  */
}

#wbh-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ─── Toggle Button ──────────────────────────────────────────────────────── */
#wbh-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9c176, #c9973c);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(233,193,118,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
#wbh-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(233,193,118,0.55);
}
#wbh-chat-toggle svg { width: 26px; height: 26px; fill: #131313; }
#wbh-chat-toggle .wbh-close-icon { display: none; }

.wbh-notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  background: #e94560;
  border-radius: 50%;
  border: 2px solid #131313;
  display: none;
}

/* ─── reCAPTCHA badge — hidden per Google ToS (disclosure on contact page) ── */
.grecaptcha-badge { visibility: hidden !important; }

/* ─── Chat Window ────────────────────────────────────────────────────────── */
#wbh-chat-window {
  display: none;
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  height: 560px;
  background: #1c1c1c;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.55);
  flex-direction: column;
  overflow: hidden;
  animation: wbh-slide-up 0.22s ease-out;
  border: 1px solid rgba(255,255,255,0.08);
}
#wbh-chat-window.wbh-open { display: flex; }

@keyframes wbh-slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.wbh-header {
  background: linear-gradient(135deg, #1a1412, #2a1f10);
  padding: 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(233,193,118,0.15);
}
.wbh-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9c176, #c9973c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.wbh-header-info { flex: 1; }
.wbh-header-info h3 { font-size: 14px; font-weight: 600; color: #e5e2e1; margin-bottom: 2px; }
.wbh-header-info span {
  font-size: 11px;
  color: #9a8f80;
  display: flex;
  align-items: center;
  gap: 5px;
}
.wbh-online-dot {
  width: 7px;
  height: 7px;
  background: #4caf88;
  border-radius: 50%;
  display: inline-block;
}
.wbh-minimize-btn {
  background: none;
  border: none;
  color: #9a8f80;
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  transition: color 0.2s;
}
.wbh-minimize-btn:hover { color: #e5e2e1; }
.wbh-minimize-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ─── Messages ───────────────────────────────────────────────────────────── */
.wbh-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #141414;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.wbh-messages::-webkit-scrollbar { width: 3px; }
.wbh-messages::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

.wbh-msg {
  max-width: 82%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
}
.wbh-msg.wbh-bot {
  background: #252525;
  color: #d1c5b4;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid rgba(255,255,255,0.05);
}
.wbh-msg.wbh-user {
  background: linear-gradient(135deg, #e9c176, #c9973c);
  color: #131313;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  font-weight: 500;
}

/* Typing dots */
.wbh-typing { display: flex; gap: 5px; padding: 3px 0; }
.wbh-typing span {
  width: 7px; height: 7px;
  background: #9a8f80;
  border-radius: 50%;
  animation: wbh-bounce 1.3s infinite;
}
.wbh-typing span:nth-child(2) { animation-delay: 0.18s; }
.wbh-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes wbh-bounce {
  0%, 80%, 100% { transform: scale(1); opacity: 0.6; }
  40% { transform: scale(1.3); opacity: 1; }
}

/* Source tags */
.wbh-sources { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.wbh-source-tag {
  font-size: 10px;
  background: rgba(233,193,118,0.1);
  color: #e9c176;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── Quick Options ──────────────────────────────────────────────────────── */
.wbh-quick-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 12px;
  background: #1a1a1a;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.wbh-quick-opts button {
  background: transparent;
  border: 1px solid rgba(233,193,118,0.25);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s;
  color: #c9a85c;
  font-family: inherit;
  white-space: nowrap;
}
.wbh-quick-opts button:hover {
  background: rgba(233,193,118,0.12);
  border-color: rgba(233,193,118,0.5);
  color: #e9c176;
}

/* ─── Input Area ─────────────────────────────────────────────────────────── */
.wbh-input-area {
  padding: 12px 14px 14px;
  background: #1a1a1a;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 10px;
  align-items: center;
}
.wbh-input-area textarea {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 11px 18px;
  font-size: 13px;
  resize: none;
  max-height: 80px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #242424;
  color: #e5e2e1;
  line-height: 1.4;
}
.wbh-input-area textarea:focus { border-color: rgba(233,193,118,0.35); }
.wbh-input-area textarea::placeholder { color: #484848; }
.wbh-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9c176, #c9973c);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
}
.wbh-send-btn:hover { transform: scale(1.08); }
.wbh-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.wbh-send-btn svg { width: 16px; height: 16px; fill: #131313; }

/* ─── Open/minimized states ──────────────────────────────────────────────── */
#wbh-chat-widget.wbh-is-open #wbh-chat-toggle .wbh-chat-icon { display: none; }
#wbh-chat-widget.wbh-is-open #wbh-chat-toggle .wbh-close-icon { display: block; }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #wbh-chat-window {
    position: fixed;
    inset: 0;
    width: 100%;
    max-height: 100%;
    border-radius: 0;
    bottom: auto;
    right: auto;
  }
  #wbh-chat-widget { bottom: 16px; right: 16px; }
}
