/* ============================================================
   نادم — Dhikr Detail (single session) · mobile
   Same system as Home: turquoise + gold + cream · Persian-Islamic
   ============================================================ */

@import url("assets/fonts/fonts.css");

:root {
  --t-950: #063b39;
  --t-900: #0a4b47;
  --t-800: #0b5c56;
  --t-700: #0d6c64;
  --t-600: #0f8077;
  --t-100: #e3f1ec;

  --g-700: #9c7726;
  --g-600: #b6862c;
  --g-500: #c79a3a;
  --g-400: #d8b25a;
  --g-300: #e7cd86;
  --g-200: #f2e3b4;
  --g-100: #f6ead0;

  --cream: #f7f1e4;
  --cream-2: #fbf6ea;
  --paper: #fffdf7;
  --ink: #1a322e;
  --muted: #75837d;
  --line: rgba(12, 92, 86, 0.14);
  --gold-line: rgba(156, 119, 38, 0.34);

  --shadow-card: 0 16px 38px rgba(10, 64, 60, 0.12);
  --shadow-soft: 0 8px 22px rgba(10, 64, 60, 0.09);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  min-height: 100svh;
}

/* --------- content column (web-app, mobile-first, no frame clipping) --------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 412px;
  min-height: 100svh;
  margin: 0 auto;
  background: var(--cream);
  color: var(--ink);
  direction: rtl;
}

/* ================= BRAND HEAD (floating crest) =================
   Same header as the rest of the app: at rest the logo floats free —
   no backdrop. --shrink (0→1) — driven by an inertial scroll listener —
   scales the logo down, gathers the gold wings into it and fades in a
   soft borderless cream panel hanging from the top edge. Back / share
   buttons float at the sides and stay put. */
