/* =================================================================
   QURAN GIFT PLATFORM — UNIFIED DESIGN SYSTEM
   Premium RTL Design | Dark & Light Mode | Responsive
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;600;700;900&family=Tajawal:wght@300;400;500;700&display=swap');

/* ── 1. CSS CUSTOM PROPERTIES (Design Tokens) ─────────────────── */
:root {
  /* Brand - Overridden per-project via JS theme injection */
  --gift-accent:       #8d703e;
  --gift-accent-light: #c9a96e;
  --gift-accent-dark:  #5a4526;
  --gift-bg-from:      #1a1205;
  --gift-bg-to:        #0d0e1a;

  /* Typography */
  --font-body:   'Cairo', 'Tajawal', sans-serif;
  --font-quran:  'Amiri', serif;

  /* Spacing */
  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --sp-2xl: 3rem;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-norm: 300ms;
  --dur-slow: 600ms;

  /* Shadows */
  --shadow-card: 0 8px 32px rgba(0,0,0,0.35);
  --shadow-glow: 0 0 40px rgba(141,112,62,0.25);

  /* ── Theme tokens (dark = default) ── */
  --gift-text:             #f0e6c8;
  --gift-text-strong:      #ffffff;
  --gift-text-soft:        rgba(240,230,200,0.7);
  --gift-text-softer:      rgba(240,230,200,0.55);
  --gift-text-faint:       rgba(240,230,200,0.35);
  --gift-text-dedication:  rgba(240,230,200,0.85);

  --gift-surface-1:        rgba(255,255,255,0.07);
  --gift-surface-1b:       rgba(255,255,255,0.03);
  --gift-surface-2:        rgba(255,255,255,0.05);
  --gift-surface-3:        rgba(255,255,255,0.06);
  --gift-surface-bar:      rgba(10,8,5,0.95);
  --gift-toast-bg:         rgba(20,18,10,0.95);

  --gift-panel-from:  #12100a;
  --gift-panel-to:    #0d0e1a;
  --gift-duaa-from:   #1a1205;
  --gift-duaa-to:     #0d0e1a;
  /* Exact invert(1) of the page's cream (#fbf3df) — must match precisely
     or the inverted page shows as a visibly different-toned rectangle
     against this background instead of blending into it. */
  --gift-reader-bg:   #040c20;

  --gift-border-soft:    rgba(201,169,110,0.15);
  --gift-border:         rgba(201,169,110,0.2);
  --gift-border-strong:  rgba(201,169,110,0.28);
  --gift-border-max:     rgba(201,169,110,0.4);

  --gift-overlay:       rgba(0,0,0,0.6);
  --gift-overlay-soft:  rgba(0,0,0,0.4);
  --gift-hairline:      rgba(255,255,255,0.05);
  --gift-track:         rgba(255,255,255,0.08);

  /* Inverts the scanned page (cream paper + black ink) into a dark
     page (near-black + light ink) for real night reading, instead of
     leaving a bright cream rectangle inside the dark chrome. Plain
     invert(1) only — no hue-rotate/brightness/contrast — because the
     resulting background must equal --gift-reader-bg exactly (see its
     comment) or a seam appears around the page. Tradeoff: any gold/
     green printed accents on the page invert to a blue tint. */
  --gift-page-filter: invert(1);
  --gift-shadow-title: 0 2px 20px rgba(0,0,0,0.5);
}

/* ── Light theme override — wins over the per-project inline
   :root style block regardless of source order because the
   [data-theme="light"] attribute selector has higher specificity
   than a plain :root rule. ── */
:root[data-theme="light"] {
  --gift-bg-from: #fdf8ef;
  --gift-bg-to:   #f3ead7;

  --gift-text:             #2a1f10;
  --gift-text-strong:      #1a1205;
  --gift-text-soft:        rgba(42,31,16,0.65);
  --gift-text-softer:      rgba(42,31,16,0.5);
  --gift-text-faint:       rgba(42,31,16,0.35);
  --gift-text-dedication:  rgba(42,31,16,0.8);

  --gift-surface-1:        rgba(141,112,62,0.06);
  --gift-surface-1b:       rgba(141,112,62,0.02);
  --gift-surface-2:        rgba(255,255,255,0.75);
  --gift-surface-3:        rgba(0,0,0,0.03);
  --gift-surface-bar:      rgba(255,253,248,0.92);
  --gift-toast-bg:         rgba(255,253,248,0.97);

  /* Deliberately a shade darker/grayer than the Quran page images
     (#fbf3df) so the page reads as a distinct sheet resting on the
     UI, the same way the dark theme's near-black backdrop frames it —
     matching that value here would make the page invisible against
     its own background. */
  --gift-panel-from:  #f0ebdc;
  --gift-panel-to:    #e3dcc9;
  --gift-duaa-from:   #f0ebdc;
  --gift-duaa-to:     #e3dcc9;
  --gift-reader-bg:   #e3dcc9;

  --gift-border-soft:    rgba(141,112,62,0.15);
  --gift-border:         rgba(141,112,62,0.22);
  --gift-border-strong:  rgba(141,112,62,0.3);
  --gift-border-max:     rgba(141,112,62,0.4);

  --gift-overlay:       rgba(30,22,10,0.45);
  --gift-overlay-soft:  rgba(30,22,10,0.15);
  --gift-hairline:      rgba(0,0,0,0.06);
  --gift-track:         rgba(0,0,0,0.08);

  --gift-page-filter: none;
  --gift-shadow-title: 0 1px 6px rgba(0,0,0,0.06);

  --shadow-card: 0 8px 28px rgba(90,69,38,0.14);
}

