/* Zikr Reminder — Reading hub (📖 FAB · travel→expand circle · pill list · Azkar reader) */

/* Floating book button */
.read-fab {
  position: fixed;
  inset-inline-end: 18px;
  bottom: calc(var(--nav-height) + 18px);
  width: 58px; height: 58px;
  border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: var(--grad-primary);
  box-shadow: 0 8px 24px var(--c-primary-glow), var(--shadow-md);
  cursor: pointer; z-index: 95;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  animation: read-fab-in 0.6s cubic-bezier(.16,1,.3,1) both;
}
.read-fab-emoji { font-size: 1.75rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); }
.read-fab:active { transform: scale(0.92); }
.read-fab:hover { box-shadow: 0 10px 30px var(--c-primary-glow), var(--shadow-lg); }
@keyframes read-fab-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (min-width: 1024px) { .read-fab { bottom: 28px; inset-inline-end: 28px; } }

/* Overlay + the travelling circle */
.read-overlay { position: fixed; inset: 0; z-index: 1300; }

/* Frosted veil — blurs the page behind once the orb dissolves into it */
.read-veil {
  position: fixed; inset: 0; z-index: 1;
  background: rgba(8, 10, 18, 0.5);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  opacity: 0; transition: opacity 0.55s ease;
}
.read-overlay.open .read-veil { opacity: 1; }
.read-overlay.closing .read-veil { opacity: 0; transition-duration: 0.3s; }
.read-overlay.instant .read-veil { opacity: 1; transition: none; }

.read-orb {
  position: fixed; border-radius: 50%; z-index: 2;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 30%, #14b8a6 0%, #0b3b3a 62%, #07120f 100%);
  box-shadow: 0 8px 30px rgba(16,185,129,0.4);
  will-change: transform, opacity;
}
.read-orb-emoji { font-size: 1.75rem; line-height: 1; transition: opacity 0.3s ease; }
.read-orb.grown .read-orb-emoji { opacity: 0; }
/* Stage 1 & 3 (travel home/away) — slow, graceful glide, NO size change */
.read-orb.orb-travel,
.read-orb.orb-return { transition: transform 0.65s cubic-bezier(.45,0,.25,1); }
/* Stage 2 (grow) & reverse (shrink) — equal expansion + fade as it melts into the veil */
.read-orb.orb-expand,
.read-orb.orb-shrink { transition: transform 0.56s cubic-bezier(.65,0,.35,1), opacity 0.56s ease; }
/* When the scene is open, the expanded orb dissolves, revealing the frosted veil */
.read-overlay.open .read-orb { opacity: 0; }

