/* VERBO VIVO — REDESIGN THEME: SERENO (a)
   Lavanda clara + roxo. Serif Newsreader. Tema claro. Tokens do handoff (README §Sereno). */

:root {
  /* Paleta — roxo sobre lavanda clara */
  --gold: #6B63C6;
  --gold-2: #8b83d1;
  --gold-dim: rgba(107,99,198,0.72);
  --gold-faint: rgba(107,99,198,0.1);
  --gold-ghost: rgba(107,99,198,0.04);
  --gold-text: #ffffff;            /* texto sobre var(--gold) */
  --accent-rgb: 107,99,198;
  --surface-rgb: 0,0,0;            /* superfícies sutis (escuro sobre claro) */

  --bg-deep: linear-gradient(180deg, #ECE8F6 0%, #E6ECF5 55%, #F4EDEC 100%);
  --bg-mid: #E6ECF5;
  --bg-nav: rgba(238,235,248,0.94);
  --bg-card: rgba(255,255,255,0.72);
  --text-light: #2C2A3D;
  --text-dim: #6E6B85;
  --text-hint: #8481A0;
  --green-soft: rgba(59,168,95,0.6);
  --green-bg: rgba(62,196,109,0.08);
  --red-soft: rgba(176,69,90,0.9);

  /* Tipografia */
  --font-display: var(--font-newsreader), Georgia, 'Times New Roman', serif;
  --font-body: var(--font-hanken), 'Helvetica Neue', system-ui, sans-serif;

  --radius: 14px;
  --radius-lg: 20px;
  --spacing-xs: 4px; --spacing-sm: 8px; --spacing-md: 16px; --spacing-lg: 24px; --spacing-xl: 40px;

  /* Leitor bíblico (claro) */
  --read-bg: #F4EDEC;
  --read-panel-bg: #FAF8FE;
  --read-modal-bg: #F4EFFA;
  --read-text: rgba(44,42,61,0.9);
  --read-text-dim: rgba(44,42,61,0.5);
  --read-text-hint: rgba(44,42,61,0.32);
  --read-text-faint: rgba(44,42,61,0.22);
  --read-border: rgba(107,99,198,0.14);
  --read-surface: rgba(107,99,198,0.06);
  --step-card-bg: rgba(107,99,198,0.07);
  --step-card-expanded: rgba(107,99,198,0.14);
  --streak-accent: #6B63C6;
  --streak-border: rgba(107,99,198,0.55);
  --streak-faint: rgba(107,99,198,0.3);
  --streak-glow: rgba(107,99,198,0.22);

  /* Tokens completados 2026-07-14 — todo tema define o superset (permite remover fallbacks inline) */
  --accent: var(--gold);           /* alias do acento principal */
  --danger: #ef4444;               /* erros / ações destrutivas */
}

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

html, body {
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text-light);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

/* Content area below fixed header */
.app-content {
  padding-top: 60px;
  padding-left: clamp(16px, 3vw, 48px);
  padding-right: clamp(16px, 3vw, 48px);
  width: 100%;
  box-sizing: border-box;
}

input, textarea {
  font: inherit;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb),0.5); }

/* Layout */
.container {
  width: 100%;
  padding: 0 clamp(16px, 3vw, 48px);
  position: relative;
  z-index: 1;
}

/* Ambient Glow - Blue tint */
.ambient {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb),0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Header - Fixed top bar */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 48px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-deep);
  border-bottom: none;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo svg {
  color: var(--gold);
  opacity: 0.9;
}

.header-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.header-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-link {
  background: none;
  border: none;
  padding: 8px 4px;
  color: var(--text-light);
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--gold);
}

/* Cards - Clean */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-lg);
  padding: 24px;
}
[data-color-scheme="light"] .card {
  background: rgba(0,0,0,0.04);
  border: 1px solid rgba(0,0,0,0.08);
}

/* Glow on clickable cards — only specific classes */
.plan-card-link,
.explore-card,
.card-clickable {
  transition: box-shadow 0.25s ease-out;
  border-radius: var(--radius-lg);
}
.plan-card-link:hover,
.explore-card:hover,
.card-clickable:hover {
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.35), 0 0 30px rgba(var(--accent-rgb),0.15), 0 8px 24px rgba(0,0,0,0.3);
}

/* Share button hover */
.share-btn:hover {
  border-color: rgba(var(--accent-rgb),0.4) !important;
  color: var(--gold) !important;
  box-shadow: 0 0 15px rgba(var(--accent-rgb),0.1);
}

