/* ai_chatbot.css */

:root {
  --color-beige: rgb(241, 232, 218);
  --color-olive: rgb(97, 108, 87);
  --color-white: #fdfdfd;
  --color-gray: gray;
  --color-dark-gray: #555;
  --color-hover: rgb(120, 134, 107);
  --color-black: #222;
  --color-charcoal: rgb(62, 58, 55);
  --color-cta: rgb(215 117 58);
}

/* ---------- Container ---------- */

#ai-chatbot {
  position: fixed;
  bottom: 6rem;
  right: 20px;
  z-index: 9999;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

@media screen and (min-width: 840px) {
  #ai-chatbot {
    bottom: 2rem;
  }
}

/* ---------- Floating Button ---------- */

.ai-chatbot-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--color-cta);
  color: var(--color-white);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.ai-chatbot-toggle:hover {
  background: var(--color-hover);
  transform: scale(1.05);
}

/* ---------- Window ---------- */

.ai-chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 360px;
  height: 520px;
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ai-chatbot-window.hidden {
  display: none;
}

/* ---------- Header ---------- */

.ai-chatbot-header {
  background: var(--color-olive);
  color: var(--color-white);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.ai-chatbot-close {
  background: transparent;
  border: none;
  color: var(--color-white);
  font-size: 20px;
  cursor: pointer;
}

/* ---------- Messages ---------- */

.ai-chatbot-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Message Bubbles ---------- */

.bot-message,
.user-message {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 4px;
  line-height: 1.4;
  font-size: 14px;
}

/* Bot */
.bot-message {
  background: var(--color-beige);
  color: var(--color-charcoal);
  align-self: flex-start;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* User */
.user-message {
  background: var(--color-olive);
  color: var(--color-white);
  align-self: flex-end;
}

/* ---------- Quick Actions ---------- */

.chatbot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chatbot-quick-actions button {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--color-white);
  color: var(--color-charcoal);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.1s ease;
}

.chatbot-quick-actions button:hover {
  background: var(--color-beige);
  transform: translateY(-1px);
}

/* ---------- Input Area ---------- */

.ai-chatbot-form {
  display: flex;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--color-white);
}

.ai-chatbot-form input {
  flex: 1;
  border: none;
  padding: 12px;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.ai-chatbot-form button {
  border: none;
  background: var(--color-cta);
  color: var(--color-white);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 500;
}

.ai-chatbot-form button:hover {
  filter: brightness(1.05);
}

/* ---------- Chatbot Buttons inside messages ---------- */

.chatbot-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--color-olive);
  color: var(--color-white);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s ease;
}

.chatbot-btn:hover {
  background: rgb(176 90 42);
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
  .ai-chatbot-window {
    width: calc(100vw - 4rem);
    height: 70vh;
    right: 10px;
    bottom: 80px;
  }
}

/* ---------- Details / Summary ---------- */
.bot-message details {
  margin-top: 10px;
}
