/* MD Goatco Farm — FAQ chat widget (site-wide, loaded from layouts/public.php).
   Simple keyword-matched Q&A against admin-managed FAQs — a stand-in until
   a real support tool is in place. See public/js/faq-chat.js. */

.faq-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px -8px rgba(30, 63, 122, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  z-index: 900;
  transition: transform 0.15s ease, background 0.15s ease;
}
.faq-chat-launcher:hover {
  background: var(--blue-deep);
  transform: translateY(-2px);
}
.faq-chat-launcher .fa-comment-dots {
  display: block;
}
.faq-chat-launcher .fa-times {
  display: none;
}
.faq-chat-open .faq-chat-launcher .fa-comment-dots {
  display: none;
}
.faq-chat-open .faq-chat-launcher .fa-times {
  display: block;
}

.faq-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 44px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 24px 60px -16px rgba(20, 30, 55, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 900;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.faq-chat-open .faq-chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.faq-chat-header {
  background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue) 100%);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.faq-chat-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.faq-chat-header strong {
  display: block;
  font-size: 0.92rem;
}
.faq-chat-header span {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
}

.faq-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--off);
}
.faq-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.faq-chat-msg-bot {
  align-self: flex-start;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.faq-chat-msg-user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.faq-chat-msg-bot a {
  color: var(--blue);
  font-weight: 600;
}

.faq-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  background: var(--off);
  flex-shrink: 0;
}
.faq-chat-chip {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.76rem;
  color: var(--blue-deep);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.faq-chat-chip:hover {
  border-color: var(--blue);
  background: var(--blue-tint);
}

.faq-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}
.faq-chat-input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.84rem;
  font-family: var(--font-body);
  outline: none;
}
.faq-chat-input:focus {
  border-color: var(--blue);
}
.faq-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s ease;
}
.faq-chat-send:hover {
  background: var(--blue-deep);
}

@media (max-width: 480px) {
  .faq-chat-panel {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
  .faq-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
}

/* WhatsApp: floating button above the FAQ bubble, plus a "talk to a person" row inside the panel */
.wa-float {
  position: fixed;
  right: 22px;
  bottom: 92px;
  height: 52px;
  min-width: 52px;
  padding: 0 16px 0 14px;
  border-radius: 26px;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 26px -8px rgba(18, 140, 70, 0.6);
  z-index: 900;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.wa-float:hover { color: #fff; text-decoration: none; transform: translateY(-2px); }
.wa-float i { font-size: 1.6rem; }
.faq-chat-open .wa-float { opacity: 0; pointer-events: none; }
.faq-chat-human {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0fdf4;
  border-top: 1px solid #bbf7d0;
  color: #15803d;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
}
.faq-chat-human:hover { background: #dcfce7; color: #166534; text-decoration: none; }
.faq-chat-human i { font-size: 1.1rem; }
@media (max-width: 480px) {
  /* phones: compact round button so it never covers page content */
  .wa-float { right: 16px; bottom: 82px; width: 52px; padding: 0; justify-content: center; }
  .wa-float span { display: none; }
}
