/*
 * app.css — Khatam & Salawat Platform
 * Page-specific styles extracted from Flock's org-page.html inline <style>
 * block (lines 11–155) and admin.html (lines 44–49).
 * Only Khatam/Salawat-relevant selectors are included.
 * Source: org-page.html
 */

/* ── BRAND TOKEN OVERRIDES ── */
/* Replaces Flock's brown/sand palette with the Khatam & Salawat navy/blue theme. */
:root {
  --br: #1E293B;
  --bm: #4A6FA5;
  --bl: #6B7280;
  --sa: #F5F7FA;
  --sd: #EEF1F7;
  --cr: #FFFFFF;
  --bo: #E2E8F0;
  --su: #4A6FA5;
  --go: #4A6FA5;
  --wh: #FFFFFF;
}

/* ── BASE RESET ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", sans-serif;
  background: var(--sd);
  color: var(--br);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── PAGE SHELL ── */
.page-header {
  background: var(--cr);
  border-bottom: 1px solid var(--bo);
  padding: 32px 24px 24px;
}
.page-header-inner {
  max-width: 720px;
  margin: 0 auto;
}
.page-title {
  font-family: "Playfair Display", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--br);
  letter-spacing: -.4px;
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--bm);
  font-weight: 300;
  line-height: 1.6;
}
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── KHATAM PROGRESS BAR ── */
/* Source: org-page.html lines 78–79 */
.progress-bar {
  height: 6px;
  background: var(--bo);
  border-radius: 100px;
  overflow: hidden;
  margin: 8px 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--br), var(--bm));
  border-radius: 100px;
  transition: width .8s ease;
}

/* ── KHATAM JUZ GRID ── */
/* Source: org-page.html lines 80–85 */
.juz-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-bottom: 14px;
}
.juz-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: "Lora", serif;
  cursor: pointer;
  transition: all .15s;
}
.juz-taken {
  background: var(--br);
  color: var(--sa);
  cursor: default;
}
.juz-free {
  background: var(--sa);
  color: var(--bm);
  border: 1.5px solid var(--bo);
}
.juz-free:hover {
  background: var(--go);
  color: var(--wh);
  border-color: var(--go);
  transform: scale(1.08);
}
.juz-completed {
  background: var(--su);
  color: var(--wh);
  cursor: default;
}

/* ── ADMIN JUZ GRID ── */
/* Source: admin.html lines 44–49 */
.admin-juz-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 12px;
}
.admin-juz-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  font-family: "Lora", serif;
}
.ajuz-free       { background: var(--sa); color: var(--bm); border: 1px solid var(--bo); }
.ajuz-taken      { background: var(--br); color: var(--sa); }
.ajuz-completed  { background: var(--su); color: var(--wh); }

/* ── SALAWAT COUNTER ── */
/* Source: org-page.html lines 88–93 */
.salawat-num {
  font-family: "Lora", serif;
  font-size: 64px;
  font-weight: 700;
  color: var(--br);
  letter-spacing: -3px;
  line-height: 1;
  text-align: center;
  margin-bottom: 4px;
}
.salawat-lbl {
  font-size: 13px;
  color: var(--bm);
  text-align: center;
  margin-bottom: 16px;
  font-weight: 300;
}
.salawat-arabic {
  font-size: 22px;
  color: var(--br);
  direction: rtl;
  font-weight: 500;
  line-height: 1.8;
  text-align: center;
  margin-bottom: 4px;
}
.salawat-trans {
  font-size: 12px;
  color: var(--bm);
  font-style: italic;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 300;
}
.pledge-btn {
  width: 100%;
  padding: 13px;
  background: var(--sa);
  border: 1.5px solid var(--bo);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--br);
  cursor: pointer;
  transition: all .2s;
}
.pledge-btn:hover { background: var(--br); color: var(--sa); }

/* ── PLEDGE FEED ── */
.pledge-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--bo);
}
.pledge-item:last-child { border-bottom: none; }
.pledge-name {
  font-family: "Lora", serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--br);
  margin-bottom: 2px;
}
.pledge-amount { font-size: 13px; color: var(--bm); font-weight: 300; }
.pledge-time   { font-size: 11px; color: var(--bl); margin-top: 3px; }

