/* chatbot.css — extracted from chatbot.html, no logic changes */

*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --brand: #1e3a8a;
  --bg: #ffffff;
  --border: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --radius: 8px;
}

html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); }

/* Inner root (inside iframe) fills the iframe */
#chatbot-container {
  width: 100%;
  height: 100%;
}

#chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

#chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2a4fa8 100%);
  color: #fff;
  flex-shrink: 0;
  border-bottom: 2px solid rgba(184, 134, 11, 0.4);
}

#chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#chat-header-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

#chat-header-subtitle {
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.72;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#chat-header #chat-close-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  font-size: 20px;
  line-height: 1;
}

#chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scroll-behavior: smooth;
}

#chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #ddd;
}

#chat-input {
  flex: 1;
  resize: none;
  border-radius: 10px;
  border: 1px solid #d6dbe3;
  padding: 8px 10px;
  background: #f9fafc;
  box-sizing: border-box;
}

/* Chat input typography: match reply serif reading font */
.chat-input input,
.chat-input textarea,
#chat-input {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.45;
}

/* User questions — warm parchment/gold tone */
.msg.user {
  background: #fdf3d0;
  border: 1px solid rgba(184, 134, 11, 0.22);
  border-radius: 16px 16px 4px 16px;  /* speech-bubble tail bottom-right */
  padding: 10px 14px;
  margin: 2px 0;
  align-self: flex-end;
  max-width: 88%;
  white-space: pre-wrap;
  color: #1a1a2e;
}

/* Bot responses — clean white card */
.msg.bot {
  background: #ffffff;
  border: 1px solid #e2e6ef;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.06);
  border-radius: 16px 16px 16px 4px;  /* speech-bubble tail bottom-left */
  padding: 10px 14px;
  margin: 2px 0;
  align-self: flex-start;
  max-width: 88%;
  white-space: pre-wrap;
  color: #1a1a2e;
}

/* Thinking bubble */
.thinking {
  background: #f0f4f8;
  border-radius: 12px;
  padding: 10px;
  margin: 6px 0;
  font-style: italic;
  color: #555;
}

/* Animate dots after "Thinking" */
.thinking::after {
  content: " 🤔";
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%   { content: " . 🤔"; opacity: 0.3; }
  33%  { content: " .. 🤔"; opacity: 0.6; }
  66%  { content: " ... 🤔"; opacity: 1; }
  100% { content: " . 🤔"; opacity: 0.3; }
}

/* Send button */
#chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #3f5fb3; /* slightly softer than header */
  color: white;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  box-shadow: 0 3px 8px rgba(0,0,0,0.15);

  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;

  flex-shrink: 0;
}

#chat-send svg {
  width: 16px;
  height: 16px;
}

#chat-send:hover {
  background: #4b6bd1;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

#chat-send:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#chat-send[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* Mobile niceties */
@media (max-width: 500px) {
  #chat-container { padding: 10px; gap: 8px; }
  #chat-window { padding: 10px; }
  #chat-input { font-size: 16px; } /* prevents iOS zoom */

  /* Full-width input on mobile */
  #chat-form {
    width: 100%;
    max-width: none;
  }
  #chat-input {
    flex: 1;
    min-width: 0; /* allows proper shrinking */
  }
}

/* Tooltip styles */
.tooltip {
  position: fixed; max-width: 320px; padding: 10px 12px;
  background: #fff; border: 1px solid #c9d4e5; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); font-size: 0.95rem; line-height: 1.35;
  z-index: 9999; display: none;
}
.tooltip .ref { font-weight: 600; margin-bottom: 6px; }

/* Make verse refs look and feel like links */
.chat-bubble.bot a.verse-ref,
.bot a.verse-ref,
a.verse-ref {
  color: #0b63d1 !important;        /* link blue */
  text-decoration: underline !important;
  text-underline-offset: 2px;
  font-weight: 600;                  /* optional */
  cursor: pointer;
}

a.verse-ref:hover {
  text-decoration-thickness: 2px;
}

a.verse-ref:visited {
  color: #6a3dc1;                    /* visited link color (optional) */
}

a.verse-ref:focus-visible {
  outline: 2px solid #0b63d1;
  outline-offset: 2px;
  border-radius: 3px;
}

/* Optional: subtle icon cue */
a.verse-ref::after {
  content: "🔎";
  font-size: .9em;
  margin-left: .25em;
  opacity: .6;
}

/* BibleGateway verse link styling */
#chat-window .verse-link {
  text-decoration: underline dotted;
  cursor: pointer;
  color: #0b63d1;
  font-weight: 600;
}
#chat-window .verse-link:hover {
  text-decoration-style: solid;
  text-decoration-thickness: 2px;
}
