/* ═══════════════════════════════════════════════════════════════
   Calvary Prayer Centre — main stylesheet
   Modern card design system: soft layered shadows, hover-lift,
   circular icon badges, rounded-14/16px cards.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --purple: #4B1D6B;
  --purple-dark: #2E0F42;
  --purple-light: #6A2C93;
  --gold: #D4AF37;
  --gold-light: #E8C97A;
  --cream: #FAF6EE;
  --text: #2A2130;
  --muted: #6b7280;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(43,17,66,.06), 0 1px 2px rgba(43,17,66,.05);
  --shadow: 0 6px 20px rgba(75,29,107,.08);
  --shadow-md: 0 10px 30px rgba(75,29,107,.12);
  --shadow-lg: 0 20px 48px rgba(43,17,66,.18);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--text);
  background: var(--cream);
  margin: 0;
  padding-top: 76px;
}

h1, h2, h3, h4, .brand-font {
  font-family: 'Playfair Display', Georgia, serif;
}

a { text-decoration: none; }

/* ── Preloader ─────────────────────────────────────────────────── */
#page-preloader {
  position: fixed; inset: 0; z-index: 99999;
  background: linear-gradient(160deg, var(--purple-dark), var(--purple));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity .5s ease, visibility .5s ease;
}
#page-preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader-cross {
  font-size: 2.6rem; color: var(--gold);
  animation: preloaderPulse 1.4s ease-in-out infinite;
}
.preloader-ring {
  width: 46px; height: 46px; margin-top: 14px;
  border: 3px solid rgba(212,175,55,.25); border-top-color: var(--gold);
  border-radius: 50%; animation: preloaderSpin 1s linear infinite;
}
.preloader-text {
  margin-top: 14px; color: #f3e9d2; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
}
@keyframes preloaderSpin { to { transform: rotate(360deg); } }
@keyframes preloaderPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }

/* ── Header / Navbar ───────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
  background: linear-gradient(180deg, var(--purple-dark), var(--purple));
  box-shadow: 0 2px 18px rgba(0,0,0,.25);
}
.site-header .navbar-brand { color: #fff !important; display: flex; align-items: center; gap: 10px; }
.site-header .navbar-brand .cross { color: var(--gold); font-size: 1.5rem; }
.site-header .navbar-brand .brand-sub { display: block; font-size: .62rem; letter-spacing: .15em; color: rgba(255,255,255,.6); text-transform: uppercase; }
.site-header .nav-link { color: rgba(255,255,255,.85) !important; font-weight: 500; }
.site-header .nav-link.active, .site-header .nav-link:hover { color: var(--gold) !important; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--purple-dark) !important; border: none; font-weight: 600;
  box-shadow: 0 6px 16px rgba(212,175,55,.35); transition: transform .2s, box-shadow .2s, filter .2s;
}
.btn-gold:hover { filter: brightness(1.08); color: var(--purple-dark) !important; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(212,175,55,.45); }
.btn-outline-gold { border: 1.5px solid var(--gold); color: var(--gold) !important; font-weight: 600; transition: all .2s; }
.btn-outline-gold:hover { background: var(--gold); color: var(--purple-dark) !important; transform: translateY(-2px); }
.btn-check:checked + .btn-outline-gold, .btn-check:active + .btn-outline-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--purple-dark) !important;
  border-color: var(--gold); box-shadow: 0 4px 14px rgba(212,175,55,.4);
}

/* ── Search box + dropdown (shared: public + admin) ────────────── */
.search-wrap { position: relative; max-width: 340px; }
.search-wrap input {
  border-radius: 50px; padding: 8px 40px 8px 16px; border: 1.5px solid rgba(212,175,55,.4);
  font-size: .88rem; width: 100%;
}
.search-wrap .search-icon {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--gold); pointer-events: none;
}
.search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border-radius: 12px; border: 1.5px solid rgba(212,175,55,.35);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 2000; max-height: 320px; overflow-y: auto;
}
.search-dropdown a {
  display: block; padding: 10px 16px; color: var(--text); font-size: .88rem; border-bottom: 1px solid #f1eee6;
}
.search-dropdown a:hover { background: var(--cream); color: var(--purple); }
.search-dropdown .empty { padding: 12px 16px; color: #999; font-size: .85rem; }

/* ── Hero slider ────────────────────────────────────────────────── */
.hero { position: relative; min-height: 88vh; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease-in-out; z-index: 0; }
.hero-slide.active { opacity: 1; z-index: 1; }
.hero-slide .bg { width: 100%; height: 100%; background-size: cover; background-position: center; }
.hero-overlay { position: absolute; inset: 0; background: radial-gradient(circle at top, rgba(75,29,107,.55), rgba(20,8,30,.88)); z-index: 2; }
.hero-content { position: relative; z-index: 3; max-width: 900px; padding: 2rem; color: #fff; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 18px; border-radius: 50px;
  background: rgba(212,175,55,.15); border: 1.5px solid rgba(212,175,55,.5); color: var(--gold-light);
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1.2rem;
}
.hero-content h1 { font-size: 2.6rem; text-shadow: 2px 2px 12px rgba(0,0,0,.7); }
.hero-content p { font-size: 1.1rem; color: #eee2d6; max-width: 640px; margin: 1rem auto; line-height: 1.7; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12);
  border: 1.5px solid rgba(212,175,55,.5); color: var(--gold); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
}
.hero-arrow:hover { background: rgba(212,175,55,.25); }
.hero-arrow.prev { left: 18px; } .hero-arrow.next { right: 18px; }
.hero-dots { position: absolute; bottom: 1.6rem; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 8px; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.5); cursor: pointer; padding: 0; transition: all .3s; }
.hero-dot.active { background: var(--gold); border-color: var(--gold); transform: scale(1.3); }