.brandhead {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 412px;
  z-index: 30;
  padding-bottom: calc(22px - 8px * var(--shrink, 0));
  pointer-events: none; /* scroll gestures pass through to the content */
}
.brand-ribbon {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: calc(118px - 18px * var(--shrink, 0));
  transform: translateX(-50%);
  z-index: -1;
  opacity: var(--shrink, 0);
  filter: drop-shadow(0 10px 18px rgba(6, 59, 57, calc(0.3 * var(--shrink, 0))));
}
.brand-ribbon .rb {
  position: absolute; inset: 0; display: block;
  border-radius: 0 0 26px 26px;
  background:
    radial-gradient(90% 56% at 50% 0%, rgba(15, 128, 119, 0.07), transparent 75%),
    linear-gradient(180deg, rgba(241, 231, 208, 0.94) 0%, rgba(247, 239, 222, 0.88) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  backdrop-filter: blur(10px) saturate(1.2);
}
.statusbar {
  position: relative;
  z-index: 2;
  height: 40px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  font-size: 13px; font-weight: 700; color: var(--t-800);
  text-shadow: 0 0 3px var(--cream), 0 0 10px var(--cream), 0 1px 14px var(--cream);
}
.statusbar .sb { display: flex; align-items: center; gap: 6px; }
.statusbar .sb i { width: 16px; height: 16px; }

/* wider side padding keeps the wings clear of the floating nav buttons */
.brandbar {
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  margin-top: 14px;
  padding: 0 70px;
  transform: translateY(calc(-4px * var(--shrink, 0)));
}
.brand-logo {
  display: block;
  height: calc(80px - 26px * var(--shrink, 0));
  width: auto; flex: 0 0 auto;
  filter: drop-shadow(0 4px 10px rgba(6, 59, 57, calc(0.14 + 0.1 * var(--shrink, 0))));
}

/* wings gather into the logo on scroll (hairline reels in, diamond glides) */
.brand-wing {
  position: relative;
  flex: 1 1 auto; max-width: 104px; height: 9px;
  opacity: clamp(0, calc((0.92 - var(--shrink, 0)) / 0.36), 1);
  transform: translateX(calc(-10px * var(--shrink, 0)));
}
.brand-wing:last-child {
  transform: translateX(calc(10px * var(--shrink, 0)));
}
.brand-wing::before {
  content: ""; position: absolute; left: 0; right: 9px; top: 50%;
  height: 1px;
  transform: translateY(-50%) scaleX(calc(1 - var(--shrink, 0)));
  transform-origin: left center;
  background: linear-gradient(270deg, rgba(156, 119, 38, 0.5), transparent);
}
.brand-wing::after {
  content: ""; position: absolute; top: 50%;
  width: 6px; height: 6px;
  right: calc(var(--shrink, 0) * (100% - 6px));
  transform: translate(0, -50%)
             rotate(calc(45deg + 180deg * var(--shrink, 0)))
             scale(calc(1 - 0.45 * var(--shrink, 0)));
  background: var(--g-400);
}
.brand-wing:last-child::before {
  left: 9px; right: 0;
  transform-origin: right center;
  background: linear-gradient(90deg, rgba(156, 119, 38, 0.5), transparent);
}
.brand-wing:last-child::after {
  right: auto;
  left: calc(var(--shrink, 0) * (100% - 6px));
}

/* floating nav buttons (back / share) beside the crest */
.navfloat {
  position: absolute;
  top: 50px; left: 0; right: 0;
  z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.icon-btn {
  pointer-events: auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--t-800);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.icon-btn:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.icon-btn i { width: 20px; height: 20px; }

/* ================= CONTENT (scrolls) ================= */
.content {
  /* clears the fixed brand head (top) and fixed tab bar (bottom) */
  padding: 112px 18px calc(96px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.content > * { flex-shrink: 0; }

/* ===== Mihrab hero (the dhikr) ===== */
.mihrab-card {
  position: relative;
  padding: 16px 18px 18px;
  color: #fdf7e6;
  background:
    radial-gradient(120% 60% at 50% 16%, rgba(15,128,119,0.5), transparent 62%),
    linear-gradient(165deg, #0f8077 0%, #0b5c56 48%, #063b39 100%);
  border: 1px solid rgba(231, 205, 134, 0.34);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(6, 59, 57, 0.3);
  overflow: hidden;
  isolation: isolate;
}
.mihrab-card::before {
  content: "";
  position: absolute; inset: 0; z-index: -1; opacity: 0.45;
  background-image:
    repeating-linear-gradient(45deg, rgba(231,205,134,0.08) 0 1px, transparent 1px 20px),
    repeating-linear-gradient(-45deg, rgba(231,205,134,0.08) 0 1px, transparent 1px 20px);
}
.chips-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.chip {
  font-size: 11px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.chip i { width: 13px; height: 13px; }
.chip-day {
  color: #063b39;
  background: linear-gradient(135deg, var(--g-200), var(--g-400));
}
.chip-date {
  color: #fbeec6;
  background: rgba(253,247,230,0.08);
  border: 1px solid rgba(231,205,134,0.3);
}

.arch {
  position: relative;
  width: 100%;
  height: 186px;
  margin-top: 12px;
}
.arch > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px;
  padding: 40px 22px 18px;
}
.lamp { position: relative; color: var(--g-300); animation: floatY 5s ease-in-out infinite; }
.lamp svg { width: 24px; height: 24px; }
.lamp::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231,205,134,0.55), transparent 65%);
  z-index: -1;
  animation: glowPulse 3.2s ease-in-out infinite;
}
.dhikr-plate {
  position: relative; max-width: 100%;
  padding: 9px 18px; border-radius: 14px;
  background: rgba(253, 247, 230, 0.06);
  border: 1px solid rgba(231, 205, 134, 0.3);
  overflow: hidden;
}
.dhikr-plate::before {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(247,234,208,0.2), transparent);
  animation: shimmer 5.5s ease-in-out infinite;
}
.dhikr {
  margin: 0;
  font-family: "Amiri", serif; font-weight: 700;
  font-size: 22px; line-height: 1.5; white-space: nowrap;
  color: #fbeec6;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero-foot { text-align: center; margin-top: 14px; }
.hero-foot h2 { margin: 0; font-size: 19px; font-weight: 800; color: #fdf7e6; }
.hero-foot p {
  margin: 5px 0 0; font-size: 12px; line-height: 1.8; color: rgba(247,234,208,0.78);
}

/* ===== Section heads ===== */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.sec-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--t-900); white-space: nowrap; }
.sec-head .sec-tag {
  font-size: 11px; font-weight: 700; color: var(--t-700); white-space: nowrap;
  background: var(--t-100); padding: 4px 11px; border-radius: 999px;
}

/* ===== Tasbih counter card ===== */
.counter-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-card);
}
.counter-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.tasbih {
  position: relative;
  flex: 0 0 auto;
  width: 150px; height: 150px;
  display: grid; place-items: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
/* stats beside the ring */
.counter-stats {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.stat-block {
  display: flex; align-items: center; gap: 11px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px 13px;
}
.stat-ic {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 12px;
  color: #fdf7e6;
  background: linear-gradient(150deg, var(--t-600), var(--t-900));
  box-shadow: 0 6px 14px rgba(11, 92, 86, 0.28);
}
.stat-ic i { width: 18px; height: 18px; }
.stat-block.gold .stat-ic {
  color: var(--t-950);
  background: linear-gradient(135deg, var(--g-200), var(--g-500));
  box-shadow: 0 6px 14px rgba(182, 134, 44, 0.3);
}
.stat-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.stat-text b { font-size: 19px; font-weight: 800; color: var(--t-900); font-variant-numeric: tabular-nums; }
.stat-text > span { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.tasbih svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--t-100); stroke-width: 12; }
.ring-prog {
  fill: none; stroke: url(#goldStroke); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dashoffset 480ms cubic-bezier(.22,1,.36,1);
  filter: drop-shadow(0 3px 8px rgba(182,134,44,0.35));
}
.bead {
  position: relative;
  width: 108px; height: 108px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background:
    radial-gradient(120% 120% at 50% 22%, #fffdf7, #f3e9cf 78%);
  border: 1.5px solid var(--g-300);
  box-shadow:
    inset 0 2px 10px rgba(255,255,255,0.8),
    inset 0 -8px 18px rgba(182,134,44,0.12),
    0 10px 24px rgba(182,134,44,0.2);
  transition: transform 120ms cubic-bezier(.34,1.5,.5,1);
}
.tasbih.pulse .bead { animation: beadPulse 420ms ease; }
.bead .count {
  font-size: 29px; font-weight: 800; line-height: 1; color: var(--t-900);
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.bead .count-label { font-size: 10px; font-weight: 700; color: var(--g-700); margin-top: 3px; text-align: center; }
.bead .tap-hint {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 7px; font-size: 11px; font-weight: 700; color: var(--muted);
}
.bead .tap-hint i { width: 13px; height: 13px; color: var(--g-600); }

.counter-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; gap: 10px;
}
.goal-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--t-700);
  background: var(--t-100); padding: 7px 13px; border-radius: 999px;
}
.goal-pill i { width: 15px; height: 15px; color: var(--g-600); }
.reset-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 13px; cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.reset-btn:hover { color: var(--t-800); border-color: var(--gold-line); }
.reset-btn i { width: 14px; height: 14px; }

/* ===== Register form card ===== */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.field { display: block; margin-bottom: 12px; }
.field > span {
  display: block; font-size: 12px; font-weight: 700; color: var(--t-800); margin-bottom: 7px;
}
.field input {
  width: 100%; height: 50px;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--cream-2);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0 15px; outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input::placeholder { color: #a7b1ab; font-weight: 500; }
.field input:focus {
  border-color: var(--g-400);
  box-shadow: 0 0 0 3px rgba(199,154,58,0.16);
  background: var(--paper);
}
.field-amount { position: relative; }
.field-amount .sync-note {
  position: absolute; left: 14px; top: 36px; transform: translateY(-50%);
  font-size: 10.5px; font-weight: 700; color: var(--g-700);
  background: rgba(231,205,134,0.3); padding: 3px 9px; border-radius: 999px;
  pointer-events: none; opacity: 0; transition: opacity 200ms ease;
}
.field-amount.synced .sync-note { opacity: 1; }

.cta {
  margin-top: 4px;
  width: 100%; height: 54px; border: 0; border-radius: 16px;
  font-family: inherit; font-size: 15.5px; font-weight: 800; color: var(--t-950);
  background: linear-gradient(135deg, var(--g-200), var(--g-500));
  box-shadow: 0 14px 30px rgba(182, 134, 44, 0.34);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer; white-space: nowrap;
  position: relative; overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(182,134,44,0.4); }
.cta:active { transform: translateY(0); }
.cta i { width: 19px; height: 19px; }
.cta::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 4.5s ease-in-out infinite 1s;
}
.status-text {
  margin: 11px 0 0; min-height: 16px; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--t-700);
}

