/* Triumphant Baptist Church (English Church) CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette Variables - drawn from the Triumphant Baptist Church crest
     (navy pillars + crimson cross) so every screen matches the logo. */
  --ff-primary: #0F2F5B;
  --ff-primary-dark: #0A2142;
  --ff-primary-rgb: 15, 47, 91;
  --ff-secondary: #B3151A;
  --ff-secondary-dark: #8C1014;
  --ff-secondary-rgb: 179, 21, 26;
  --ff-secondary-on-dark: #F04D51; /* brighter crimson for use on the navy login panel - #B3151A reads too dark there */
  --ff-bg: #F7F9FC;
  --ff-surface: #FFFFFF;
  --ff-border: #E2E8F0;

  --ff-text-primary: #0F172A;
  --ff-text-secondary: #64748B;

  /* Status Colors */
  --ff-success: #166534;
  --ff-success-bg: #DCFCE7;

  --ff-warning: #991B1B;
  --ff-warning-bg: #FEE2E2;

  --ff-info: #0369A1;
  --ff-info-bg: #E0F2FE;

  --ff-font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ff-font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Single-layer elevation used across cards/widgets - one restrained shadow
     instead of a stacked glow, kept flat rather than animating on hover. */
  --ff-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 10px rgba(15, 23, 42, 0.06);

  --ff-transition-speed: 0.3s;
}




/* Base resets & typography */
body {
  font-family: var(--ff-font-body);
  background-color: var(--ff-bg);
  color: var(--ff-text-primary);
  min-height: 100vh;
  margin: 0;
  padding-bottom: 75px; /* Space for mobile bottom-nav */
  overflow-x: hidden;
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-font-heading);
  color: var(--ff-primary);
  font-weight: 700;
  letter-spacing: -0.3px;
}

p {
  color: var(--ff-text-secondary);
}

.fw-extrabold {
  font-weight: 800 !important;
}

/* Elevation-only Card Aesthetics (no border strokes) */
.ff-card {
  background-color: var(--ff-surface);
  border: none;
  border-radius: 12px;
  box-shadow: var(--ff-shadow);
}

/* Buttons */
.btn {
  border-radius: 10px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--ff-primary) !important;
  border-color: var(--ff-primary) !important;
  color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--ff-primary-dark) !important;
  border-color: var(--ff-primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--ff-primary-rgb), 0.25);
}

.btn-secondary {
  background-color: var(--ff-secondary) !important;
  border-color: var(--ff-secondary) !important;
  color: #fff !important;
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--ff-secondary-dark) !important;
  border-color: var(--ff-secondary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--ff-secondary-rgb), 0.25);
}

/* Table styling: modern and borderless card style */
.table {
  color: var(--ff-text-primary);
}

.table-light {
  background-color: #f1f5f9 !important;
}

.table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--ff-text-secondary);
  padding: 14px 16px;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid var(--ff-border);
}

/* Badges */
.badge {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-present {
  background-color: var(--ff-success-bg) !important;
  color: var(--ff-success) !important;
  border: 1px solid rgba(22, 101, 52, 0.1);
}

.badge-absent {
  background-color: var(--ff-warning-bg) !important;
  color: var(--ff-warning) !important;
  border: 1px solid rgba(153, 27, 27, 0.1);
}

.badge-excused {
  background-color: var(--ff-info-bg) !important;
  color: var(--ff-info) !important;
  border: 1px solid rgba(3, 105, 161, 0.1);
}

/* QR Check-In kiosk overlay - big pass/fail flash shown over the camera
   preview for a couple seconds after each scan, then clears for the next
   person in line. */
.qr-scan-wrapper {
  position: relative;
}

.qr-scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  color: #fff;
  animation: qrOverlayPop 0.2s ease-out;
}

.qr-scan-overlay.qr-scan-overlay-success {
  background: rgba(22, 101, 52, 0.96);
}

