/* ═══════════════════════════════════════════════════════════════
   Living Waters Fellowship — Sermon Assistant
   Brand blue: #1878c2
   Typography: Montserrat (UI) · Lora (headings/serifs)
═══════════════════════════════════════════════════════════════ */

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

:root {
  --lw-blue:        #1878c2;
  --lw-blue-dark:   #0f5fa0;
  --lw-blue-deep:   #083d70;
  --lw-blue-mid:    #1469ab;
  --lw-blue-light:  #3a9fd6;
  --lw-blue-pale:   #e6f2fb;
  --lw-blue-tint:   #f0f7fd;
  --gold:           #c9a84c;
  --gold-light:     #dfc06e;
  --gold-pale:      #fdf6e3;
  --white:          #ffffff;
  --text-dark:      #0f2d4a;
  --text-mid:       #3d5c78;
  --text-light:     #6b8aa4;
  --border:         #c8dcea;
  --border-light:   #deeaf5;
  --surface:        #ffffff;
  --bg:             #f4f9fd;
  --error:          #c53030;
  --error-bg:       #fff5f5;
  --radius-sm:      6px;
  --radius-md:      14px;
  --radius-lg:      22px;
  --radius-pill:    999px;
  --shadow-sm:  0 1px 4px rgba(24,120,194,.08);
  --shadow-md:  0 4px 24px rgba(24,120,194,.13);
  --shadow-lg:  0 8px 48px rgba(24,120,194,.16);
  --shadow-card:0 2px 16px rgba(15,45,74,.07), 0 8px 40px rgba(24,120,194,.09);
  --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { display: block; max-width: 100%; }
a { color: var(--lw-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--lw-blue);
  border-bottom: 3px solid rgba(255,255,255,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(8,61,112,.35);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-logo-link { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.header-logo { height: 54px; width: auto; border-radius: 6px; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  letter-spacing: 0.01em;
}
.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.12);
  text-decoration: none;
}
.nav-btn-church {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--lw-blue);
  background: var(--white);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  text-decoration: none;
  white-space: nowrap;
}
.nav-btn-church:hover {
  background: var(--gold-pale);
  color: var(--lw-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  text-decoration: none;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(155deg, var(--lw-blue-dark) 0%, var(--lw-blue) 45%, var(--lw-blue-light) 100%);
  padding: 72px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255,255,255,.08) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(201,168,76,.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 48px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.hero-well { width: 72px; height: 72px; margin: 0 auto 28px; opacity: 0.7; }
.hero-well-icon { width: 100%; height: 100%; }
.hero-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(26px, 4.5vw, 42px);
  font-weight: 600;
  color: var(--white);
  line-height: 1.25;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 400;
  color: rgba(255,255,255,.85);
  line-height: 1.7;
}
.hero-br { display: none; }
@media (min-width: 520px) { .hero-br { display: inline; } }

/* ── Search Section ─────────────────────────────────────────── */
.search-section { padding: 60px 0 52px; flex: 1; }
.search-form { margin-bottom: 36px; }
.search-label {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.search-input-wrapper { position: relative; margin-bottom: 14px; }
.search-icon-inside {
  position: absolute;
  top: 18px; left: 18px;
  width: 20px; height: 20px;
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
}
.search-input {
  width: 100%;
  padding: 16px 20px 16px 50px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  color: var(--text-dark);
  background: var(--white);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.6;
  min-height: 96px;
}
.search-input::placeholder { color: var(--text-light); font-weight: 400; }
.search-input:focus { outline: none; border-color: var(--lw-blue); box-shadow: 0 0 0 4px rgba(24,120,194,.12); }
.search-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.search-hint { font-size: 13px; color: var(--text-light); font-weight: 400; }
.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--lw-blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-pill);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(24,120,194,.30);
  white-space: nowrap;
  flex-shrink: 0;
}
.search-btn:hover:not(:disabled) { background: var(--lw-blue-dark); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(24,120,194,.40); }
.search-btn:active:not(:disabled) { transform: translateY(0); }
.search-btn:disabled { opacity: .42; cursor: not-allowed; }

/* ── Loading ────────────────────────────────────────────────── */
.loading { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 52px 0; color: var(--text-mid); font-size: 15px; font-weight: 500; }
.loading-spinner { width: 40px; height: 40px; border: 3px solid var(--border-light); border-top-color: var(--lw-blue); border-radius: 50%; animation: spin 0.75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error Banner ───────────────────────────────────────────── */
.error-banner {
  background: var(--error-bg);
  border: 1.5px solid var(--error);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  color: var(--error);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ── Result Card ────────────────────────────────────────────── */
.results { animation: fadeUp .32s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.result-card { background: var(--white); border-radius: var(--radius-lg); padding: 0; box-shadow: var(--shadow-card); border: 1px solid var(--border-light); overflow: hidden; }
.result-card-top {
  background: linear-gradient(90deg, var(--lw-blue-dark) 0%, var(--lw-blue) 60%, var(--lw-blue-light) 100%);
  padding: 16px 32px;
  display: flex;
  align-items: center;
}
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.18);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius-pill);
  padding: 5px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.result-badge::before { content: '✦'; font-size: 9px; opacity: 0.8; }
.result-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 600;
  color: var(--lw-blue-dark);
  line-height: 1.2;
  margin: 28px 32px 12px;
  letter-spacing: -0.02em;
}
.result-meta { font-size: 13px; color: var(--text-mid); display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0 32px 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.meta-item { display: flex; align-items: center; gap: 5px; }
.meta-label { font-weight: 600; color: var(--text-dark); }
.confidence-row { display: flex; align-items: center; gap: 16px; margin: 0 32px 24px; }
.confidence-label-group { display: flex; flex-direction: column; align-items: flex-start; flex-shrink: 0; min-width: 120px; }
.confidence-label { font-size: 14px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.2; }
.confidence-label.conf-strong   { color: #1a7f4b; }
.confidence-label.conf-good     { color: var(--lw-blue); }
.confidence-label.conf-possible { color: #7a5c00; }
.confidence-pct { font-size: 11px; font-weight: 600; color: var(--text-light); margin-top: 1px; }
.confidence-bar-wrap { flex: 1; height: 10px; background: var(--lw-blue-pale); border-radius: var(--radius-pill); overflow: hidden; }
.confidence-bar { height: 100%; border-radius: var(--radius-pill); transition: width 0.9s cubic-bezier(.4,0,.2,1); background: linear-gradient(90deg, var(--lw-blue) 0%, var(--lw-blue-light) 80%, var(--gold) 100%); }
.result-body { display: flex; flex-direction: column; gap: 20px; margin: 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.result-block-title { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lw-blue); margin-bottom: 8px; }
.result-why, .result-summary { font-size: 15px; color: var(--text-mid); line-height: 1.7; font-weight: 400; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 24px 32px; }
.btn-watch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #ff0000;
  color: var(--white);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  border: none;
  box-shadow: 0 3px 12px rgba(255,0,0,.25);
  letter-spacing: 0.01em;
}
.btn-watch:hover { background: #cc0000; text-decoration: none; transform: translateY(-1px); box-shadow: 0 5px 18px rgba(255,0,0,.3); }
.yt-icon { width: 18px; height: 18px; flex-shrink: 0; }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 22px;
  background: transparent;
  color: var(--lw-blue);
  border: 2px solid var(--lw-blue);
  border-radius: var(--radius-pill);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.btn-secondary:hover { background: var(--lw-blue); color: var(--white); box-shadow: 0 4px 16px rgba(24,120,194,.25); }

/* ── No Result ──────────────────────────────────────────────── */
.no-result { text-align: center; padding: 64px 24px; background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border-light); box-shadow: var(--shadow-card); animation: fadeUp .32s ease; }
.no-result-icon { font-size: 48px; margin-bottom: 16px; }
.no-result-title { font-family: 'Lora', Georgia, serif; font-size: 24px; font-weight: 600; color: var(--lw-blue-dark); margin-bottom: 12px; }
.no-result-msg { font-size: 15px; color: var(--text-mid); max-width: 380px; margin: 0 auto 28px; line-height: 1.65; }

/* ── Suggestions ────────────────────────────────────────────── */
.suggestions-section { background: var(--lw-blue-pale); border-top: 1px solid var(--border-light); padding: 48px 0 60px; }
.suggestions-title { font-size: 13px; font-weight: 700; color: var(--text-mid); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 18px; text-align: center; }
.suggestions-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.suggestion-chip {
  padding: 9px 20px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--lw-blue);
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.suggestion-chip:hover { background: var(--lw-blue); border-color: var(--lw-blue); color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(24,120,194,.25); }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer { background: var(--lw-blue-deep); color: rgba(255,255,255,.55); text-align: center; padding: 40px 24px 36px; font-size: 13px; line-height: 1.7; }
.footer-inner { max-width: 480px; margin: 0 auto; }
.footer-logo { height: 52px; width: auto; margin: 0 auto 20px; border-radius: 6px; opacity: 0.85; }
.footer-verse { font-family: 'Lora', Georgia, serif; font-style: italic; font-size: 14px; color: rgba(255,255,255,.75); margin-bottom: 8px; line-height: 1.6; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.4); letter-spacing: 0.02em; }

/* ── Admin Login ────────────────────────────────────────────── */
.admin-body { background: var(--bg); }
.login-card {
  max-width: 420px;
  margin: 80px auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  text-align: center;
}
.login-icon { font-size: 40px; margin-bottom: 16px; }
.login-title { font-family: 'Lora', Georgia, serif; font-size: 26px; font-weight: 600; color: var(--lw-blue-dark); margin-bottom: 8px; }
.login-sub { font-size: 14px; color: var(--text-mid); margin-bottom: 28px; }
.login-form { text-align: left; }
.login-label { display: block; font-size: 13px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; letter-spacing: 0.02em; text-transform: uppercase; }
.login-input {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  color: var(--text-dark);
  background: var(--white);
  margin-bottom: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.login-input:focus { outline: none; border-color: var(--lw-blue); box-shadow: 0 0 0 4px rgba(24,120,194,.12); }
.login-btn { width: 100%; justify-content: center; padding: 14px; }
.login-back { margin-top: 20px; font-size: 13px; color: var(--text-light); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; height: 62px; }
  .header-logo { height: 44px; }
  .nav-link { display: none; }
  .hero { padding: 52px 20px 64px; }
  .result-title { margin: 20px 20px 10px; font-size: 22px; }
  .result-meta { margin: 0 20px 20px; }
  .confidence-row { margin: 0 20px 20px; }
  .result-body { margin: 0 20px; }
  .result-actions { padding: 20px; }
  .result-card-top { padding: 14px 20px; }
  .search-actions { flex-direction: column; align-items: stretch; }
  .search-btn { justify-content: center; width: 100%; }
  .login-card { margin: 40px 16px; padding: 32px 24px; }
}
@media (min-width: 601px) and (max-width: 860px) {
  .search-actions { justify-content: flex-end; }
}