/* ===== Recent registrations ===== */
.recent-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}
.pledge-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pledge-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 13px; border-radius: 13px;
  background: var(--cream-2); border: 1px solid var(--line);
}
.pledge-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pledge-ava {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(150deg, var(--t-600), var(--t-900));
  color: #fdf7e6; font-size: 13px; font-weight: 800;
}
.pledge-name { font-size: 13.5px; font-weight: 700; color: var(--t-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pledge-amount {
  font-size: 12px; font-weight: 800; color: var(--g-700); white-space: nowrap;
  background: rgba(231,205,134,0.34); padding: 5px 11px; border-radius: 999px;
}
.empty-state {
  text-align: center; padding: 18px 14px;
  color: var(--muted);
}
.empty-state i { width: 26px; height: 26px; color: var(--g-400); }
.empty-state p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.7; }

/* Bottom nav styles moved to shared naadem-tabbar.css */

/* ================= ANIMATIONS ================= */
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes glowPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
}
@keyframes shimmer { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@keyframes beadPulse {
  0% { transform: scale(0.955); }
  55% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.8); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -70px) scale(1.1); }
}
.float-plus {
  position: absolute; left: 50%; top: 34%;
  font-size: 26px; font-weight: 800; color: var(--g-600);
  pointer-events: none; animation: floatUp 720ms ease-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .lamp, .lamp::after, .dhikr-plate::before, .cta::after { animation: none !important; }
}