.card-glow {
  /* disabled for clean look */
}

/* Verse Card */
.verse-label {
  color: var(--gold-dim);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 600;
}

.verse-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-light);
  margin-bottom: 12px;
}

.verse-ref {
  color: var(--gold);
  font-size: 14px;
  font-weight: 500;
}

/* Theme Grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.theme-btn {
  background: rgba(var(--surface-rgb),0.03);
  border: 1px solid rgba(var(--accent-rgb),0.1);
  border-radius: var(--radius);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  color: var(--text-dim);
  font-size: 14px;
}

.theme-btn:hover {
  background: rgba(var(--accent-rgb),0.08);
  border-color: rgba(var(--accent-rgb),0.2);
  transform: translateY(-2px);
}

.theme-btn .icon { font-size: 26px; }

/* Input Bar */
.input-bar {
  display: flex;
  gap: 10px;
  background: rgba(var(--surface-rgb),0.04);
  border: 1px solid rgba(var(--accent-rgb),0.1);
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  align-items: center;
}

.input-bar input,
.input-bar textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-light);
  font-size: 14px;
  padding: 10px 0;
  resize: none;
}

.input-bar input::placeholder,
.input-bar textarea::placeholder { color: var(--text-hint); }

.send-btn {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  border: none;
  border-radius: 10px;
  padding: 0 18px;
  height: 40px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.send-btn:hover { opacity: 0.9; transform: scale(1.02); }
.send-btn:disabled { opacity: 0.4; cursor: default; }

/* Chat Messages */
.msg-user {
  background: rgba(var(--accent-rgb),0.12);
  border: 1px solid rgba(var(--accent-rgb),0.2);
  border-radius: 16px 16px 4px 16px;
  padding: 12px 16px;
  max-width: 80%;
  align-self: flex-end;
}

.msg-assistant {
  max-width: 90%;
  align-self: flex-start;
}

.msg-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.msg-avatar-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb),0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(var(--accent-rgb),0.05);
}

.msg-avatar-name {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
}

.msg-bubble {
  background: rgba(var(--surface-rgb),0.04);
  border: 1px solid rgba(var(--accent-rgb),0.08);
  border-radius: 4px 16px 16px 16px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 10px;
}

/* Citation Card */
.citation-card {
  background: rgba(var(--accent-rgb),0.05);
  border: 1px solid rgba(var(--accent-rgb),0.1);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.citation-label {
  color: var(--gold-dim);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}

.citation-text {
  color: var(--text-light);
  font-size: 14px;
  font-style: italic;
  line-height: 1.5;
}

.citation-ref {
  color: var(--gold);
  font-size: 13px;
  margin-top: 6px;
  font-weight: 500;
}

/* Practice Card */
.practice-card {
  background: rgba(100,210,130,0.05);
  border: 1px solid rgba(100,210,130,0.1);
  border-left: 3px solid var(--green-soft);
  border-radius: 10px;
  padding: 14px 16px;
}

.practice-label {
  color: rgba(100,210,130,0.5);
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}

.practice-text {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 18px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}

.badge-high { background: rgba(100,210,130,0.1); color: rgba(100,210,130,0.7); }
.badge-medium { background: rgba(var(--accent-rgb),0.1); color: var(--gold-dim); }
.badge-low { background: rgba(220,80,80,0.1); color: rgba(220,80,80,0.6); }

/* Crisis Banner */
.crisis-banner {
  background: rgba(220,80,80,0.08);
  border: 1px solid rgba(220,80,80,0.15);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.crisis-banner strong { color: var(--red-soft); }
.crisis-banner p { color: var(--text-dim); font-size: 14px; margin-top: 8px; }

/* Disclaimer */
.disclaimer {
  color: var(--text-hint);
  font-size: 11px;
  text-align: center;
  padding: 12px 0;
}

/* Tags Row */
.tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(var(--accent-rgb),0.08);
  border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 18px;
  padding: 5px 12px;
  color: var(--gold-dim);
  font-size: 11px;
  font-weight: 500;
}

/* Live Indicator */
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74,222,128,0.5);
  animation: pulse 2s ease-in-out infinite;
}

/* Typing Animation */
.typing-dots { display: flex; gap: 6px; align-items: center; }

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: breathe 1s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* CTA Button */
.cta-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-2) 100%);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  transition: all 0.2s ease;
}