.qr-scan-overlay.qr-scan-overlay-error {
  background: rgba(153, 27, 27, 0.96);
}

.qr-scan-overlay-icon,
#qr-scan-overlay-icon {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 12px;
}

.qr-scan-overlay-title {
  font-size: 22px;
  font-weight: 800;
}

.qr-scan-overlay-subtitle {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
  margin-top: 4px;
}

@keyframes qrOverlayPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* Form inputs */
.form-control, .form-select {
  border: 1px solid var(--ff-border);
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ff-secondary);
  box-shadow: 0 0 0 3px rgba(var(--ff-secondary-rgb), 0.12);
}

/* Touch targets */
.touch-target, .btn, .nav-link, .bottom-nav-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tabbed pages (Members, Care, Events, Finance, Reports): on narrow screens,
   scroll the tab bar horizontally instead of letting it wrap into a tall,
   multi-row stack. */
@media (max-width: 767.98px) {
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .nav-tabs .nav-item {
    flex: 0 0 auto;
  }
  .nav-tabs .nav-link {
    white-space: nowrap;
  }
}

/* Bottom Navigation (Mobile SPA feel) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  z-index: 1030;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.04);
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

/* Fills the bar edge-to-edge when few items fit, scrolls when they don't */
@media (min-width: 480px) {
  .bottom-nav {
    justify-content: space-around;
  }
}

.bottom-nav-item {
  flex: 0 0 auto;
  min-width: 66px;
}

.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ff-text-secondary);
  font-size: 10px;
  font-weight: 500;
  height: 100%;
  transition: all var(--ff-transition-speed) ease;
}

.bottom-nav-link i {
  font-size: 20px;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.bottom-nav-link.active {
  color: var(--ff-secondary);
  font-weight: 600;
}

.bottom-nav-link.active i {
  transform: translateY(-2px);
  color: var(--ff-secondary);
}

/* Sidebar (Desktop SPA feel) */
.desktop-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background-color: var(--ff-primary);
  color: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 12px;
  margin: 6px 16px;
  font-weight: 500;
  font-size: 14px;
  justify-content: flex-start;
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link i {
  font-size: 16px;
  width: 18px;
  text-align: center;
}

.main-content {
  flex-grow: 1;
  background-color: var(--ff-bg);
  padding: 32px;
  overflow-y: auto;
}

@media (max-width: 991.98px) {
  .sidebar {
    display: none;
  }
  .main-content {
    padding: 20px;
    width: 100%;
  }
  /* Page headers pair a title with 0-3 action buttons via d-flex justify-content-between.
     On phones, stack the title above the buttons and let the button row itself wrap,
     instead of squeezing everything onto one overflowing line. */
  .main-content > header.d-flex {
    flex-wrap: wrap;
    row-gap: 12px;
  }
  .main-content > header.d-flex > div:last-child:not(:only-child) {
    flex-wrap: wrap;
    width: 100%;
  }
}

/* Login Page - split panel: brand identity on one side, the form on the
   other. No floating card/shadow - the panels themselves fill the screen. */
.login-shell {
  min-height: 100vh;
  display: flex;
}

.login-brand-panel {
  position: relative;
  display: none;
  flex: 0 0 42%;
  max-width: 520px;
  background-color: var(--ff-primary-dark);
  padding: 56px;
  overflow: hidden;
}

.login-brand-watermark {
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 420px;
  height: auto;
  opacity: 0.06;
  filter: grayscale(1) brightness(2);
  pointer-events: none;
}

.login-brand-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand-crest {
  height: 56px;
  width: auto;
  margin-bottom: 28px;
}

.login-eyebrow {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.login-eyebrow-rule {
  display: block;
  width: 44px;
  height: 3px;
  background-color: var(--ff-secondary);
  border-radius: 2px;
  margin: 14px 0 22px;
}

.login-brand-title {
  color: #fff;
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 8px;
}

.login-brand-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  margin-bottom: 40px;
}

.login-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
}

