/* BitsiBot chat widget styles (external file so CSP can disallow inline scripts/styles). */

#chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: "Exo 2", sans-serif;
}

/* Toggle button */
.chat-toggle-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #008033;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 8px rgba(76, 212, 13, 0.3),
    0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.chat-toggle-btn:hover {
  transform: scale(1.1);
  background: #00994d;
}

/* Chat window */
.chat-window {
  display: none;
  width: 360px;
  max-height: 480px;
  height: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #00ff66;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  flex-direction: column;
}

/* Header */
.chat-header {
  background: #008033;
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
}

.chat-header-sub {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: #c8e6c9;
  letter-spacing: 0.3px;
}

/* AI notice strip under the header (shown for each chat) */
.chat-ai-note {
  background: #eef7ee;
  border-bottom: 1px solid #d7ead0;
  color: #3f5a3f;
  font-size: 11.5px;
  line-height: 1.35;
  padding: 6px 12px;
  text-align: center;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.chat-close-btn:hover {
  color: #cae4c5;
}

/* Messages */
.chat-messages {
  padding: 16px;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.user-message {
  align-self: flex-end;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}

.bot-message {
  align-self: flex-start;
  background: #f1f8e9;
  border: 1px solid #c5e1a5;
}

.bot-message strong {
  color: #008033;
}

/* Contact links (phone/email) inside messages */
.message a {
  color: #006622;
  text-decoration: underline;
  word-break: break-word;
}
.message a:hover {
  text-decoration: none;
}

/* ── Thinking indicator ── */
.thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4a5a4a;
}

.thinking .dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.thinking .dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #008033;
  display: inline-block;
  animation: bitsi-bounce 1.2s infinite ease-in-out both;
}

.thinking .dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking .dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.thinking-label {
  font-size: 13px;
  font-style: italic;
  color: #5a6b5a;
  transition: opacity 0.2s ease;
}

.thinking-label-slow {
  color: #8a6d1f;
  font-style: normal;
}

@keyframes bitsi-bounce {
  0%, 80%, 100% {
    transform: translateY(0) scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-4px) scale(1);
    opacity: 1;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .thinking .dots i {
    animation: none;
    opacity: 1;
  }
}

/* Input form */
.chat-form {
  display: flex;
  border-top: 1px solid #e0e0e0;
  padding: 10px;
  gap: 8px;
}

.chat-form input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: "Exo 2", sans-serif;
}
.chat-form input[type="text"]:focus {
  border-color: #00ff66;
}

.chat-send-btn {
  padding: 10px 16px;
  background: #008033;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}
.chat-send-btn:hover {
  background: #00994d;
}
.chat-send-btn:disabled {
  background: #a0cfa0;
  cursor: not-allowed;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .chat-window {
    width: calc(100vw - 40px);
    right: 20px;
  }
}
