/* =====================================================================
   QURAN TAB — deep-green memorization tracker + reader.
   Page recolour (the --gold* token swap + black-green background) lives in
   page-accents.css, scoped to [data-page="quran"]. This file is layout +
   the Arabic typography rules. Accents use var(--gold*) so they inherit the
   green swap for free.
   ===================================================================== */

/* ---- Arabic typography (CRITICAL) ----
   Never apply positive letter-spacing (breaks Arabic ligatures), never justify,
   never transform the text. Generous line-height so the Quranic marks above/below
   letters are never clipped. */
.q-ayah-ar, .q-vod-ar, .q-basmala, .q-surah-ar, .q-surah-title-ar {
  font-family: 'Amiri Quran', serif;
  direction: rtl;
  letter-spacing: 0;
  word-spacing: normal;
  line-height: 2.15;
  font-feature-settings: "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.q-page { padding-bottom: 40px; }

/* ---- sub-tab switcher ---- */
.q-viewbar { display: flex; justify-content: center; padding: 10px 0 4px; }
.q-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
.q-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border: 0; background: transparent; color: var(--ink-3, #9fb0a6); font-size: 13px; font-weight: 600; border-radius: 9px; cursor: pointer; transition: all .18s; }
.q-tab i { font-size: 12px; }
.q-tab.on { background: var(--gold-grad); color: #071b10; box-shadow: 0 3px 12px var(--gold-30); }
.q-tab:not(.on):hover { color: var(--ink, #eaf3ee); }

/* ---- stats strip ---- */
.q-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 14px; }
.q-stat { background: linear-gradient(180deg, rgba(31,169,104,0.06), rgba(255,255,255,0.006)); border: 1px solid var(--gold-18); border-radius: 14px; padding: 14px 12px; text-align: center; }
.q-stat-v { font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 600; color: var(--gold-hi); line-height: 1; display: flex; align-items: baseline; justify-content: center; gap: 5px; }
.q-stat-v small { font-size: 11px; font-weight: 500; color: var(--ink-4, #7f9187); }
.q-stat-k { font-size: 12px; font-weight: 700; color: var(--ink, #eaf3ee); margin-top: 7px; text-transform: uppercase; letter-spacing: 0.4px; }
.q-stat-sub { font-size: 11px; color: var(--ink-4, #7f9187); margin-top: 2px; }

/* ---- attendance card: calendar + ring + check buttons ---- */
.q-attend-card { padding: 16px; }
.q-attend { display: grid; grid-template-columns: minmax(0, 440px) 180px; gap: 30px; align-items: start; justify-content: start; }
.q-cal { max-width: 440px; }
.q-cal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.q-cal-month { font-weight: 700; font-size: 15px; color: var(--ink, #eaf3ee); }
.q-cal-sub { font-size: 11px; color: var(--ink-4, #7f9187); }
.q-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.q-dow { margin-bottom: 4px; }
.q-dowc { text-align: center; font-size: 10px; font-weight: 700; color: var(--ink-5, #5f7168); }
.q-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ink-3, #9fb0a6); border-radius: 9px; border: 1px solid transparent; position: relative; }
.q-day.blank { visibility: hidden; }
.q-day.today { box-shadow: inset 0 0 0 1.5px var(--gold); color: var(--gold-hi); }
.q-day.classday { border-color: var(--gold); color: var(--gold-hi); }
.q-day.practiced { background: var(--gold-grad); color: #071b10; font-weight: 800; overflow: hidden; }
.q-day.practiced::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.45) 50%, transparent 70%); background-size: 220% 100%; animation: q-shine 3.5s ease-in-out infinite; }
/* practiced AND class -> filled green + a bright ring */
.q-day.practiced.classday { box-shadow: inset 0 0 0 2px var(--gold-hi); }
@keyframes q-shine { 0% { background-position: 120% 0; } 55%, 100% { background-position: -120% 0; } }
.q-cal-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--ink-4, #7f9187); }
.q-lg { display: inline-flex; align-items: center; gap: 6px; }
.q-lg i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.q-lg.practiced i { background: var(--gold-grad); }
.q-lg.classday i { border: 1.5px solid var(--gold); }

.q-aside { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.q-wklbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-4, #7f9187); }
.q-ring { position: relative; display: grid; place-items: center; }
.q-ring svg { position: absolute; inset: 0; }
.q-ring-mid, .q-ring-solid { text-align: center; z-index: 1; }
.q-ring-mid b, .q-ring-solid b { display: block; font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 600; }
.q-ring-mid span, .q-ring-solid span { font-size: 10px; color: var(--ink-4, #7f9187); text-transform: uppercase; letter-spacing: 0.5px; }
.q-ring.is-over .q-ring-solid { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: #071b10; box-shadow: 0 0 20px var(--gold-30); }
.q-ring.is-over .q-ring-solid span { color: rgba(7,27,16,0.7); }

.q-checkgroup { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 2px; }
.q-check { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 11px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: var(--ink-2, #cddbd3); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .18s; }
.q-check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(255,255,255,0.2); display: grid; place-items: center; font-size: 11px; color: #071b10; flex-shrink: 0; }
.q-check.on { border-color: var(--gold); color: var(--gold-hi); background: var(--gold-10); }
.q-check.practiced.on .q-check-box { background: var(--gold-grad); border-color: transparent; }
.q-check.classday.on .q-check-box { background: transparent; border-color: var(--gold); color: var(--gold-hi); }
.q-check-cap { font-size: 10px; color: var(--ink-5, #5f7168); text-align: center; }

/* ---- cards ---- */
.q-card-head { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--ink, #eaf3ee); margin-bottom: 12px; }
.q-card-head i { color: var(--gold); }
.q-current-card, .q-prayers-card { padding: 16px; margin-top: 12px; }
.q-current-body { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.q-current-surah { font-size: 18px; font-weight: 700; color: var(--gold-hi); }
.q-current-surah small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-4, #7f9187); margin-top: 2px; }
.q-current-ayah { font-size: 13px; color: var(--ink-3, #9fb0a6); margin-top: 4px; }
.q-current-actions { display: flex; gap: 8px; }
.q-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .18s; }
.q-btn.primary { background: var(--gold-grad); color: #071b10; box-shadow: 0 3px 12px var(--gold-30); }
.q-btn.ghost { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); color: var(--ink-2, #cddbd3); }
.q-current-edit { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.q-current-edit label { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--ink-4, #7f9187); }
.q-current-edit select, .q-current-edit input { padding: 9px 11px; border-radius: 9px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); color: var(--ink, #eaf3ee); font-size: 14px; }
.q-current-edit input { width: 84px; }

/* ---- prayers ---- */
.q-prayers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.q-prayer { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: var(--ink-3, #9fb0a6); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .18s; }
.q-prayer-box { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.2); display: grid; place-items: center; font-size: 11px; color: #071b10; }
.q-prayer.on { border-color: var(--gold); color: var(--gold-hi); background: var(--gold-10); }
.q-prayer.on .q-prayer-box { background: var(--gold-grad); border-color: transparent; }

/* ---- surah list ---- */
.q-surahs { padding-top: 6px; }
.q-search { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); margin-bottom: 12px; }
.q-search i { color: var(--ink-4, #7f9187); }
.q-search input { flex: 1; background: transparent; border: 0; color: var(--ink, #eaf3ee); font-size: 14px; outline: none; }
.q-surah-list { display: flex; flex-direction: column; gap: 6px; }
.q-surah-row { display: flex; align-items: stretch; gap: 8px; background: linear-gradient(180deg, rgba(31,169,104,0.04), rgba(255,255,255,0.004)); border: 1px solid rgba(255,255,255,0.07); border-radius: 12px; overflow: hidden; }
.q-surah-main { flex: 1; display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: transparent; border: 0; cursor: pointer; text-align: left; color: inherit; }
.q-surah-no { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,0.06); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-3, #9fb0a6); flex-shrink: 0; }
.q-surah-names { flex: 1; min-width: 0; }
.q-surah-tl { font-size: 14px; font-weight: 600; color: var(--ink, #eaf3ee); }
.q-surah-tl small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-4, #7f9187); }
.q-surah-ar { font-size: 20px; color: var(--gold-hi); white-space: nowrap; }
.q-surah-cnt { font-size: 11px; color: var(--ink-5, #5f7168); width: 26px; text-align: right; }
.q-status-chip { padding: 0 12px; border: 0; border-left: 1px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.02); font-size: 11px; font-weight: 700; cursor: pointer; color: var(--ink-4, #7f9187); white-space: nowrap; transition: all .18s; }
.q-status-chip.st-working { color: #f0b45e; background: rgba(240,180,94,0.08); }
.q-status-chip.st-revising { color: #6fb0ff; background: rgba(111,176,255,0.08); }
.q-status-chip.st-memorized { color: var(--gold-hi); background: var(--gold-10); }
.q-surah-row.st-memorized { border-color: var(--gold-18); }

/* ---- reader ---- */
.q-reader { display: flex; flex-direction: column; }
.q-reader-bar { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; position: sticky; top: 0; z-index: 2; }
.q-rnav { width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--ink-2, #cddbd3); cursor: pointer; flex-shrink: 0; }
.q-rnav:disabled { opacity: 0.3; cursor: default; }
.q-rselect { flex: 1; position: relative; }
.q-rselect select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.q-rselect-face { display: flex; flex-direction: column; padding: 7px 14px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); pointer-events: none; }
.q-rselect-face b { font-size: 15px; color: var(--ink, #eaf3ee); }
.q-rselect-face small { font-size: 11px; color: var(--ink-4, #7f9187); }
.q-transtoggle { width: 44px; height: 38px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: var(--ink-4, #7f9187); font-size: 12px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.q-transtoggle.on { border-color: var(--gold); color: var(--gold-hi); background: var(--gold-10); }
.q-surah-title { text-align: center; padding: 6px 0 14px; border-bottom: 1px solid var(--gold-18); margin-bottom: 10px; }
.q-surah-title-ar { font-size: 30px; color: var(--gold-hi); }
.q-surah-title-en { display: block; font-size: 12px; color: var(--ink-4, #7f9187); margin-top: 4px; }
.q-basmala { text-align: center; font-size: 26px; color: var(--gold-hi); padding: 6px 0 18px; }
.q-ayah { padding: 16px 4px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.q-ayah.is-current { background: var(--gold-10); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--gold-18); padding: 16px 14px; }
.q-ayah-ar { font-size: 30px; color: var(--ink, #eaf3ee); text-align: right; }
.q-ayah-num { display: inline-grid; place-items: center; width: 30px; height: 30px; margin: 0 6px; font-family: 'Oswald', sans-serif; font-size: 12px; color: var(--gold-hi); border: 1px solid var(--gold-30); border-radius: 50%; vertical-align: middle; }
.q-ayah-en { font-size: 14px; line-height: 1.6; color: var(--ink-3, #9fb0a6); margin-top: 10px; }
.q-ayah-tools { margin-top: 10px; }
.q-markhere { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.03); color: var(--ink-4, #7f9187); font-size: 11px; font-weight: 600; cursor: pointer; transition: all .18s; }
.q-markhere.on { border-color: var(--gold); color: var(--gold-hi); background: var(--gold-10); }
.q-reader-foot { text-align: center; font-size: 10px; color: var(--ink-5, #5f7168); padding: 18px 0 6px; }

/* ---- Overview verse-of-the-day card ---- */
.q-vod { display: block; width: 100%; text-align: right; padding: 18px; border-radius: 16px; background: linear-gradient(160deg, rgba(31,169,104,0.09), rgba(10,61,38,0.04)); border: 1px solid var(--gold-18); cursor: pointer; transition: all .2s; }
.q-vod:hover { border-color: var(--gold-30); }
.q-vod-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--gold-hi); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; text-align: left; }
.q-vod-ar { font-size: 26px; color: var(--ink, #eaf3ee); text-align: right; }
.q-vod-en { font-size: 13px; line-height: 1.6; color: var(--ink-3, #9fb0a6); margin-top: 10px; text-align: left; }
.q-vod-ref { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-4, #7f9187); margin-top: 12px; text-align: left; }
.q-vod-go { color: var(--gold-hi); display: inline-flex; align-items: center; gap: 6px; }
.q-vod-skel span { display: block; height: 16px; border-radius: 6px; background: rgba(255,255,255,0.06); margin-bottom: 10px; animation: q-pulse 1.4s ease-in-out infinite; }
.q-vod-skel span:nth-child(2) { width: 80%; }
.q-vod-skel span:nth-child(3) { width: 55%; }
@keyframes q-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.q-loading, .q-empty { padding: 40px 20px; text-align: center; color: var(--ink-4, #7f9187); font-size: 14px; }
.q-loading i { margin-right: 8px; color: var(--gold); }

/* ---- desktop Command Center Quran tile (renders on the overview page, so use --tab-quran
   directly rather than the page-swapped --gold) ---- */
.qcc .tile.t-quran { cursor: pointer; }
.qcc .tile.t-quran .t-ico { color: var(--tab-quran) !important; }
.cc-quran { display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.cc-qverse { font-family: 'Amiri Quran', serif; direction: rtl; letter-spacing: 0; line-height: 2; font-size: 21px; color: var(--ink, #eaf3ee); text-align: right; font-feature-settings: "liga" 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cc-qen { font-size: 12px; line-height: 1.5; color: var(--ink-4, #7f9187); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-quran .tile-foot .fv { color: var(--tab-quran); }
.cc-qskel span { display: block; height: 14px; border-radius: 6px; background: rgba(255,255,255,0.06); margin-bottom: 9px; animation: q-pulse 1.4s ease-in-out infinite; }
.cc-qskel span:nth-child(2) { width: 78%; } .cc-qskel span:nth-child(3) { width: 52%; }

/* ---- mobile ---- */
@media (max-width: 760px) {
  .q-stats { grid-template-columns: repeat(2, 1fr); }
  .q-attend { grid-template-columns: 1fr; gap: 16px; }
  .q-aside { flex-direction: row; flex-wrap: wrap; justify-content: space-between; }
  .q-checkgroup { flex: 1; min-width: 100%; }
  .q-ayah-ar { font-size: 28px; }
  .q-vod-ar { font-size: 24px; }
  .q-surah-ar { font-size: 18px; }
  .q-current-body { flex-direction: column; align-items: stretch; }
  .q-current-actions { width: 100%; }
  .q-current-actions .q-btn { flex: 1; justify-content: center; }
}
