/* ── AI Chat Widget ───────────────────────────────────────────────────────────── */

/* Hide reCAPTCHA badge — disclosure shown in chat footer per Google policy */
.grecaptcha-badge { visibility: hidden !important; }

.flamingo-chat-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid #b8956a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.flamingo-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.flamingo-chat-btn svg {
  width: 22px;
  height: 22px;
  stroke: #b8956a;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flamingo-chat-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b8956a;
  border: 2px solid #f8f6f2;
  pointer-events: none;
}

.flamingo-chat-panel {
  position: fixed;
  bottom: 84px;
  right: 24px;
  z-index: 9998;
  width: 360px;
  height: 500px;
  background: #fff;
  border: 1px solid #e0dbd4;
  border-top: 3px solid #b8956a;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.13);
  display: flex;
  flex-direction: column;
  font-family: "DM Sans", "Helvetica Neue", sans-serif;
  font-weight: 300;
  font-size: 14px;
  color: #1a1a1a;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.flamingo-chat-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.fc-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid #f0ebe4;
  flex-shrink: 0;
}
.fc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f8f6f2;
  border: 1px solid #b8956a;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b8956a;
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1;
}
.fc-header-text { flex: 1; min-width: 0; }
.fc-title { font-size: 13px; font-weight: 500; color: #1a1a1a; letter-spacing: 0.2px; }
.fc-status { font-size: 10px; color: #b8956a; letter-spacing: 0.9px; text-transform: uppercase; margin-top: 1px; }
.fc-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f8f6f2;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a8a8a8;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.fc-close:hover { background: #e0dbd4; color: #1a1a1a; }

.fc-suggestions {
  padding: 10px 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.fc-chip {
  font-size: 11px;
  padding: 5px 11px;
  border: 1px solid #e0dbd4;
  background: #faf9f7;
  color: #6b6b6b;
  cursor: pointer;
  border-radius: 14px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  font-weight: 300;
}
.fc-chip:hover { border-color: #b8956a; color: #1a1a1a; background: #fff; }

.fc-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
.fc-body::-webkit-scrollbar { width: 4px; }
.fc-body::-webkit-scrollbar-track { background: transparent; }
.fc-body::-webkit-scrollbar-thumb { background: #e0dbd4; border-radius: 2px; }
.fc-msg { display: flex; flex-direction: column; max-width: 85%; }
.fc-msg.ai { align-self: flex-start; }
.fc-msg.user { align-self: flex-end; }
.fc-bubble {
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
}
.fc-msg.ai .fc-bubble {
  background: #f8f6f2;
  color: #1a1a1a;
  border-left: 2px solid #b8956a;
}
.fc-msg.user .fc-bubble {
  background: #1a1a1a;
  color: #fff;
  align-self: flex-end;
}
.fc-time {
  font-size: 10px;
  color: #c5bcb3;
  margin-top: 3px;
  letter-spacing: 0.3px;
}
.fc-msg.user .fc-time { text-align: right; }

.fc-typing { align-self: flex-start; }
.fc-typing .fc-bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 10px 14px;
  background: #f8f6f2;
  border-left: 2px solid #b8956a;
}
.fc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b8956a;
  animation: fc-bounce 0.9s infinite ease-in-out;
}
.fc-dot:nth-child(2) { animation-delay: 0.15s; }
.fc-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes fc-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-5px); }
}

.fc-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #f0ebe4;
  flex-shrink: 0;
}
.fc-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #1a1a1a;
  outline: none;
  font-family: inherit;
  font-weight: 300;
  min-width: 0;
}
.fc-input::placeholder { color: #c5bcb3; }
.fc-send {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #1a1a1a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.fc-send:hover { background: #333; }
.fc-send:disabled { opacity: 0.4; cursor: not-allowed; }
.fc-send svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #b8956a;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fc-footer {
  padding: 5px 16px 9px;
  text-align: center;
  font-size: 10px;
  color: #c5bcb3;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .flamingo-chat-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
    border-top: 3px solid #b8956a;
  }
  .flamingo-chat-btn {
    bottom: 16px;
    right: 16px;
  }
}
