/* ============================================================
   Faith Bot — floating chat widget
   Self-contained: only depends on --cpc-navy / --cpc-gold, which
   are already defined in main.css. Safe to include on any page
   alongside know-your-faith-data.js + faith-bot.js.
   ============================================================ */

.faith-bot-bubble {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1080;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--cpc-navy, #002147);
  color: var(--cpc-gold, #d4af37);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 33, 71, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faith-bot-bubble:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(0, 33, 71, 0.45);
}

.faith-bot-bubble svg {
  width: 26px;
  height: 26px;
}

.faith-bot-bubble .faith-bot-close-icon {
  display: none;
}

.faith-bot-bubble.is-open .faith-bot-chat-icon {
  display: none;
}

.faith-bot-bubble.is-open .faith-bot-close-icon {
  display: block;
}

/* First-visit nudge bubble */
.faith-bot-nudge {
  position: fixed;
  right: 1.25rem;
  bottom: 5.6rem;
  z-index: 1079;
  max-width: 220px;
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(0, 33, 71, 0.12);
  border-radius: 0.9rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.faith-bot-nudge.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.faith-bot-nudge button.faith-bot-nudge-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 33, 71, 0.15);
  background: #fff;
  color: #667085;
  font-size: 0.75rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Chat panel */
.faith-bot-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.6rem;
  z-index: 1080;
  width: min(380px, calc(100vw - 2.5rem));
  max-height: min(560px, calc(100vh - 8rem));
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.faith-bot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.faith-bot-panel-header {
  background: var(--cpc-navy, #002147);
  color: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.faith-bot-panel-header .kicker {
  color: var(--cpc-gold, #d4af37);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.15rem;
}

.faith-bot-panel-header h2 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.faith-bot-panel-header p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.faith-bot-panel-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem;
}

.faith-bot-panel-close:hover {
  color: #fff;
}

.faith-bot-log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f6f8fc;
  min-height: 180px;
}

.faith-bot-message {
  max-width: 88%;
  border-radius: 0.9rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.65rem;
  line-height: 1.45;
  font-size: 0.92rem;
}

.faith-bot-message.bot {
  background: #fff;
  border: 1px solid rgba(0, 33, 71, 0.1);
  color: #263445;
}

.faith-bot-message.user {
  background: var(--cpc-navy, #002147);
  color: #fff;
  margin-left: auto;
}

.faith-bot-message ul,
.faith-bot-message ol {
  margin: 0.4rem 0 0.2rem;
  padding-left: 1.1rem;
}

.faith-bot-source-tag {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #667085;
  background: #eef3fa;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}

.faith-bot-open-study-btn {
  display: inline-block;
  margin-top: 0.6rem;
  border: 1px solid var(--cpc-navy, #002147);
  background: #fff;
  color: var(--cpc-navy, #002147);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.faith-bot-open-study-btn:hover {
  background: var(--cpc-navy, #002147);
  color: #fff;
}

.faith-bot-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 1rem 0.75rem;
  background: #f6f8fc;
}

.faith-bot-suggestion-btn {
  border: 1px solid rgba(0, 33, 71, 0.18);
  background: #fff;
  color: var(--cpc-navy, #002147);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.faith-bot-suggestion-btn:hover {
  background: rgba(212, 175, 55, 0.18);
  border-color: var(--cpc-gold, #d4af37);
}

.faith-bot-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(0, 33, 71, 0.08);
  background: #fff;
}

.faith-bot-input {
  flex: 1;
  border: 1px solid rgba(0, 33, 71, 0.18);
  border-radius: 0.6rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
}

.faith-bot-input:focus {
  outline: none;
  border-color: var(--cpc-gold, #d4af37);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.faith-bot-send-btn {
  border: none;
  background: var(--cpc-navy, #002147);
  color: #fff;
  border-radius: 0.6rem;
  padding: 0.5rem 0.9rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}

.faith-bot-send-btn:hover {
  background: #001732;
}

.faith-bot-footnote {
  font-size: 0.7rem;
  color: #8a94a6;
  text-align: center;
  padding: 0.4rem 0.75rem 0.65rem;
  background: #fff;
}

@media (max-width: 480px) {
  .faith-bot-bubble {
    right: 1rem;
    bottom: 1rem;
    width: 54px;
    height: 54px;
  }

  .faith-bot-panel {
    right: 0.75rem;
    bottom: 5rem;
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 7rem);
  }

  .faith-bot-nudge {
    right: 0.75rem;
    bottom: 4.9rem;
  }
}