/* ── 2. RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.gift-body {
  font-family: var(--font-body);
  direction: rtl;
  text-align: right;
  background: linear-gradient(135deg, var(--gift-bg-from) 0%, var(--gift-bg-to) 100%);
  color: var(--gift-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  transition: background var(--dur-norm) var(--ease), color var(--dur-norm) var(--ease);
}

/* ── 3. AMBIENT BACKGROUND LAYERS ───────────────────────────── */
.gift-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.gift-ambient::before {
  content: '';
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  top: -20%;
  right: -20%;
  background: radial-gradient(circle, var(--gift-accent) 0%, transparent 65%);
  opacity: 0.07;
  animation: ambientPulse 8s ease-in-out infinite alternate;
}
.gift-ambient::after {
  content: '';
  position: absolute;
  width: 50vmax;
  height: 50vmax;
  border-radius: 50%;
  bottom: -15%;
  left: -10%;
  background: radial-gradient(circle, var(--gift-accent-dark) 0%, transparent 65%);
  opacity: 0.09;
  animation: ambientPulse 10s ease-in-out infinite alternate-reverse;
}
@keyframes ambientPulse {
  from { transform: scale(1); opacity: 0.07; }
  to   { transform: scale(1.15); opacity: 0.12; }
}

/* ── 4. ISLAMIC GEOMETRIC DECORATION ────────────────────────── */
.gift-geo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(141,112,62,0.12) 1px, transparent 0);
  background-size: 32px 32px;
}

/* ── 5. LANDING PAGE ─────────────────────────────────────────── */
.gift-landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-xl) var(--sp-md);
}

.gift-card {
  position: relative;
  background: linear-gradient(135deg, var(--gift-surface-1) 0%, var(--gift-surface-1b) 100%);
  border: 1px solid var(--gift-border-strong);
  border-radius: 24px;
  padding: var(--sp-2xl);
  max-width: 680px;
  width: 100%;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: cardReveal 0.8s var(--ease) both;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative ornament lines */
.gift-card::before, .gift-card::after {
  content: '';
  position: absolute;
  left: 50%; transform: translateX(-50%);
  height: 2px;
  width: 60%;
  background: linear-gradient(90deg, transparent, var(--gift-accent), transparent);
  border-radius: 1px;
}
.gift-card::before { top: 0; }
.gift-card::after  { bottom: 0; }

.gift-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: contain;
  border: 2px solid var(--gift-border-max);
  margin-bottom: var(--sp-lg);
  padding: 8px;
  background: rgba(141,112,62,0.1);
}

.gift-bismillah {
  font-family: var(--font-quran);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gift-accent-light);
  margin-bottom: var(--sp-md);
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(201,169,110,0.3);
}

.gift-from-label {
  font-size: 0.9rem;
  color: var(--gift-text-soft);
  margin-bottom: var(--sp-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gift-from-name {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--gift-accent-light);
  font-weight: 600;
  margin-bottom: var(--sp-md);
}

.gift-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,169,110,0.4), transparent);
  margin: var(--sp-lg) 0;
}

.gift-to-section {
  background: rgba(141,112,62,0.1);
  border: 1px solid var(--gift-border-soft);
  border-radius: 12px;
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
}

.gift-to-label {
  font-size: 0.85rem;
  color: var(--gift-text-soft);
  margin-bottom: var(--sp-xs);
}

.gift-to-name {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--gift-text-strong);
  margin-bottom: var(--sp-md);
}

.gift-dedication-msg {
  font-family: var(--font-quran);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--gift-text-dedication);
  line-height: 2;
  font-style: italic;
}