.login-feature-list i {
  color: var(--ff-secondary);
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ff-surface);
  padding: 32px 20px;
}

.login-form-wrap {
  width: 100%;
  max-width: 380px;
}

.login-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-form-logo-sm {
  height: 32px;
  width: auto;
}

.login-form-title {
  margin-bottom: 4px;
}

.login-footer-note {
  text-align: center;
  color: var(--ff-text-secondary);
  font-size: 12px;
  margin: 24px 0 0;
}

@media (min-width: 992px) {
  .login-brand-panel {
    display: block;
  }
}

/* Onboarding Guides on Empty Database */
.onboarding-card {
  background-color: var(--ff-primary);
  color: #fff;
  border-radius: 14px;
  padding: 28px;
  border: none;
}

.onboarding-card h5 {
  color: #fff;
}

/* Role / Authentication Header Widget */
.profile-header-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 8px 16px;
  border-radius: 12px;
  border: none;
  box-shadow: var(--ff-shadow);
}

.profile-header-widget .logout-btn {
  color: var(--ff-warning);
  background: var(--ff-warning-bg);
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.profile-header-widget .logout-btn:hover {
  background-color: #fca5a5;
  transform: scale(1.05);
}

/* Quick Action Widgets */
.quick-action-btn {
  background-color: var(--ff-surface);
  border: none;
  padding: 20px;
  border-radius: 12px;
  text-align: left;
  text-decoration: none;
  color: var(--ff-text-primary);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--ff-shadow);
  transition: box-shadow 0.2s ease, color 0.2s ease;
}

.quick-action-btn:hover {
  color: var(--ff-secondary-dark);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px rgba(15, 23, 42, 0.1);
}

.quick-action-btn i {
  font-size: 28px;
  color: var(--ff-secondary);
  background-color: rgba(var(--ff-secondary-rgb), 0.08);
  padding: 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.quick-action-btn:hover i {
  background-color: var(--ff-secondary);
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--ff-bg);
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Admin Settings Page Styles */
.settings-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ff-text-secondary);
  padding: 0 4px;
  margin-bottom: 12px;
  margin-top: 28px;
}

.settings-section-header:first-child {
  margin-top: 0;
}

.settings-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--ff-shadow);
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  gap: 16px;
  transition: background-color 0.15s ease;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row:hover {
  background-color: #fafbfc;
}

.settings-row-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--ff-text-primary);
  margin-bottom: 2px;
}

.settings-row-desc {
  font-size: 12px;
  color: var(--ff-text-secondary);
}

.leader-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--ff-shadow);
}

.leader-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: var(--ff-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

/* Remove colored left-border strokes from stat cards (set in inline style previously) */
.stat-card {
  border-left: none !important;
}

/* Cool blue-gray text scale used throughout markup, complements the navy brand */
.text-slate-600 { color: #475569 !important; }
.text-slate-700 { color: #334155 !important; }
.text-slate-800 { color: var(--ff-text-primary) !important; }
.border-slate-200 { border-color: var(--ff-border) !important; }

/* Rows that pair a label/description with a value or action button
   (Admin Settings rows, Leader/Officer cards) - stack instead of
   squeezing both sides onto one overflowing line on phones. */
@media (max-width: 575.98px) {
  .settings-row,
  .leader-card {
    flex-wrap: wrap;
  }
  .leader-card > div:last-child {
    flex-direction: row !important;
    width: 100%;
  }
}

/* QR check-in scanner (attendance.html) - html5-qrcode injects its own
   video/canvas element sized off the camera's native resolution, which can
   exceed the modal's width on some devices unless explicitly capped. */
#qr-reader video,
#qr-reader canvas,
#qr-reader img {
  max-width: 100% !important;
  height: auto !important;
}

@media print {
  body {
    background-color: #fff;
    padding: 0;
  }
  .no-print {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
}
