/* ================================================================
   FINDANYCHURCH NIGERIA — Enterprise Mobile-First Design System
   Premium dark-mode · Glassmorphism · Bottom-sheet mobile UX
   ================================================================ */

/* ── DESIGN TOKENS ──────────────────────────────────────────────────── */
:root {
  /* Core Palette */
  --bg-deep:     #080F1A;
  --bg-base:     #0C1524;
  --bg-card:     #111E30;
  --bg-elevated: #162335;
  --border:      rgba(255,255,255,0.07);
  --border-hover:rgba(255,255,255,0.14);

  /* Brand */
  --gold:        #F5C842;
  --gold-dim:    #C9A22A;
  --gold-glow:   rgba(245,200,66,0.18);
  --teal:        #22D3C8;
  --teal-dim:    rgba(34,211,200,0.12);
  --red:         #F06060;
  --green:       #4ADE80;
  --purple:      #A78BFA;
  --orange:      #FB923C;

  /* Text */
  --text-primary:   #EEF2F7;
  --text-secondary: #8BA0B8;
  --text-muted:     #4D6480;

  /* Glass */
  --glass-bg:     rgba(255,255,255,0.04);
  --glass-hover:  rgba(255,255,255,0.07);
  --glass-border: rgba(255,255,255,0.08);

  /* Layout */
  --nav-h:      58px;
  --sidebar-w:  360px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.6);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.4);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);

  /* Motion */
  --ease:          cubic-bezier(0.4,0,0.2,1);
  --ease-spring:   cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth:   cubic-bezier(0.25,0.46,0.45,0.94);
  --t-fast:  150ms;
  --t-std:   240ms;
  --t-slow:  420ms;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-head: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* ── RESET ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
select { font-family: inherit; }
a { text-decoration: none; }

/* ── SCROLLBAR ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
  background: rgba(8,15,26,0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.nav-left, .nav-right { flex: 1; }
.nav-right { display: flex; justify-content: flex-end; }
.nav-center { display: flex; align-items: center; gap: 8px; }

/* Brand */
.nav-brand { display: flex; align-items: center; gap: 10px; }
.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(245,200,66,0.3);
  flex-shrink: 0;
}
.brand-name {
  display: block;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  line-height: 1;
}
.brand-accent { color: var(--gold); }
.brand-country {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Live status indicator */
.live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: livePulse 2.5s ease infinite;
  flex-shrink: 0;
}
.nav-status-text {
  font-size: 0.74rem;
  color: var(--text-secondary);
  font-weight: 500;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-status-text.info    { color: var(--teal); }
.nav-status-text.success { color: var(--green); }
.nav-status-text.error   { color: var(--red); }

/* Nav pill */
.nav-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}
.nav-pill-icon { font-size: 0.85rem; }

/* ================================================================
   APP SHELL
   ================================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  padding-top: var(--nav-h);
  overflow: hidden;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  border-right: 1px solid var(--border);
  overflow: hidden;
  z-index: 500;
  transition: transform var(--t-slow) var(--ease-smooth);
}

/* Sheet handle — hidden on desktop */
.sheet-handle {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 10px 0 4px;
  flex-shrink: 0;
  cursor: pointer;
}
.sheet-handle-bar {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

/* ── HERO ────────────────────────────────────────────────────────────── */
.sidebar-hero {
  position: relative;
  padding: 20px 20px 16px;
  background: linear-gradient(160deg, rgba(245,200,66,0.1) 0%, rgba(34,211,200,0.05) 60%, transparent 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.hero-glow {
  position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(245,200,66,0.14) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
  position: relative;
}
.hero-title::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: livePulse 2s ease infinite;
}
.hero-sub {
  font-size: 0.77rem;
  color: var(--text-secondary);
  line-height: 1.55;
  position: relative;
}

/* ── SEARCH BODY ─────────────────────────────────────────────────────── */
.search-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── FORM SECTION ───────────────────────────────────────────────────── */
.form-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 13px;
  transition: border-color var(--t-std) var(--ease);
}
.form-section:focus-within {
  border-color: rgba(245,200,66,0.3);
}
.section-label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 11px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}
.section-num {
  width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--bg-deep);
  flex-shrink: 0;
}

/* ── GEO BUTTON ─────────────────────────────────────────────────────── */
.geo-btn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 12px 13px;
  min-height: 52px;
  background: linear-gradient(135deg, rgba(245,200,66,0.08), rgba(34,211,200,0.05));
  border: 1px solid rgba(245,200,66,0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all var(--t-std) var(--ease);
  text-align: left;
  margin-bottom: 10px;
}
.geo-btn:hover {
  background: linear-gradient(135deg, rgba(245,200,66,0.15), rgba(34,211,200,0.08));
  border-color: rgba(245,200,66,0.4);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,200,66,0.12);
}
.geo-btn:active { transform: translateY(0); }
.geo-btn-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  background: rgba(245,200,66,0.12);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
}
.geo-btn-text { flex: 1; }
.geo-btn-text strong { display: block; font-size: 0.84rem; font-weight: 700; margin-bottom: 1px; }
.geo-btn-text small { font-size: 0.68rem; color: var(--text-muted); }
.geo-btn-arrow { color: var(--text-muted); font-size: 1rem; transition: transform var(--t-std); }
.geo-btn:hover .geo-btn-arrow { transform: translateX(3px); color: var(--gold); }