.gift-cover-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: var(--sp-lg);
  border: 1px solid var(--gift-border);
}

.gift-start-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-2xl);
  background: linear-gradient(135deg, var(--gift-accent) 0%, var(--gift-accent-dark) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-norm) var(--ease);
  box-shadow: 0 4px 20px rgba(141,112,62,0.4);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.03em;
}

.gift-start-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity var(--dur-norm) var(--ease);
}

.gift-start-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(141,112,62,0.5);
}

.gift-start-btn:hover::before { opacity: 1; }
.gift-start-btn:active { transform: translateY(0); }

.gift-start-btn .btn-icon {
  font-size: 1.3rem;
  animation: arrowBounce 1.8s ease-in-out infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-4px); }
}

/* Secondary CTA — WhatsApp brand green, deliberately calmer than the
   primary start-reading button (no bounce animation) so it doesn't
   compete with it for attention. */
.gift-order-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding: 12px var(--sp-xl);
  background: rgba(37,211,102,0.12);
  color: #25d366;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border: 1.5px solid rgba(37,211,102,0.4);
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}
.gift-order-btn:hover {
  background: rgba(37,211,102,0.22);
  border-color: #25d366;
  transform: translateY(-2px);
}
.gift-order-btn:active { transform: translateY(0); }
.gift-order-btn .btn-icon { font-size: 1.1rem; }

/* Resumes saved progress — same footprint as .gift-start-btn (matching
   padding/font-size/radius) so the two read as equally-weighted primary
   actions, but outlined instead of filled to stay visually secondary.
   Inserted at runtime only when a visitor actually has saved progress,
   directly under "ابدأ القراءة" and above the WhatsApp order button. */
.gift-continue-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding: var(--sp-md) var(--sp-2xl);
  background: rgba(141,112,62,0.1);
  color: var(--gift-accent-light);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--gift-accent);
  border-radius: 50px;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
  letter-spacing: 0.03em;
}
.gift-continue-btn:hover {
  background: rgba(141,112,62,0.2);
  transform: translateY(-2px);
}
.gift-continue-btn:active { transform: translateY(0); }
.gift-continue-btn .btn-icon { font-size: 1.1rem; }

/* ── 6. QURAN READER LAYOUT ──────────────────────────────────── */
.gift-reader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: var(--gift-reader-bg);
  overflow: hidden;
}

/* Top Navigation Bar */
.reader-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--gift-surface-bar);
  border-bottom: 1px solid var(--gift-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  height: 64px;
  z-index: 20;
  gap: var(--sp-sm);
}

.reader-topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--gift-border-strong);
  background: rgba(141,112,62,0.12);
  color: var(--gift-accent-light);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.reader-topbar-btn:hover {
  background: rgba(141,112,62,0.28);
  border-color: var(--gift-accent);
}

.reader-page-info {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.reader-page-info-surah {
  font-family: var(--font-quran);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gift-accent-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-page-info-meta {
  font-size: 0.72rem;
  color: var(--gift-text-soft);
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottombar-pagenum .reader-page-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--gift-accent);
  border-radius: 50%;
  font-family: var(--font-quran);
  color: var(--gift-accent-light);
  font-weight: 700;
  font-size: 1.15rem;
}

/* Main Reading Area */
.reader-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}

.reader-page-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-sm);
}

.reader-page-img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity var(--dur-fast) var(--ease);
  display: block;
  filter: var(--gift-page-filter);
}

/* Page Navigation Strip — sits between the topbar and the page image
   in normal document flow, so it can never cover the ayat the way an
   absolutely-positioned side overlay could. */
.reader-nav-strip {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-sm);
  padding: 8px var(--sp-md);
  background: var(--gift-surface-bar);
  border-bottom: 1px solid var(--gift-border-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.reader-nav-btn-labeled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--gift-border-strong);
  background: rgba(141,112,62,0.12);
  color: var(--gift-accent-light);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.reader-nav-btn-labeled:hover {
  background: rgba(141,112,62,0.28);
  border-color: var(--gift-accent);
  color: var(--gift-text-strong);
}
.reader-nav-btn-labeled:active { transform: scale(0.97); }

/* Progress Bar */
.reader-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gift-track);
  z-index: 10;
}
.reader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gift-accent-dark), var(--gift-accent));
  transition: width var(--dur-norm) var(--ease);
}

/* Bottom Navigation Bar */
.reader-bottombar {
  flex-shrink: 0;
  display: grid;
  /* 1fr auto 1fr instead of flex + space-between: the page number
     column must be truly centered on the bar regardless of how wide
     the goto-input and completions groups on either side are. */
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--gift-surface-bar);
  border-top: 1px solid var(--gift-border);
  height: 68px;
  z-index: 20;
  gap: var(--sp-sm);
}

