/* Church CMS - Custom Styles */

/* ── Base ─────────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(160deg, #fff5f5 0%, #f8f0f0 50%, #f4f0fb 100%);
  background-attachment: fixed;
  color: #2d3748;
  min-height: 100vh;
}

/* ── Auth pages ───────────────────────── */
.auth-bg {
  background: linear-gradient(135deg, #c0392b 0%, #8e1a1a 30%, #6a1111 60%, #2d0a0a 100%);
  min-height: 100vh;
}

/* ── Navbar ───────────────────────────── */
.navbar {
  padding-top: .6rem;
  padding-bottom: .6rem;
  background: linear-gradient(90deg, #6a1111 0%, #8e1a1a 40%, #c0392b 100%) !important;
  box-shadow: 0 2px 12px rgba(142,26,26,.35);
}
.navbar-brand {
  font-size: 1.1rem;
  letter-spacing: .02em;
}
.nav-link {
  font-size: .9rem;
  padding: .4rem .75rem !important;
  border-radius: 8px;
  transition: background .15s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.18);
}

/* ── Cards ────────────────────────────── */
.card {
  transition: box-shadow .2s;
}
.card:hover {
  box-shadow: 0 6px 24px rgba(142,26,26,.10) !important;
}
.rounded-4 { border-radius: 1rem !important; }
.rounded-top-4 { border-top-left-radius: 1rem !important; border-top-right-radius: 1rem !important; }
.rounded-bottom-4 { border-bottom-left-radius: 1rem !important; border-bottom-right-radius: 1rem !important; }

/* ── Stat icon containers ─────────────── */
.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  min-height: 56px;
}

/* ── Step dots (registration wizard) ──── */
.step-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #dee2e6;
  transition: background .2s, transform .2s;
}
.step-dot.active {
  background: #c0392b;
  transform: scale(1.3);
}

/* ── Tables ───────────────────────────── */
.table-responsive { -webkit-overflow-scrolling: touch; }
.table th {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6c757d;
  white-space: nowrap;
}
.table td {
  font-size: .875rem;
  vertical-align: middle;
}

/* ── Leaflet map override ─────────────── */
.leaflet-container {
  font-family: inherit;
}

/* ── Attendance toggle switch ─────────── */
.form-switch .form-check-input:checked {
  background-color: #198754;
  border-color: #198754;
}

/* ── Attendance list touch targets ─────── */
.list-group-item label {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ── Badge subtle ─────────────────────── */
.bg-primary-subtle { background-color: #fde8e8 !important; }
.bg-success-subtle { background-color: #d1e7dd !important; }
.bg-warning-subtle { background-color: #fff3cd !important; }
.bg-info-subtle    { background-color: #cff4fc !important; }
.bg-danger-subtle  { background-color: #f8d7da !important; }

/* ── Scrollable card body ─────────────── */
.overflow-y-auto { overflow-y: auto; }

/* ── Btn primary red theme ────────────── */
.btn-primary {
  background: linear-gradient(135deg, #c0392b, #8e1a1a);
  border-color: #8e1a1a;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, #a93226, #7b1616);
  border-color: #7b1616;
}

/* ── Modal mobile scroll fix ──────────── */
.modal-dialog {
  margin: .5rem auto;
}
@media (max-width: 576px) {
  .modal-dialog { margin: .5rem; max-height: calc(100vh - 1rem); }
  .modal-content { max-height: calc(100vh - 2rem); overflow-y: auto; }
}

/* ── Mobile responsive polish ─────────── */
@media (max-width: 576px) {
  .container-fluid {
    padding-left: .75rem;
    padding-right: .75rem;
  }
  h5.fw-bold { font-size: 1rem; }
  .card-body { padding: .875rem !important; }
  .btn { font-size: .875rem; }
  .stat-icon { min-width: 44px; min-height: 44px; }
  .stat-icon i { font-size: 1.5rem !important; }
  .fs-2 { font-size: 1.4rem !important; }

  /* Groups cards full width on mobile */
  .col-12.col-md-6.col-xl-4 { flex: 0 0 100%; max-width: 100%; }

  /* Navbar collapse improvements */
  .navbar-collapse { background: rgba(0,0,0,.2); border-radius: 8px; padding: .5rem; margin-top: .4rem; }

  /* Table horizontal scroll */
  .table-responsive { border: 0; }
}

@media (max-width: 768px) {
  /* Attendance checklist items */
  .list-group-item { padding: .6rem .5rem; }
}

/* ── Profile picture zoom effect ─────── */
.pic-zoom {
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: zoom-in;
}
.pic-zoom:hover {
  transform: scale(1.18);
  box-shadow: 0 6px 20px rgba(0,0,0,.22) !important;
  z-index: 10;
  position: relative;
}

/* ── Members grid view ───────────────── */
.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
@media (max-width: 576px) {
  .member-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
}
.member-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 2px 12px rgba(142,26,26,.08);
  padding: 1.25rem .75rem 1rem;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.member-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(142,26,26,.15);
}
.member-card .member-pic {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
  margin: 0 auto .75rem;
  display: block;
}
.member-card .member-name {
  font-size: .875rem;
  font-weight: 600;
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-card .member-actions {
  display: flex;
  justify-content: center;
  gap: .3rem;
  margin-top: .6rem;
}
.member-card .status-dot {
  position: absolute;
  top: .6rem; right: .6rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── Lightbox overlay ─────────────────── */
#picLightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#picLightbox.show { display: flex; }
#picLightbox img {
  max-width: min(92vw, 480px);
  max-height: 80vh;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 8px 48px rgba(0,0,0,.5);
  animation: lbIn .18s ease;
}
@keyframes lbIn { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#picLightbox .lb-name {
  position: absolute;
  bottom: 2.5rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}

/* ── View toggle buttons ──────────────── */
.view-btn { transition: all .15s; }
.view-btn.active { background: #c0392b !important; color: #fff !important; border-color: #c0392b !important; }

/* ── Print ────────────────────────────── */
@media print {
  .navbar, .btn, form { display: none !important; }
}

.profile-editor {
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
}

.profile-editor__stage {
  width: min(100%, 320px);
  margin: 0 auto;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(145deg, #f8f9fa, #eef1f4);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}

.profile-editor__stage canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  cursor: grab;
}

.profile-editor__stage canvas:active {
  cursor: grabbing;
}

.profile-editor__controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  margin-top: .9rem;
}

.profile-editor__avatar-preview {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 3px solid #0d6efd;
}

.registration-choice .btn {
  height: 100%;
}

.registration-choice .btn-check:checked + .btn {
  color: #fff;
  border-color: transparent;
}

.registration-choice .btn-check[value="member"]:checked + .btn {
  background: linear-gradient(135deg, #c0392b, #8e1a1a);
}

.registration-choice .btn-check[value="visitor"]:checked + .btn {
  background: linear-gradient(135deg, #0dcaf0, #0b8fb0);
}