.cta-btn:hover { opacity: 0.9; transform: scale(1.01); }
.cta-btn:disabled { opacity: 0.5; cursor: default; }

/* Utility Classes */
.stack { display: grid; gap: 12px; }
.gap-lg { gap: 24px; }
.gap-xl { gap: 40px; }
.text-center { text-align: center; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 32px; }
.mb-lg { margin-bottom: 32px; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 1; transform: translateY(0) }
  to { opacity: 1; transform: translateY(0) }
}

@keyframes slideUp {
  from { opacity: 1; transform: translateY(0) }
  to { opacity: 1; transform: translateY(0) }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 15px rgba(var(--accent-rgb),0.08) }
  50% { box-shadow: 0 0 30px rgba(var(--accent-rgb),0.18) }
}

@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1) }
  50% { opacity: 1; transform: scale(1.1) }
}

@keyframes pulse {
  0%, 100% { opacity: 1 }
  50% { opacity: 0.6 }
}

@keyframes blink {
  0%, 50% { opacity: 1 }
  51%, 100% { opacity: 0 }
}

.animate-in { /* instant cut — no transition */ }

/* Admin Styles */
/* ── Admin shell: sidebar + content ── */

.app-content:has(.admin-shell) {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

/* Hide app header inside admin (sidebar has its own nav) */
.app-content:has(.admin-shell) .header { display: none; }

.admin-shell { display: flex; min-height: 100dvh; width: 100%; }

.admin-sidebar {
  display: flex; flex-direction: column;
  background: var(--bg-nav, rgba(0,0,0,0.5));
  border-right: 1px solid var(--read-border, rgba(255,255,255,0.07));
  width: 155px; flex-shrink: 0;
  position: fixed; top: 0; left: 0;
  height: 100dvh; overflow-y: auto; z-index: 100;
}

.admin-sidebar-desktop { display: flex; }
.admin-sidebar-mobile  { display: none; }
.admin-mobile-header   { display: none; }

.admin-main {
  flex: 1; min-width: 0;
  margin-left: 155px;
  padding: 28px 32px 48px; overflow-x: hidden;
}

@media (max-width: 900px) {
  .admin-sidebar-desktop { display: none; }
  .admin-sidebar {
    position: fixed; top: 0; left: -175px;
    width: 175px; transition: left 0.25s ease; z-index: 200;
  }
  .admin-sidebar-mobile {
    display: flex; position: fixed; inset: 0; z-index: 199; pointer-events: none;
  }
  .admin-sidebar-mobile.admin-sidebar-open { pointer-events: auto; }
  .admin-sidebar-mobile.admin-sidebar-open .admin-sidebar { left: 0; }
  .admin-mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid rgba(var(--accent-rgb),0.1);
    margin: -28px -32px 24px;
  }
  .admin-main { margin-left: 0; padding: 16px 16px 48px; }
}

.admin-page { width: 100%; }
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.admin-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.admin-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--accent-rgb),0.1);
}

.admin-table-wrap table { width: 100%; border-collapse: collapse; min-width: 800px; }
.admin-table-wrap thead tr { border-bottom: 1px solid rgba(var(--accent-rgb),0.1); background: rgba(var(--accent-rgb),0.03); }
.admin-table-wrap tbody tr { border-bottom: 1px solid rgba(var(--accent-rgb),0.05); transition: background 0.2s ease; }
.admin-table-wrap tbody tr:hover { background: rgba(var(--accent-rgb),0.05); }
.admin-table-wrap th, .admin-table-wrap td { padding: 12px 14px; text-align: left; }
.admin-table-wrap th { color: var(--gold-dim); font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.admin-table-wrap td { color: var(--text-dim); font-size: 13px; }

/* Responsive */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .header { display: none; }
  /* MobileTopBar é position:fixed → conteúdo precisa de padding-top = altura da barra (56px) + safe area */
  .app-content { padding-top: calc(56px + env(safe-area-inset-top, 0px)); padding-left: 16px; padding-right: 16px; }
  .nav-link { display: none; }
  .verse-text { font-size: 18px; line-height: 1.5; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .theme-btn { padding: 16px 12px; font-size: 13px; }
  .msg-bubble { font-size: 14px; line-height: 1.6; }
  .card { padding: 18px; }
  h1 { font-size: 22px !important; }
}

/* Redesign — títulos em serif por padrão (consistência tipográfica app-wide).
   Só afeta headings sem font-family próprio; classes/inline continuam vencendo. */
h1, h2, h3, h4 { font-family: var(--font-display); }