.bottombar-goto {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-self: start;
}

/* Centered page number, like the number printed at the bottom of a
   physical Mushaf page — the circular frame echoes the ayah-end
   marker circles already printed on the page images. */
.bottombar-pagenum {
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}

.bottombar-pagenum-total {
  font-size: 0.62rem;
  color: var(--gift-text-faint);
  margin-top: 2px;
}

.bottombar-side {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.bottombar-completions {
  font-size: 0.78rem;
  color: rgba(201,169,110,0.6);
}

.reader-goto-input {
  width: 70px;
  background: var(--gift-surface-3);
  border: 1px solid var(--gift-border-strong);
  border-radius: 8px;
  color: var(--gift-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 6px 10px;
  text-align: center;
  direction: ltr;
}
.reader-goto-input:focus { outline: none; border-color: var(--gift-accent); }

.reader-goto-btn {
  padding: 7px 14px;
  background: rgba(141,112,62,0.2);
  border: 1px solid var(--gift-border-strong);
  border-radius: 8px;
  color: var(--gift-accent-light);
  font-family: var(--font-body);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.reader-goto-btn:hover { background: rgba(141,112,62,0.4); }

.reader-progress-pct {
  font-size: 0.72rem;
  color: var(--gift-text-softer);
}

/* ── 7. SIDE PANELS (Surah/Juz Indexes) ──────────────────────── */
.reader-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--gift-overlay);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-norm) var(--ease);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.reader-panel-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.reader-panel {
  position: fixed;
  top: 0; right: 0;
  bottom: 0;
  width: min(360px, 92vw);
  background: linear-gradient(180deg, var(--gift-panel-from) 0%, var(--gift-panel-to) 100%);
  border-left: 1px solid var(--gift-border-strong);
  z-index: 55;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-norm) var(--ease);
  overflow: hidden;
}
.reader-panel.active { transform: translateX(0); }

.reader-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--gift-border-soft);
  background: rgba(141,112,62,0.08);
}
.reader-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gift-accent-light);
}
.panel-close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--gift-border);
  background: rgba(141,112,62,0.1);
  color: var(--gift-text-soft);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--dur-fast) var(--ease);
}
.panel-close-btn:hover { background: rgba(201,169,110,0.2); }

.panel-search-wrap {
  padding: var(--sp-sm) var(--sp-md);
  border-bottom: 1px solid var(--gift-border-soft);
}
.panel-search-input {
  width: 100%;
  background: var(--gift-surface-3);
  border: 1px solid var(--gift-border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--gift-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  direction: rtl;
}
.panel-search-input::placeholder { color: var(--gift-text-faint); }
.panel-search-input:focus { outline: none; border-color: var(--gift-accent); }

.panel-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-sm) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(141,112,62,0.3) transparent;
}

.panel-list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 10px var(--sp-lg);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
  border-bottom: 1px solid var(--gift-hairline);
}
.panel-list-item:hover { background: rgba(141,112,62,0.12); }
.panel-list-item.active { background: rgba(141,112,62,0.22); }

.panel-item-num {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(141,112,62,0.15);
  border: 1px solid var(--gift-border);
  color: var(--gift-accent-light);
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.panel-item-info { flex: 1; }
.panel-item-name { font-size: 0.95rem; font-weight: 600; color: var(--gift-text); }
.panel-item-sub  { font-size: 0.75rem; color: var(--gift-text-softer); margin-top: 2px; }
.panel-item-page { font-size: 0.78rem; color: rgba(201,169,110,0.6); flex-shrink: 0; }

/* ── 8. COMPLETION / DUAA PAGE ───────────────────────────────── */
.gift-duaa {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gift-duaa-from) 0%, var(--gift-duaa-to) 100%);
  padding: var(--sp-xl) var(--sp-md);
  overflow-y: auto;
}

.duaa-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z: 0;
}

.duaa-card {
  position: relative;
  z-index: 1;
  background: var(--gift-surface-2);
  border: 1px solid var(--gift-border-strong);
  border-radius: 24px;
  padding: var(--sp-2xl);
  max-width: 660px;
  width: 100%;
  text-align: center;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: cardReveal 0.7s var(--ease) both;
}

.duaa-crown-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-md);
  animation: crownFloat 3s ease-in-out infinite;
}
@keyframes crownFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-8px) rotate(3deg); }
}

.duaa-khatm-title {
  font-family: var(--font-quran);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--gift-accent-light);
  margin-bottom: var(--sp-sm);
  text-shadow: 0 0 20px rgba(201,169,110,0.4);
}