/* ── DIVIDER ─────────────────────────────────────────────────────────── */
.or-divider {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

/* ── SELECT ROW ─────────────────────────────────────────────────────── */
.select-row { display: flex; gap: 8px; }
.select-wrap { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.select-label {
  font-size: 0.67rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted); padding-left: 2px;
}
.select-box {
  position: relative;
  display: flex; align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-std), box-shadow var(--t-std);
}
.select-box:focus-within {
  border-color: rgba(245,200,66,0.4);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.08);
}
.select-icon {
  position: absolute; left: 9px;
  color: var(--text-muted); pointer-events: none;
}
.select-chevron {
  position: absolute; right: 9px;
  color: var(--text-muted); pointer-events: none;
}
.styled-select {
  width: 100%; padding: 10px 28px 10px 28px;
  min-height: 44px;
  background: transparent;
  border: none; outline: none;
  color: var(--text-primary);
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.styled-select:disabled { opacity: 0.4; cursor: not-allowed; }
.styled-select option { background: var(--bg-card); color: var(--text-primary); }

/* ── CHIP GRID ──────────────────────────────────────────────────────── */
.chip-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chip-grid::-webkit-scrollbar { display: none; }
.chip {
  padding: 7px 13px;
  min-height: 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.73rem; font-weight: 600;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}
.chip:hover:not(.active) {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--glass-hover);
}
.chip.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-color: transparent;
  color: var(--bg-deep);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(245,200,66,0.3);
}

/* ── RADIUS SLIDER ──────────────────────────────────────────────────── */
.slider-track-wrap { display: flex; flex-direction: column; gap: 6px; }
.radius-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, rgba(245,200,66,0.15), rgba(245,200,66,0.08));
  border: 1px solid rgba(245,200,66,0.25);
  border-radius: 10px;
  font-size: 0.72rem; font-weight: 700;
  color: var(--gold);
}
.radius-slider {
  width: 100%; height: 5px;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right, var(--gold) 0%, var(--gold) 10%, var(--bg-elevated) 10%);
  border-radius: 3px; outline: none; cursor: pointer;
}
.radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.25), 0 2px 8px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform var(--t-fast);
}
.radius-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.radius-slider::-moz-range-thumb {
  width: 20px; height: 20px; border: none;
  border-radius: 50%; background: var(--gold); cursor: pointer;
}
.slider-ends {
  display: flex; justify-content: space-between;
  font-size: 0.65rem; color: var(--text-muted);
  padding: 0 2px;
}

/* ── SEARCH BUTTON ──────────────────────────────────────────────────── */
.btn-search {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px;
  min-height: 52px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dim) 100%);
  border-radius: var(--radius-md);
  color: var(--bg-deep);
  font-size: 0.9rem; font-weight: 800;
  letter-spacing: 0.1px;
  transition: all var(--t-std) var(--ease);
  position: relative; overflow: hidden;
  box-shadow: 0 4px 20px rgba(245,200,66,0.25);
}
.btn-search::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--t-std);
}
.btn-search:hover:not(:disabled)::before { opacity: 1; }
.btn-search:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245,200,66,0.4);
}
.btn-search:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.btn-search:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
}

/* ── STATUS BAR ─────────────────────────────────────────────────────── */
.status-bar {
  min-height: 16px;
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding: 2px 4px;
  border-radius: 6px;
  transition: all var(--t-std);
  line-height: 1.45;
}
.status-bar.info    { color: var(--teal); }
.status-bar.success { color: var(--green); background: rgba(74,222,128,0.06); }
.status-bar.error   { color: var(--red);  background: rgba(240,96,96,0.06); }

/* ================================================================
   RESULTS PANEL
   ================================================================ */
.results-panel {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border);
  max-height: 55vh;
  background: var(--bg-base);
}
.results-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.results-meta { display: flex; flex-direction: column; gap: 2px; }
.results-count {
  font-family: var(--font-head);
  font-size: 0.88rem; font-weight: 700;
  color: var(--gold);
}
.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-muted);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--border-hover); }

.results-list {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: flex; flex-direction: column; gap: 7px;
}