/* Pills popup — Apple-style frosted 3D glass card in the centre */
.read-popup {
  position: absolute; inset: 0; margin: auto; z-index: 3;
  display: flex; flex-direction: column;
  width: min(92vw, 480px); height: fit-content; max-height: 85vh;
  background: linear-gradient(160deg, rgba(38, 44, 68, 0.62), rgba(16, 19, 32, 0.5));
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(255,255,255,0.05);
  color: #fff;
  opacity: 0; transform: scale(0.92) translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(.16,1,.3,1);
  overflow: hidden;
}
.read-popup .read-head h2 { color: #fff; }
.read-popup .read-close { background: rgba(255,255,255,0.14); color: #fff; }
.read-popup .read-close:hover { background: rgba(255,255,255,0.24); }
.read-overlay.open .read-popup { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.read-overlay.closing .read-popup { opacity: 0; transform: scale(0.92) translateY(10px); pointer-events: none; transition-duration: 0.26s; }
.read-popup.dimmed { opacity: 0.18; transform: scale(0.95); pointer-events: none; }
.read-overlay.instant .read-orb { opacity: 0; }

.read-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.2rem 0.7rem; flex-shrink: 0;
}
.read-head h2 { font-size: 1.2rem; margin: 0; }
.read-close {
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c-bg-soft); color: var(--c-text); font-size: 1rem; flex-shrink: 0;
}

/* The colorful pill LIST (same look as the app's hajj/eid/jumuah pills) */
.read-list { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.2rem 1.2rem 1.3rem; }
.read-lp { width: 100%; border: 0; font: inherit; text-align: start; cursor: pointer; }
/* Vivid, sharper reading pills — saturated 3-stop gradients + luminous glow
   and a crisp inner top-highlight for an extra 3D pop. */
.read-lp { position: relative; }
.read-lp .hajj-pill-text strong,
.read-lp .hajj-pill-icon,
.read-lp .hajj-pill-arrow { text-shadow: 0 1px 3px rgba(0,0,0,0.28); }
.hajj-pill.rp-asma {
  background: linear-gradient(135deg, #a855f7 0%, #d946ef 50%, #f43f5e 100%);
  box-shadow: 0 12px 30px rgba(217, 70, 239, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.hajj-pill.rp-asma:hover { box-shadow: 0 16px 38px rgba(217, 70, 239, 0.7), inset 0 1px 0 rgba(255,255,255,0.45); }
.hajj-pill.rp-azkar {
  background: linear-gradient(135deg, #fbbf24 0%, #fb923c 45%, #fb7185 100%);
  box-shadow: 0 12px 30px rgba(251, 146, 60, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.hajj-pill.rp-azkar:hover { box-shadow: 0 16px 38px rgba(251, 146, 60, 0.7), inset 0 1px 0 rgba(255,255,255,0.45); }
.hajj-pill.rp-duas {
  background: linear-gradient(135deg, #38bdf8 0%, #22d3ee 50%, #2dd4bf 100%);
  box-shadow: 0 12px 30px rgba(34, 211, 238, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.hajj-pill.rp-duas:hover { box-shadow: 0 16px 38px rgba(34, 211, 238, 0.7), inset 0 1px 0 rgba(255,255,255,0.45); }
.hajj-pill.rp-prophets {
  background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #06b6d4 100%);
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.hajj-pill.rp-prophets:hover { box-shadow: 0 16px 38px rgba(16, 185, 129, 0.7), inset 0 1px 0 rgba(255,255,255,0.45); }
.hajj-pill.rp-battles {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #8b5cf6 100%);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.55), inset 0 1px 0 rgba(255,255,255,0.4);
}
.hajj-pill.rp-battles:hover { box-shadow: 0 16px 38px rgba(99, 102, 241, 0.7), inset 0 1px 0 rgba(255,255,255,0.45); }

/* Reader sub-screens (Azkar / Daily Du'as) — fullscreen with 3% margin */
.azkar-reader,
.duas-reader {
  position: fixed; inset: 3%;
  display: flex; flex-direction: column;
  background: var(--c-bg-elev); border: 1px solid var(--c-border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  opacity: 0; transform: scale(0.9);
  pointer-events: none; overflow: hidden;
  transition: opacity 0.32s ease, transform 0.42s cubic-bezier(.16,1,.3,1);
}
.read-sub { z-index: 4; }
.read-sub.open { opacity: 1; transform: scale(1); pointer-events: auto; }
.azkar-tabs { margin: 0 1.2rem 0.8rem; flex-shrink: 0; }
.azkar-scroll { flex: 1; overflow-y: auto; padding: 0 1.2rem 1.2rem; -webkit-overflow-scrolling: touch; }

/* Azkar cards */
.azkar-card {
  background: var(--c-bg-soft); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 0.9rem 1rem; margin-bottom: 0.7rem;
}
.azkar-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.45rem; }
.azkar-title { font-size: 0.92rem; }
.azkar-times {
  flex-shrink: 0; font-size: 0.72rem; font-weight: 800; color: var(--c-primary-dark);
  background: var(--c-primary-soft); border-radius: var(--r-pill); padding: 0.18rem 0.6rem;
}
/* The ×N badge doubles as the smart counter button */
button.azkar-count-btn {
  border: 1px solid transparent; cursor: pointer; font: inherit;
  font-size: 0.74rem; font-weight: 800; padding: 0.28rem 0.7rem;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
button.azkar-count-btn:hover { border-color: var(--c-primary); box-shadow: 0 4px 12px var(--c-primary-glow); }
button.azkar-count-btn:active { transform: scale(0.93); }

/* Floating tally counter inside the reader */
.azkar-counter {
  position: absolute; inset-inline: 4%; bottom: 3%;
  display: flex; align-items: center; gap: 0.8rem;
  background: var(--c-bg-elev); border: 1px solid var(--c-primary);
  border-radius: var(--r-xl); padding: 0.7rem 0.9rem;
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--c-primary-glow);
  opacity: 0; transform: translateY(16px) scale(0.96);
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(.16,1,.3,1);
  z-index: 3;
}
.azkar-counter.open { opacity: 1; transform: none; }
.azkar-counter-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.azkar-counter-info strong { font-size: 0.88rem; }
.azkar-counter-info span { font-size: 0.7rem; color: var(--c-text-muted); }
.azkar-counter-tap {
  flex-shrink: 0; width: 74px; height: 74px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--grad-primary); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 22px var(--c-primary-glow);
  font-weight: 800; line-height: 1;
}
.azkar-counter-n { font-size: 1.35rem; }
.azkar-counter-t { font-size: 0.66rem; opacity: 0.85; }
.azkar-counter.done .azkar-counter-tap { background: var(--grad-accent); }
.azkar-counter-x {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c-bg-soft); color: var(--c-text);
}
.azkar-ar {
  font-family: var(--font-arabic); font-size: 1.28rem; line-height: 2.05;
  color: var(--c-text); text-align: start; margin: 0 0 0.45rem;
}
.azkar-tr { font-size: 0.84rem; line-height: 1.65; color: var(--c-text-muted); margin: 0; }

/* Non-navigating informational pill (e.g. Ashura, Ramadan) — looks like a pill
   but is not a link, so it never wrongly routes anywhere. */
.hajj-pill.pill-static { cursor: default; }
.hajj-pill.ashura-pill {
  background: linear-gradient(135deg, #9333ea 0%, #4f46e5 100%);
  box-shadow: 0 10px 26px rgba(147, 51, 234, 0.4);
}

/* ===== Shared swipeable EN ⇄ UR translation ===== */
.swipe-tr { position: relative; overflow: hidden; border-radius: 12px; }
.swipe-tr-track {
  display: flex; direction: ltr; align-items: stretch;
  transition: transform 0.38s cubic-bezier(.22,1,.36,1);
}
.swipe-tr-face { flex: 0 0 100%; min-width: 100%; box-sizing: border-box; }
.swipe-tr[data-show="ur"] .swipe-tr-track { transform: translateX(-100%); }
.swipe-tr-title { display: block; font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--c-text); }
.swipe-tr-text { margin: 0; font-size: 0.85rem; line-height: 1.7; color: var(--c-text-muted); }
.swipe-tr-face[data-lang="ur"] .swipe-tr-text { font-size: 0.95rem; line-height: 1.9; }
.swipe-tr-tabs { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; }
.swipe-tr-tab {
  font: inherit; font-size: 0.66rem; font-weight: 800; cursor: pointer;
  padding: 0.18rem 0.62rem; border-radius: 999px;
  border: 1px solid var(--c-border); background: transparent; color: var(--c-text-muted);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.swipe-tr-tab.active { background: var(--c-primary-soft); color: var(--c-primary-dark); border-color: transparent; }
.swipe-tr-hint { margin-inline-start: auto; font-size: 0.62rem; color: var(--c-text-muted); opacity: 0.7; }

/* ===== Daily Du'as reader ===== */
.dua-hint { margin: 0 1.2rem 0.7rem; font-size: 0.78rem; color: var(--c-text-muted); flex-shrink: 0; }
.dua-scroll { flex: 1; overflow-y: auto; padding: 0 1.2rem 1.2rem; -webkit-overflow-scrolling: touch; }
.dua-card {
  background: var(--c-bg-soft); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: 0.9rem 1rem; margin-bottom: 0.7rem;
}
.dua-card-top { display: flex; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.55rem; }
.dua-emoji { font-size: 1.4rem; line-height: 1.6; flex-shrink: 0; }
.dua-ar { flex: 1; min-width: 0; margin: 0 !important; font-size: 1.2rem; }

/* ===== 99 Names of Allah — full-screen cinematic scroll-reveal ===== */
.asma-reader {
  position: fixed; inset: 0; border: 0; border-radius: 0;
  background: #05060b; color: #fff;
  opacity: 0; transform: scale(1.04);
  pointer-events: none; overflow: hidden;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.16,1,.3,1);
}
.asma-head {
  position: absolute; top: 0; inset-inline: 0; z-index: 6;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  padding: 0.9rem 1rem;
}
.asma-head h2 { color: #fff; }
.asma-reader .read-close { background: rgba(255,255,255,0.16); color: #fff; }
.asma-progress { position: absolute; top: 0; inset-inline: 0; height: 3px; z-index: 7; background: rgba(255,255,255,0.08); }
.asma-progress-bar {
  display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, #fbbf24, #f472b6, #38bdf8);
}
/* Animatable hue customs so the shared backdrop can transition smoothly
   (progressive: ignored where @property is unsupported → hue simply snaps). */
@property --asma-h  { syntax: '<number>'; inherits: false; initial-value: 200; }
@property --asma-h2 { syntax: '<number>'; inherits: false; initial-value: 240; }

/* Shared backdrop behind every scene — its hue cross-fades to the centred Name
   (set from JS), so colours blend smoothly instead of cutting at scene edges. */
.asma-bg {
  position: absolute; inset: 0; z-index: 0;
  --asma-h: 200; --asma-h2: 240;
  background: radial-gradient(135% 95% at 50% 16%,
    hsl(var(--asma-h) 82% 34%) 0%, hsl(var(--asma-h) 74% 18%) 48%, #06070e 100%);
  transition: --asma-h 0.9s ease, --asma-h2 0.9s ease;
}
.asma-scroll {
  position: relative; z-index: 1;
  height: 100%; overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch;
}
.asma-scene {
  position: relative; height: 100%; min-height: 100%;
  scroll-snap-align: center; scroll-snap-stop: always;
  display: grid; place-items: center; overflow: hidden;
  background: transparent;   /* the shared, morphing .asma-bg shows through */
}
.asma-aura {
  position: absolute; inset: -25%; z-index: 0;
  background: radial-gradient(closest-side, hsl(var(--h2, 240) 96% 66% / 0.5), transparent 70%);
  filter: blur(38px); opacity: 0; transform: scale(0.6);
  transition: opacity 0.7s ease, transform 1s cubic-bezier(.22,1,.36,1);
}
.asma-scene.in .asma-aura { opacity: 1; transform: scale(1); }

/* Twinkling stars that bloom with each Name */
.asma-stars { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.asma-stars i {
  position: absolute; left: var(--x); top: var(--y);
  width: var(--sz, 5px); height: var(--sz, 5px); border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.7) 35%, transparent 70%);
  box-shadow: 0 0 6px rgba(255,255,255,0.85);
  opacity: 0; transform: scale(0);
}
.asma-scene.in .asma-stars i { animation: asma-twinkle 2.6s ease-in-out var(--d, 0s) infinite; }
@keyframes asma-twinkle { 0%, 100% { opacity: 0; transform: scale(0.3); } 45% { opacity: 0.95; transform: scale(1); } }

.asma-inner { position: relative; z-index: 2; text-align: center; padding: 2rem 1.5rem; max-width: 580px; }

/* Name number — pinned near the TOP of the scene, well clear of the Arabic name */
.asma-num {
  position: absolute; top: clamp(64px, 13%, 132px); inset-inline: 0; z-index: 2;
  text-align: center; font-size: 0.8rem; letter-spacing: 0.3em; font-weight: 700;
  color: hsl(var(--h2, 240) 95% 86%);
  opacity: 0; transform: translateY(-6px); transition: opacity 0.45s ease, transform 0.45s ease;
}
.asma-num span { opacity: 0.5; }
.asma-scene.in .asma-num { opacity: 1; transform: none; }

/* Reveal — quicker + lighter blur so it never feels laggy on low-spec devices */
.asma-ar {
  font-family: var(--font-arabic); font-size: clamp(2.8rem, 12vw, 5.6rem); line-height: 1.22;
  margin: 0.4rem 0 0.2rem; color: #fff;
  text-shadow: 0 8px 46px hsl(var(--h2, 240) 95% 64% / 0.65);
  opacity: 0; transform: scale(1.18); filter: blur(8px);
  transition: opacity 0.5s cubic-bezier(.22,1,.36,1), transform 0.55s cubic-bezier(.22,1,.36,1), filter 0.45s ease;
}
.asma-scene.in .asma-ar { opacity: 1; transform: scale(1); filter: blur(0); }
.asma-tr {
  font-size: clamp(1.1rem, 4vw, 1.6rem); font-weight: 700; letter-spacing: 0.02em;
  color: hsl(var(--h2, 240) 90% 88%); margin: 0.2rem 0;
  opacity: 0; transform: translateY(12px); filter: blur(4px);
  transition: opacity 0.45s ease 0.12s, transform 0.45s ease 0.12s, filter 0.45s ease 0.12s;
}
.asma-scene.in .asma-tr { opacity: 1; transform: none; filter: blur(0); }
.asma-en { font-size: clamp(1rem, 3.4vw, 1.3rem); color: #fff; margin: 0.65rem 0 0.3rem; min-height: 1.4em; }
.asma-w {
  display: inline-block; opacity: 0; transform: translateY(12px); filter: blur(3px);
  transition: opacity 0.36s ease, transform 0.42s cubic-bezier(.22,1,.36,1), filter 0.36s ease;
  transition-delay: calc(0.16s + var(--wi) * 0.07s);
}
.asma-scene.in .asma-w { opacity: 1; transform: none; filter: blur(0); }
.asma-ur {
  font-size: clamp(1rem, 3.6vw, 1.35rem); color: hsl(var(--h2, 240) 65% 92%); margin-top: 0.5rem;
  opacity: 0; transition: opacity 0.5s ease 0.5s;
}
.asma-scene.in .asma-ur { opacity: 0.92; }
/* Intro scene */
.asma-intro { background: radial-gradient(120% 80% at 50% 30%, #123247 0%, #0a1626 50%, #06070e 100%); }
.asma-intro-basmala { font-family: var(--font-arabic); font-size: clamp(1.6rem, 7vw, 2.6rem); color: #fcd34d; margin-bottom: 1rem; }
.asma-intro h3 { font-size: clamp(1.3rem, 5vw, 2rem); margin: 0 0 0.5rem; color: #fff; }
.asma-intro p { color: rgba(255,255,255,0.78); font-size: 0.95rem; margin: 0 0 1.4rem; }
.asma-cue { font-size: 1.8rem; color: rgba(255,255,255,0.6); animation: asma-bob 1.8s ease-in-out infinite; }
@keyframes asma-bob { 0%,100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(8px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .read-fab { animation: none; }
  .read-orb, .read-popup, .read-veil, .azkar-reader, .duas-reader, .asma-reader, .asma-bg,
  .swipe-tr-track, .asma-aura, .asma-num, .asma-ar, .asma-tr, .asma-w, .asma-ur { transition: none !important; }
  .asma-cue, .asma-stars i { animation: none; }
  .asma-stars i { opacity: 0.5; transform: scale(0.6); }
  .asma-scene { scroll-snap-stop: normal; }
}