.duaa-khatm-sub {
  font-size: 0.9rem;
  color: var(--gift-text-soft);
  margin-bottom: var(--sp-xl);
}

.duaa-text {
  font-family: var(--font-quran);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  line-height: 2.2;
  color: var(--gift-text);
  background: rgba(141,112,62,0.08);
  border: 1px solid var(--gift-border-soft);
  border-radius: 12px;
  padding: var(--sp-lg);
  margin-bottom: var(--sp-xl);
  text-align: right;
}

.duaa-completions-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  background: rgba(141,112,62,0.15);
  border: 1px solid var(--gift-border-strong);
  border-radius: 50px;
  padding: var(--sp-sm) var(--sp-lg);
  font-size: 0.9rem;
  color: var(--gift-accent-light);
  margin-bottom: var(--sp-xl);
}

.duaa-register-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-xl);
  background: linear-gradient(135deg, var(--gift-accent) 0%, var(--gift-accent-dark) 100%);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--dur-norm) var(--ease);
  box-shadow: 0 4px 20px rgba(141,112,62,0.4);
  margin-bottom: var(--sp-md);
}
.duaa-register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(141,112,62,0.5);
}
.duaa-register-btn:disabled {
  opacity: 0.6; cursor: default; transform: none;
}

.duaa-return-link {
  display: block;
  margin-top: var(--sp-md);
  color: rgba(201,169,110,0.6);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
}
.duaa-return-link:hover { color: var(--gift-accent-light); }

/* ── 9. TOAST NOTIFICATIONS ──────────────────────────────────── */
.gift-toast-container {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  pointer-events: none;
}

.gift-toast {
  background: var(--gift-toast-bg);
  border: 1px solid var(--gift-border-max);
  border-radius: 12px;
  padding: 10px 18px;
  color: var(--gift-accent-light);
  font-size: 0.88rem;
  font-weight: 600;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  white-space: nowrap;
  animation: toastIn 0.3s var(--ease) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── 10. LOADING SKELETON ────────────────────────────────────── */
.reader-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gift-reader-bg);
  z-index: 9;
}
.reader-spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(201,169,110,0.15);
  border-top-color: var(--gift-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 11. THEME TOGGLE BUTTON ─────────────────────────────────── */
.gift-theme-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--gift-border-strong);
  background: var(--gift-surface-bar);
  color: var(--gift-accent-light);
  cursor: pointer;
  font-size: 1rem;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all var(--dur-fast) var(--ease);
}
.gift-theme-toggle:hover {
  background: rgba(141,112,62,0.2);
  border-color: var(--gift-accent);
}

/* Labeled pill (not icon-only, unlike .gift-theme-toggle) so its
   purpose reads at a glance. Landing page only — not reinjected into
   the reader/duaa views like the theme toggle is, since sharing is a
   landing-page action. */
.gift-share-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 300;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 50px;
  border: 1px solid var(--gift-border-strong);
  background: var(--gift-surface-bar);
  color: var(--gift-accent-light);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: all var(--dur-fast) var(--ease);
}
.gift-share-btn:hover {
  background: rgba(141,112,62,0.2);
  border-color: var(--gift-accent);
}

/* ── 12. RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .gift-card { padding: var(--sp-xl) var(--sp-lg); border-radius: 18px; }
  .reader-topbar { height: 58px; }
  .reader-page-info-surah { font-size: 0.85rem; }
  .reader-page-info-meta { font-size: 0.68rem; }
  .reader-bottombar { height: 64px; padding: var(--sp-xs) var(--sp-sm); gap: var(--sp-xs); }
  .bottombar-pagenum .reader-page-num { width: 34px; height: 34px; font-size: 1.05rem; }
  .reader-nav-strip { padding: 6px var(--sp-sm); gap: var(--sp-xs); }
  .reader-nav-btn-labeled { padding: 7px 12px; font-size: 0.78rem; gap: 6px; }
  .reader-panel { width: 88vw; }
}

@media (max-width: 480px) {
  .gift-card { padding: var(--sp-lg) var(--sp-md); }
  .gift-share-btn { padding: 0 12px; height: 36px; font-size: 0.72rem; gap: 6px; }
  .reader-nav-btn-labeled { padding: 7px 10px; font-size: 0.72rem; }
  .reader-goto-input { width: 54px; padding: 6px 6px; }
  .reader-goto-btn { padding: 7px 10px; font-size: 0.76rem; }
  .bottombar-goto { gap: 4px; }
  .reader-progress-pct { font-size: 0.66rem; }
  .bottombar-completions { font-size: 0.7rem; }
}

