/* ===== EHBC CHATBOT ===== */
:root {
  --chat-primary:   var(--gold, #8b6914);
  --chat-bg:        #ffffff;
  --chat-header-bg: var(--dark, #1a1a1a);
  --chat-user-bg:   var(--gold, #8b6914);
  --chat-bot-bg:    #f0ede8;
  --chat-shadow:    0 8px 40px rgba(0,0,0,0.18);
  --chat-radius:    16px;
}

/* FAB button */
.ehbc-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--chat-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 8000;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  border: none;
}
.ehbc-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.3); }
.ehbc-fab-active { transform: scale(0.95); }
.ehbc-fab-icon { font-size: 1.4rem; line-height: 1; transition: transform 0.2s; }
.ehbc-fab-active .ehbc-fab-icon { transform: rotate(20deg); }

/* Notification badge */
.ehbc-fab-badge {
  position: absolute; top: -3px; right: -3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #e53935; color: #fff;
  font-size: 0.7rem; font-weight: 700;
  align-items: center; justify-content: center;
  border: 2px solid #fff;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }

/* Chat window */
.ehbc-window {
  position: fixed;
  bottom: 92px; left: 24px;
  width: 360px; height: 520px;
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 7999;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  transform-origin: bottom left;
}
.ehbc-window.ehbc-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.ehbc-header {
  background: var(--chat-header-bg);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.ehbc-header-info { display: flex; align-items: center; gap: 10px; }
.ehbc-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--chat-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; flex-shrink: 0;
}
.ehbc-title    { color: #fff; font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.ehbc-subtitle { color: rgba(255,255,255,0.55); font-size: 0.75rem; margin-top: 1px; }
.ehbc-close {
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 1rem; cursor: pointer; padding: 4px 6px; border-radius: 4px;
  transition: color 0.2s, background 0.2s; line-height: 1;
}
.ehbc-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Messages area */
.ehbc-messages {
  flex: 1; overflow-y: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
  background: #faf8f4;
}
.ehbc-messages::-webkit-scrollbar { width: 4px; }
.ehbc-messages::-webkit-scrollbar-track { background: transparent; }
.ehbc-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Message bubbles */
.ehbc-msg { display: flex; max-width: 85%; }
.ehbc-msg-user { align-self: flex-end; flex-direction: row-reverse; }
.ehbc-msg-bot  { align-self: flex-start; }

.ehbc-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.88rem; line-height: 1.55;
  word-break: break-word;
}
.ehbc-msg-user .ehbc-bubble {
  background: var(--chat-user-bg);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.ehbc-msg-bot .ehbc-bubble {
  background: var(--chat-bot-bg);
  color: #2a2a2a;
  border-bottom-left-radius: 5px;
}

/* Thinking animation */
.ehbc-thinking .ehbc-bubble {
  display: flex; align-items: center; gap: 5px; padding: 12px 16px;
}
.ehbc-thinking .ehbc-bubble span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #aaa; display: inline-block;
  animation: chatDot 1.2s ease-in-out infinite;
}
.ehbc-thinking .ehbc-bubble span:nth-child(2) { animation-delay: 0.2s; }
.ehbc-thinking .ehbc-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatDot { 0%,80%,100%{transform:scale(0.6);opacity:0.5} 40%{transform:scale(1);opacity:1} }

/* Input area */
.ehbc-input-area {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #ede8df;
  background: #fff; flex-shrink: 0;
}
.ehbc-input {
  flex: 1; padding: 9px 13px;
  border: 1px solid #ddd; border-radius: 22px;
  font-size: 0.88rem; font-family: inherit; color: #2a2a2a;
  outline: none; transition: border-color 0.2s;
  background: #faf8f4;
}
.ehbc-input:focus { border-color: var(--chat-primary); background: #fff; }
.ehbc-send {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--chat-primary);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  transition: filter 0.2s, transform 0.15s;
}
.ehbc-send:hover  { filter: brightness(1.15); }
.ehbc-send:active { transform: scale(0.93); }
.ehbc-send:disabled { opacity: 0.5; cursor: default; }

/* Mobile */
@media (max-width: 480px) {
  .ehbc-window { width: calc(100vw - 24px); left: 12px; bottom: 84px; height: 70vh; max-height: 500px; }
  .ehbc-fab    { bottom: 18px; left: 18px; }
}