/* ── Scroll FABs ────────────────────────────────────────────────── */
.scroll-fab {
  position: fixed; right: 20px; z-index: 1040; width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light)); color: var(--purple-dark);
  border: none; display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); opacity: 0; visibility: hidden; transition: all .3s ease;
}
.scroll-fab.show { opacity: 1; visibility: visible; }
.scroll-fab:hover { transform: translateY(-3px); }
#scrollTopBtn { bottom: 84px; }
#scrollBottomBtn { bottom: 26px; }

/* ── Sections / cards ───────────────────────────────────────────── */
.section { padding: 4.5rem 0; }
.section-eyebrow {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); background: rgba(212,175,55,.12); padding: 5px 16px; border-radius: 50px; margin-bottom: .75rem;
}
.section-title { color: var(--purple); font-weight: 700; }
.section-title .accent { color: var(--gold); }
.card-soft {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); border: none;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card-soft.hoverable:hover, a.card-soft:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }

/* Feature / offering cards */
.feature-card {
  background: #fff; border-radius: var(--radius); padding: 2rem 1.6rem; height: 100%;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(75,29,107,.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.feature-card.has-photo { padding: 0; overflow: hidden; }
.feature-card.has-photo .feature-card-photo { width: 100%; height: 160px; object-fit: cover; display: block; }
.feature-card.has-photo .feature-card-body { padding: 1.6rem; }
.feature-card.has-photo .icon-badge {
  position: relative; margin-top: -44px; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.icon-badge {
  width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(75,29,107,.1), rgba(212,175,55,.15)); color: var(--purple);
  font-size: 1.5rem; margin-bottom: 1rem;
}
.icon-badge.round { border-radius: 50%; }

/* Programme cards */
.programme-day-card { border-left: 4px solid var(--gold); background: #fff; border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: .75rem; }
.programme-day-card .time { color: var(--purple); font-weight: 600; font-size: .82rem; }

/* Donor list */
.donor-row {
  display: flex; justify-content: space-between; align-items: center; padding: .65rem 0;
  border-bottom: 1px solid #f1eee6;
}
.donor-row:last-child { border-bottom: none; }
.donor-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--purple); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; margin-right: 10px;
}

/* Portrait avatars (About page) */
.avatar-circle {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--gold); box-shadow: var(--shadow-md); margin-bottom: 1rem;
}

/* Cover banner (admin dashboard, gallery-style headers) */
.cover-banner {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem;
  min-height: 170px; display: flex; align-items: center; padding: 0 2rem; color: #fff;
}
.cover-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.cover-banner::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(120deg, rgba(43,17,66,.9), rgba(75,29,107,.6));
}
.cover-banner-content { position: relative; z-index: 2; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer { background: var(--purple-dark); color: rgba(255,255,255,.75); padding: 3rem 0 1.5rem; }
.site-footer h5 { color: var(--gold-light); }
.site-footer a { color: rgba(255,255,255,.7); }
.site-footer a:hover { color: var(--gold); }

/* ── Auth / form cards (login, register, reset) ─────────────────── */
.auth-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  max-width: 480px; margin: 0 auto;
}
.auth-card-head {
  background: linear-gradient(135deg, rgba(46,15,66,.9), rgba(75,29,107,.85)),
              url('https://picsum.photos/seed/calvary-auth-bg/900/500');
  background-size: cover; background-position: center;
  padding: 2.2rem 2rem 1.6rem; text-align: center; color: #fff; position: relative;
}
.auth-card-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 28px; background: #fff;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.auth-card-icon {
  width: 60px; height: 60px; border-radius: 50%; background: rgba(212,175,55,.18); border: 1.5px solid rgba(212,175,55,.5);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--gold); margin: 0 auto .75rem;
}
.auth-card-body { padding: 1rem 2.2rem 2.2rem; }
.form-floating-icon { position: relative; }
.form-floating-icon i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--gold); z-index: 5;
}
.form-floating-icon input, .form-floating-icon select, .form-floating-icon textarea {
  padding-left: 42px !important;
}