/* ── CHURCH CARD ─────────────────────────────────────────────────────── */
.church-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 13px;
  cursor: pointer;
  transition: all var(--t-std) var(--ease);
  animation: cardIn 0.3s var(--ease) both;
  opacity: 0;
}
.church-card:hover {
  background: var(--bg-elevated);
  border-color: rgba(245,200,66,0.25);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.church-card:active { transform: translateY(0); }
.church-card.highlighted {
  border-color: var(--gold);
  background: rgba(245,200,66,0.05);
  box-shadow: 0 0 0 2px rgba(245,200,66,0.15), 0 6px 20px rgba(0,0,0,0.35);
}
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 7px;
}
.card-name {
  font-size: 0.84rem; font-weight: 700;
  color: var(--text-primary); line-height: 1.3;
  flex: 1;
}
.card-distance {
  font-size: 0.72rem; font-weight: 700;
  color: var(--gold);
  background: rgba(245,200,66,0.1);
  padding: 2px 8px; border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.card-badge {
  display: inline-flex; align-items: center;
  font-size: 0.62rem; font-weight: 700;
  padding: 3px 8px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.badge-rccg    { background: rgba(34,211,200,0.12); color: var(--teal); }
.badge-deeper  { background: rgba(240,96,96,0.12);  color: var(--red); }
.badge-winners { background: rgba(245,200,66,0.12); color: var(--gold); }
.badge-mfm     { background: rgba(251,146,60,0.15); color: var(--orange); }
.badge-catholic{ background: rgba(167,139,250,0.15);color: var(--purple); }
.badge-anglican{ background: rgba(74,222,128,0.12); color: var(--green); }
.badge-default { background: rgba(139,160,184,0.12);color: var(--text-secondary); }

.card-address {
  font-size: 0.73rem; color: var(--text-secondary);
  line-height: 1.5; margin-bottom: 9px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer { display: flex; gap: 6px; }
.card-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 600;
  color: var(--teal);
  padding: 6px 11px;
  min-height: 34px;
  background: var(--teal-dim);
  border: 1px solid rgba(34,211,200,0.2);
  border-radius: 8px;
  transition: all var(--t-fast);
}
.card-link:hover { background: rgba(34,211,200,0.18); border-color: rgba(34,211,200,0.4); }

/* ── EMPTY STATE ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 28px 16px;
  color: var(--text-muted);
}
.empty-icon { font-size: 2.2rem; margin-bottom: 10px; opacity: 0.6; }
.empty-state p { font-size: 0.8rem; line-height: 1.65; }

/* ================================================================
   MAP PANEL
   ================================================================ */
.map-panel { flex: 1; position: relative; overflow: hidden; }
#map { width: 100%; height: 100%; }

/* Map tile attribution — keep small, styled dark */
.leaflet-control-attribution {
  background: rgba(8,15,26,0.82) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; opacity: 0.7; }
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
  width: 32px !important; height: 32px !important;
  line-height: 30px !important;
}
.leaflet-control-zoom a:hover { background: var(--bg-elevated) !important; }

/* ── FLOATING MAP STATS ──────────────────────────────────────────────── */
.map-stats {
  position: absolute; top: 14px; right: 14px; z-index: 400;
  display: flex; align-items: center;
  background: rgba(8,15,26,0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 7px 15px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s var(--ease);
}
.stats-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.73rem; font-weight: 600;
  color: var(--text-secondary);
}
.stats-item svg { color: var(--gold); flex-shrink: 0; }

/* ── FAB — pill style ────────────────────────────────────────────────── */
.fab {
  display: none;
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 24px;
  height: 52px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.1px;
  box-shadow: 0 8px 32px rgba(245,200,66,0.5), 0 2px 8px rgba(0,0,0,0.3);
  transition: transform var(--t-std) var(--ease-spring), box-shadow var(--t-std);
  white-space: nowrap;
}
.fab:hover { transform: translateX(-50%) scale(1.04); box-shadow: 0 12px 36px rgba(245,200,66,0.6); }
.fab:active { transform: translateX(-50%) scale(0.97); }

/* ================================================================
   LEAFLET MARKERS
   ================================================================ */
.church-pin {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.2);
}
.church-pin span { transform: rotate(45deg); font-size: 13px; }
.pin-rccg    { background: var(--teal); }
.pin-deeper  { background: var(--red); }
.pin-winners { background: var(--gold); }
.pin-mfm     { background: var(--orange); }
.pin-catholic{ background: var(--purple); }
.pin-anglican{ background: var(--green); }
.pin-default { background: var(--text-secondary); }

.user-pin {
  width: 14px; height: 14px;
  background: #4A9EF5;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(74,158,245,0.3);
  animation: userPulse 2s ease infinite;
}