/* ── BOTTOM SHEET MODALS ── */
/* Source: org-page.html lines 104–118 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,41,59,.6);
  z-index: 300;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.bottom-sheet {
  background: var(--wh);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px 40px;
  width: 100%;
  max-width: 480px;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--bo);
  border-radius: 100px;
  margin: 0 auto 20px;
}
.sheet-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--br);
  margin-bottom: 6px;
}
.sheet-sub {
  font-size: 14px;
  color: var(--bm);
  font-weight: 300;
  margin-bottom: 18px;
}
.sheet-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--bo);
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  color: var(--br);
  background: var(--sa);
  outline: none;
  margin-bottom: 14px;
  transition: border-color .2s;
}
.sheet-input:focus {
  border-color: var(--br);
  background: var(--wh);
  box-shadow: var(--focus-ring);
}
.sheet-btn {
  width: 100%;
  padding: 14px;
  background: var(--br);
  color: var(--sa);
  border: none;
  border-radius: 10px;
  font-family: "Lora", serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: opacity .2s;
}
.sheet-btn:hover { opacity: .88; }
.sheet-cancel {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--bm);
  cursor: pointer;
}

/* ── PLEDGE AMOUNT SELECTOR ── */
/* Source: org-page.html lines 116–118 */
.pledge-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.amt-btn {
  padding: 12px 8px;
  background: var(--sa);
  border: 1.5px solid var(--bo);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--br);
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.amt-btn:hover,
.amt-btn.sel { background: var(--br); color: var(--sa); border-color: var(--br); }

/* ── EMPTY STATE ── */
/* Source: org-page.html lines 121–125 */
.empty-state { text-align: center; padding: 32px 20px; color: var(--bm); }
.empty-icon  { margin-bottom: 10px; display: flex; align-items: center; justify-content: center; }
.empty-icon img { filter: brightness(0) opacity(.3); }
.empty-title { font-family: "Lora", serif; font-size: 16px; font-weight: 700; color: var(--br); margin-bottom: 6px; }
.empty-sub   { font-size: 13px; font-weight: 300; line-height: 1.5; }

/* ── FOOTER ── */
.powered-by {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--bl);
}
.powered-by a {
  color: var(--bm);
  font-weight: 600;
  text-decoration: none;
  font-family: "Lora", serif;
}

/* ── LANDING PAGE FEATURE CARDS (index.html) ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.feature-card {
  background: var(--wh);
  border: 1px solid var(--bo);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-card:hover {
  box-shadow: 0 8px 28px rgba(61,32,16,.12);
  transform: translateY(-3px);
  border-color: var(--bm);
}
.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--sa);
  border-radius: 10px;
  border: 1px solid var(--bo);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature-icon img { filter: brightness(0) opacity(.55); }
.feature-name {
  font-family: "Lora", serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--br);
}
.feature-desc {
  font-size: 13px;
  color: var(--bm);
  font-weight: 300;
  line-height: 1.55;
}
.feature-cta {
  font-size: 12px;
  font-weight: 700;
  color: var(--bm);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--bo);
}

/* ── KHATAM CONTENT (public page) ── */
.khatam-header { margin-bottom: 16px; }
.khatam-title {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--br);
  margin-bottom: 6px;
  line-height: 1.3;
}
.khatam-reason {
  font-size: 13px;
  color: var(--bm);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.5;
}
.khatam-stat {
  font-size: 14px;
  font-weight: 600;
  color: var(--bm);
  margin-bottom: 8px;
}
.khatam-claim-hint {
  font-size: 11px;
  color: var(--bl);
  text-align: center;
  margin-top: 8px;
}
.khatam-footer-msg {
  font-size: 12px;
  color: var(--bl);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

/* ── MOBILE ── */
@media (max-width: 600px) {
  .page-header  { padding: 20px 16px 18px; }
  .page-content { padding: 16px; }
  .page-title   { font-size: 20px; }
  .salawat-num  { font-size: 52px; }
  .juz-grid     { grid-template-columns: repeat(5, 1fr); }
  .admin-juz-grid { grid-template-columns: repeat(6, 1fr); }
  .pledge-amounts { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
}