/* ── Admin layout (sidebar) ────────────────────────────────────── */
.admin-body { padding-top: 66px; background: #F5F2FA; }
.admin-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; background: var(--purple-dark); height: 66px; box-shadow: 0 2px 14px rgba(0,0,0,.2); }
.admin-topbar .brand { color: #fff; font-weight: 600; }

.admin-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 1045;
  background: linear-gradient(180deg, var(--purple-dark), var(--purple));
  display: flex; flex-direction: column; transform: translateX(-100%);
  transition: transform .3s ease; overflow-y: auto; box-shadow: 4px 0 24px rgba(0,0,0,.2);
}
.admin-sidebar.show { transform: translateX(0); }
.admin-sidebar-cover { position: relative; height: 130px; flex-shrink: 0; }
.admin-sidebar-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.admin-sidebar-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(43,17,66,.25), rgba(43,17,66,.95));
}
.admin-sidebar-cover .brand-block { position: absolute; bottom: 10px; left: 16px; right: 16px; z-index: 2; color: #fff; }
.admin-sidebar-cover .brand-block strong { font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.admin-sidebar-nav { padding: .75rem 0; flex: 1; }
.admin-sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: .68rem 1.35rem; color: rgba(255,255,255,.78);
  font-size: .88rem; border-left: 3px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.admin-sidebar-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.admin-sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar-nav a.active { background: rgba(212,175,55,.15); color: var(--gold-light); border-left-color: var(--gold); }
.admin-sidebar-nav hr { border-color: rgba(255,255,255,.12); margin: .5rem 1.25rem; }
.admin-sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.12); flex-shrink: 0; }
.admin-overlay {
  position: fixed; inset: 0; background: rgba(20,8,30,.5); z-index: 1040; display: none; backdrop-filter: blur(1px);
}
.admin-overlay.show { display: block; }
@media (min-width: 992px) {
  .admin-sidebar { transform: translateX(0); }
  .admin-topbar { left: 260px; }
  .admin-main { margin-left: 260px; width: calc(100% - 260px); max-width: calc(100% - 260px); }
  #sidebarToggle { display: none; }
  #adminChatFab { left: 280px; }
}
.dash-tile {
  background: #fff; border-radius: var(--radius); padding: 1.5rem 1rem; text-align: center; display: block;
  box-shadow: var(--shadow-sm); border: 1px solid rgba(75,29,107,.06);
  transition: transform .2s ease, box-shadow .2s ease; color: var(--text); position: relative;
}
.dash-tile::before, .stat-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden;
  background-image: url('https://picsum.photos/seed/calvary-card-texture/400/300');
  background-size: cover; background-position: center; opacity: .05;
}
.dash-tile > * { position: relative; z-index: 1; }
.dash-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); color: var(--purple); }
.dash-tile .icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(75,29,107,.1), rgba(212,175,55,.15));
  font-size: 1.4rem; margin: 0 auto .6rem;
}
.dash-tile .badge-count {
  position: absolute; top: -8px; right: -8px; background: #E24C4C; color: #fff; border-radius: 50%;
  width: 24px; height: 24px; font-size: .72rem; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(226,76,76,.5); z-index: 2;
}
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(75,29,107,.06); display: flex; align-items: center; gap: 14px;
  transition: transform .2s ease, box-shadow .2s ease; position: relative; overflow: hidden;
}
.stat-card > * { position: relative; z-index: 1; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--purple), var(--purple-light)); color: #fff; font-size: 1.3rem;
}
.stat-card .num { font-size: 1.5rem; font-weight: 700; color: var(--purple); line-height: 1.1; }
.stat-card .stat-label { font-size: .78rem; color: var(--muted); font-weight: 500; }

/* ── Print ──────────────────────────────────────────────────────── */
@media print {
  .no-print, .site-header, .site-footer, .scroll-fab, .search-dropdown, #page-preloader { display: none !important; }
  body { padding-top: 0 !important; background: #fff; }
}

/* ── Zebra striping for admin data tables ──────────────────────────── */
.table tbody tr:nth-of-type(odd) > * {
  background-color: rgba(75, 29, 107, .035);
}
.table-hover tbody tr:nth-of-type(odd):hover > * {
  background-color: rgba(212, 175, 55, .12);
}
