/**
 * ngo-chatbot.css
 * -----------------------------------------------------------------------
 * Self-contained styles for the FAQ chat widget. Every selector is
 * prefixed `ngo-chatbot-` so this can be dropped into any page without
 * colliding with existing site styles or the announcement popup's
 * `ngo-announce-` classes. Launcher sits in the bottom-right corner; the
 * announcement popup is a centered modal (and its marquee sits at the
 * top of the page), so the two never overlap.
 * -----------------------------------------------------------------------
 */

.ngo-chatbot-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9998;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #c81c72;
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(58, 23, 41, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

.ngo-chatbot-launcher:hover {
  background: #9c1359;
}

.ngo-chatbot-launcher:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 3px;
}

.ngo-chatbot-launcher svg {
  width: 1.6rem;
  height: 1.6rem;
}

.ngo-chatbot-launcher.ngo-chatbot-is-open svg {
  width: 1.35rem;
  height: 1.35rem;
}

.ngo-chatbot-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 9998;
  width: min(340px, calc(100vw - 2.5rem));
  max-height: min(500px, calc(100vh - 7rem));
  background: #fff;
  border: 1px solid #f0d6e3;
  border-radius: 0.9rem;
  box-shadow: 0 14px 34px rgba(58, 23, 41, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  color: #3a1729;

  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.ngo-chatbot-panel.ngo-chatbot-is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .ngo-chatbot-panel {
    transition: none;
  }
}

@media (max-width: 26rem) {
  .ngo-chatbot-panel {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    bottom: 5rem;
  }
}

.ngo-chatbot-panel:focus {
  outline: none;
}

.ngo-chatbot-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  background: #5c1240;
  color: #fff;
  flex: none;
}

.ngo-chatbot-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #c81c72;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-weight: 800;
  font-size: 0.9rem;
}

.ngo-chatbot-header-title {
  font-weight: 800;
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
}

.ngo-chatbot-header-close {
  background: transparent;
  border: none;
  color: #fff;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  padding: 0;
}

.ngo-chatbot-header-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ngo-chatbot-header-close:focus-visible {
  outline: 3px solid #ffd9ec;
  outline-offset: 2px;
}

.ngo-chatbot-header-close svg {
  width: 1rem;
  height: 1rem;
}

.ngo-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: #fdf5f8;
}

.ngo-chatbot-msg {
  max-width: 84%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ngo-chatbot-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #f0d6e3;
  border-bottom-left-radius: 0.2rem;
}

.ngo-chatbot-msg-user {
  align-self: flex-end;
  background: #c81c72;
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

.ngo-chatbot-msg-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 700;
  font-size: 0.83rem;
  color: #9c1359;
  text-decoration: underline;
}

.ngo-chatbot-quick-replies {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.9rem 0.7rem;
  background: #fdf5f8;
}

.ngo-chatbot-quick-reply {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fff;
  border: 1.5px solid #c81c72;
  color: #9c1359;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.ngo-chatbot-quick-reply:hover {
  background: #fdeaf3;
}

.ngo-chatbot-quick-reply:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 2px;
}

.ngo-chatbot-form {
  flex: none;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #f0d6e3;
  background: #fff;
}

.ngo-chatbot-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #f0d6e3;
  border-radius: 999px;
  color: #3a1729;
}

.ngo-chatbot-input:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 1px;
}

.ngo-chatbot-send {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: #c81c72;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ngo-chatbot-send:hover {
  background: #9c1359;
}

.ngo-chatbot-send:focus-visible {
  outline: 3px solid #1f6f5c;
  outline-offset: 2px;
}

.ngo-chatbot-send svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ngo-chatbot-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Subtle "still here" pulse on the launcher when the chat is closed —
   a light, ongoing signal that the widget is interactive, not just a
   static icon. Stops the moment the panel opens, and is skipped
   entirely for reduced-motion users. */
@keyframes ngo-chatbot-pulse {
  0%,
  100% {
    box-shadow: 0 8px 20px rgba(58, 23, 41, 0.28), 0 0 0 0 rgba(200, 28, 114, 0.35);
  }
  50% {
    box-shadow: 0 8px 20px rgba(58, 23, 41, 0.28), 0 0 0 9px rgba(200, 28, 114, 0);
  }
}

.ngo-chatbot-launcher {
  animation: ngo-chatbot-pulse 2.6s ease-in-out infinite;
}

.ngo-chatbot-launcher.ngo-chatbot-is-open {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .ngo-chatbot-launcher {
    animation: none;
  }
}

/* Typing indicator bubble shown briefly while the bot "composes" a reply. */
.ngo-chatbot-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.85rem;
  background: #fff;
  border: 1px solid #f0d6e3;
  border-radius: 0.9rem;
  border-bottom-left-radius: 0.2rem;
}

.ngo-chatbot-typing span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #c81c72;
  opacity: 0.5;
  animation: ngo-chatbot-typing-bounce 1.1s ease-in-out infinite;
}

.ngo-chatbot-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.ngo-chatbot-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ngo-chatbot-typing-bounce {
  0%,
  60%,
  100% {
    opacity: 0.4;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ngo-chatbot-typing span {
    animation: none;
    opacity: 0.8;
  }
}