/* Leaflet Popup */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.popup-content { padding: 2px; }
.popup-name {
  font-family: var(--font-head);
  font-weight: 700; font-size: 0.88rem;
  color: var(--gold); margin-bottom: 4px;
}
.popup-denom { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 4px; }
.popup-addr { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.45; margin-bottom: 4px; }
.popup-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 600;
  color: var(--teal);
  padding: 5px 10px;
  background: var(--teal-dim);
  border-radius: 6px;
  margin-top: 6px;
  transition: background var(--t-fast);
}
.popup-link:hover { background: rgba(34,211,200,0.2); }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s var(--ease-spring);
}
.modal-top {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 22px;
}
.modal-icon-wrap {
  width: 48px; height: 48px; flex-shrink: 0;
  background: var(--gold-glow);
  border: 1px solid rgba(245,200,66,0.2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.modal-svg { color: var(--gold); }
.modal-title {
  font-family: var(--font-head);
  font-size: 1rem; font-weight: 800;
  margin-bottom: 6px;
}
.modal-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; }
.btn-primary {
  padding: 13px; border-radius: var(--radius-sm);
  min-height: 48px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: var(--bg-deep); font-family: var(--font-head);
  font-weight: 700; font-size: 0.9rem;
  transition: all var(--t-std);
  box-shadow: 0 4px 16px rgba(245,200,66,0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,200,66,0.35); }
.btn-ghost {
  padding: 12px; border-radius: var(--radius-sm);
  min-height: 48px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.88rem; font-weight: 600;
  transition: all var(--t-std);
}
.btn-ghost:hover { background: var(--glass-hover); color: var(--text-primary); border-color: var(--border-hover); }

/* ================================================================
   LOADING OVERLAY
   ================================================================ */
.loading-overlay {
  position: fixed; inset: 0; z-index: 1500;
  background: rgba(8,15,26,0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s var(--ease);
}
.loading-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.spinner-ring {
  width: 46px; height: 46px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--gold);
  border-right-color: rgba(245,200,66,0.4);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
.loading-label {
  font-family: var(--font-head);
  font-size: 0.9rem; font-weight: 700;
  color: var(--text-primary);
}
.loading-sub { font-size: 0.73rem; color: var(--text-muted); }

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes livePulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}
@keyframes userPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(74,158,245,0.3); }
  50%      { box-shadow: 0 0 0 8px rgba(74,158,245,0.1); }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   RESPONSIVE — TABLET (max 960px)
   ================================================================ */
@media (max-width: 960px) {
  :root { --sidebar-w: 320px; }
}

/* ================================================================
   RESPONSIVE — MOBILE (max 700px)
   BOTTOM SHEET PATTERN
   ================================================================ */
@media (max-width: 700px) {
  :root { --sidebar-w: 100%; }

  .app-shell {
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }

  /* Sidebar becomes a full-width bottom sheet */
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-height: 88vh;
    border-right: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform var(--t-slow) var(--ease-smooth);
    z-index: 800;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.open {
    transform: translateY(0);
  }

  /* Show drag handle on mobile */
  .sheet-handle {
    display: flex;
    position: sticky;
    top: 0;
    background: var(--bg-base);
    z-index: 1;
    padding: 12px 0 6px;
  }

  /* Map takes full screen */
  .map-panel {
    width: 100%;
    height: calc(100vh - var(--nav-h));
    position: relative;
  }

  /* Show the FAB pill */
  .fab { display: flex; }

  /* Hide map stats on top-right on mobile — move to bottom-left */
  .map-stats {
    top: auto;
    bottom: max(82px, calc(env(safe-area-inset-bottom, 0px) + 82px));
    right: auto;
    left: 14px;
    right: 14px;
    justify-content: center;
    animation: slideInUp 0.3s var(--ease);
  }

  /* Hide navbar center status on mobile */
  .nav-center { display: none; }

  /* Stack select row vertically on narrow phones */
  .select-row { flex-direction: column; gap: 8px; }

  /* Search body scrolls within sheet */
  .search-body {
    max-height: calc(88vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Results panel slightly taller */
  .results-panel { max-height: 50vh; }

  /* Larger hero title on phone */
  .hero-title { font-size: 1.3rem; }
}

/* ================================================================
   RESPONSIVE — SMALL PHONE (max 390px)
   ================================================================ */
@media (max-width: 390px) {
  .navbar { padding: 0 14px; }
  .brand-name { font-size: 0.95rem; }
  .brand-country { display: none; }
  .modal-card { padding: 22px 16px; }
  .nav-pill span:last-child { display: none; }
  .fab { height: 48px; padding: 0 20px; font-size: 0.85rem; }
}

/* ── SIDEBAR OVERLAY backdrop ────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 790;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s var(--ease);
}
.sidebar-backdrop.show { display: block; }

/* ── TOAST ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(28px, calc(env(safe-area-inset-bottom, 0px) + 28px));
  left: 50%; z-index: 3000;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 22px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s var(--ease-spring), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}