body {
  font-family: "Comic Neue", cursive;
}

#chat-launcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 125px;
  margin-bottom: 35px;
  z-index: 9999;
}

/* Floating button */
#chat-button {
  position: fixed;      /* THIS keeps it floating */
  bottom: 20px;         /* distance from bottom */
  right: 50px;          /* distance from right */
  width: 85px;          /* adjust size here */
  height: 85px;         /* adjust size here */
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s ease;
}

#chat-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#chat-button
:hover {
  filter: drop-shadow(0 0 5px rgba(236, 146, 9, 0.836));
  transform: scale(1.05);
  transition: 0.3s ease;
}

#chat-teaser {
  background: #ffffff;
  color: #222;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #e3e3e3;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  max-width: 220px;
  font-size: 0.9rem;
  line-height: 1.4;
  position: relative;
  animation: fadeInUp 0.4s ease;
}

/* Bubble tail pointing to icon */
#chat-teaser::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 14px;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-right: 1px solid #e3e3e3;
  border-bottom: 1px solid #e3e3e3;
  transform: rotate(-45deg);
}

.hidden {
  display: none;
}

/* Chat window */
#chat-widget {
  position: fixed;
  margin-bottom: 35px;
  bottom: 80px;
  right: 50px;
  width: 475px;
  height: 750px;
  background: linear-gradient(to right, #9ce8ac, #d9fbd9 );
  background: #9ce8ac;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  transform-origin: bottom right;
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), opacity 0.3s ease;
}

#chat-widget.hidden {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

#chat-widget:not(.hidden) {
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

/* Header */
#chat-header {
  background: linear-gradient(to right, #7aa77c, #6ea87a, #a1b8a1);
  background: #7aa77c;
  color: white;
  padding: 10px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}

#close-chat {
  cursor: pointer;
  font-weight: bold;
  padding-left: 10px;
}

#close-chat:hover {
    filter: drop-shadow(0 0 5px rgba(236, 146, 9, 0.836));
    transform: scale(1.05);
    transition: 0.3s ease;
}

/* Messages */
#chat-messages {
  flex: 1;
  padding-left: 5px;
  overflow-y: auto;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#faq-section {
  display: flex;
  flex-direction: column;
  margin-top: 1px;
}

/* Input area */
#chat-input-area {
  display: flex;
  padding: 12px;
  background: linear-gradient(to right, #7aa77c, #6ea87a, #a1b8a1);
  background: #7aa77c;
  border-top: 1px solid #eee;
}

#chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 25px;   /* rounded pill */
  border: 1px solid #ccc;
  outline: none;
  font-size: 14px;
}

#chat-input:focus {
  border-color: #2e7d32;
}

#chat-footer {
  align-self: center;
  font-size: 10.5px;
  padding-bottom: 5px;
  padding-right: 30px;
  margin-top: 5px;
}

#faq-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.faq-intro {
  color: #355b35;
}

.faq-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.faq-subtitle {
  margin: 4px 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.faq-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.faq-btn {
  background: #ffffff;
  color: #355b35;
  border: 1px solid #d8e6d3;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.faq-chip:hover {
  background: #f8fff6;
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.10);
}

.faq-chip:active {
  transform: scale(0.98);
}

.faq-chip.fade-out {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#send-btn {
  margin-left: 8px;
  padding: 10px 16px;
  border-radius: 25px;
  border: none;
  background: #2e7d32;
  color: white;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s ease;
}

#send-btn:hover {
  background: #256628;
}

#chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  overflow-y: auto;
}

.message {
  padding: 12px 15px;
  border-radius: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-sizing: border-box;
}

.user-message {
  align-self: flex-start;
  background: #e8f5e9;
  color: #222;
  width: 55%;
  max-width: 55%;
}

.bot-message {
  align-self: flex-end;
  background: #ffffff;
  color: #222;
  width: 70%;
  max-width: 70%;
  border: 1px solid #e3e3e3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 4px;
}

.message-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

.typing {
  font-style: italic;
  opacity: 0.75;
  animation: pulseTyping 1s infinite ease-in-out;
}

@keyframes pulseTyping {
  0% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.35;
  }
}

@media (max-width: 768px) {
  #chat-widget {
    width: 95vw;
    height: 80vh;
    bottom: 15px;
    right: 50%;
    max-width: none;
    display: flex;
    flex-direction: column;
    background: #9ce8ac;        /* ADD THIS */
    opacity: 1;                 /* ADD THIS */
  }

  /* Handle centering separately so it doesn't conflict with the scale animation */
  #chat-widget:not(.hidden) {
    transform: translateX(50%);
  }

  #chat-widget.hidden {
    transform: translateX(50%) scale(0.8);   /* KEEP the centering while hiding */
    opacity: 0;
    pointer-events: none;
  }

  #chat-button {
    right: 15px;
    bottom: 15px;
    width: 75px;
    height: 75px;
  }

  #chat-button img {
    width: 75px;
    height: 75px;
  }

  #chat-messages {
    flex: 1;
    overflow-y: auto;
  }

  #chat-teaser {
    left: 45px;
  }

  .bot-message,
  .user-message {
    max-width: 90%;
  }

  #chat-header {
    font-size: 1.1rem;
    padding: 14px;
  }

  #chat-input {
    font-size: 16px;
  }

  #send-btn {
    min-width: 75px;
  }
}