/* ==========================================================================
   Kur'an-ı Kerim: liste, mushaf okuyucu (yatay kaydırmalı), arama.
   ========================================================================== */

/* ---------- Liste ekranı ---------- */
.screen--quran {
  background:
    radial-gradient(90% 40% at 50% 0%, var(--soft) 0%, rgba(221, 243, 230, 0) 70%),
    var(--white);
}
.qs__head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(16px, env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(180deg, var(--white) 70%, rgba(255, 255, 255, 0));
}
.qs__title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--emerald-deep);
}
.qs__body { padding: 4px 14px var(--tabbar-space); }

.qs__resume {
  position: relative;
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 16px 18px 14px;
  text-align: left;
  color: #fff;
  border: 0;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(213, 177, 91, 0.35) 0%, rgba(213, 177, 91, 0) 55%),
    linear-gradient(150deg, #0c9a66 0%, var(--emerald) 45%, #04402b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 5px 0 #043f29,
    0 18px 26px -14px rgba(5, 92, 60, 0.8);
  transition: transform 0.16s var(--ease-spring);
}
.qs__resume:active { transform: translateY(4px); }
.qs__resume:disabled { opacity: 0.75; }
.qs__resume::after {
  /* Altın sekiz köşeli yıldız süsü. */
  content: '';
  position: absolute;
  right: -26px;
  top: -26px;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(242, 217, 138, 0.35);
  transform: rotate(45deg);
  box-shadow: 0 0 0 14px rgba(242, 217, 138, 0.08);
}
.qs__resume-label { font-size: var(--text-xs); font-weight: 700; color: #f2d98a; }
.qs__resume-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.qs__resume-sub { font-size: var(--text-s); opacity: 0.88; }
.qs__resume-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: var(--text-s);
  font-weight: 700;
  color: #f2d98a;
}
.qs__resume-go .icon { width: 16px; height: 16px; transform: scaleX(-1); }

.qs__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 18px 0 12px;
  padding: 5px;
  background: var(--soft);
  border-radius: 16px;
}
.qs__tab {
  padding: 10px;
  font-size: var(--text-m);
  font-weight: 700;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 12px;
  transition: background-color 0.2s, color 0.2s;
}
.qs__tab[aria-selected='true'] {
  color: var(--emerald-deep);
  background: var(--white);
  box-shadow: 0 2px 8px -3px rgba(5, 92, 60, 0.35);
}

.qs__list { display: flex; flex-direction: column; gap: 8px; }
.sura {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 6px 14px -12px rgba(5, 92, 60, 0.45);
  transition: transform 0.15s var(--ease-spring), border-color 0.2s;
}
.sura:active { transform: scale(0.985); border-color: rgba(8, 122, 80, 0.4); }

/* Sure numarası: sekiz köşeli yıldız (iki kare). */
.sura__no {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
}
.sura__no::before,
.sura__no::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid var(--gold);
  border-radius: 4px;
  background: rgba(213, 177, 91, 0.08);
}
.sura__no::after { transform: rotate(45deg); }
.sura__no span {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--emerald-deep);
  font-variant-numeric: tabular-nums;
}
.sura__no--juz::before,
.sura__no--juz::after { border-color: var(--emerald); background: rgba(8, 122, 80, 0.06); }

.sura__info { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.sura__name { font-size: var(--text-m); font-weight: 700; color: var(--ink); }
.sura__meta { font-size: var(--text-xs); color: var(--ink-soft); }
.sura__ar {
  flex: none;
  font-family: var(--font-quran);
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--emerald);
}
.qs__source {
  margin: 18px 4px 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.qs__error { padding: 24px 6px; text-align: center; color: var(--ink-soft); }
.qs__error .btn { margin-top: 12px; }

/* ---------- Okuyucu ---------- */
.qr {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 60% at 50% 0%, #fbf3dc 0%, rgba(251, 243, 220, 0) 70%),
    linear-gradient(180deg, #f3ead2 0%, #ece0c2 100%);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.26s ease, transform 0.3s var(--ease-out);
}
.qr.is-open { opacity: 1; transform: none; }

.qr__bar {
  display: grid;
  grid-template-columns: 40px 1fr 40px 40px;
  align-items: center;
  gap: 6px;
  padding: max(10px, env(safe-area-inset-top)) 10px 8px;
  background: linear-gradient(180deg, #0a6a45 0%, #064f34 100%);
  color: #fff;
  box-shadow: 0 6px 16px -10px rgba(4, 40, 28, 0.8);
}
.qr__title { display: flex; flex-direction: column; align-items: center; min-width: 0; text-align: center; }
.qr__title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-m);
}
.qr__title small { font-size: var(--text-xs); color: #f2d98a; }
.qr__btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}
.qr__btn .icon { width: 20px; height: 20px; }
.qr__btn:active { transform: scale(0.92); }
.qr__btn.is-on { color: var(--emerald-deep); background: #f2d98a; border-color: #f2d98a; }
.qr__btn--sm { width: 32px; height: 32px; color: var(--ink); background: var(--soft); border-color: transparent; }

.qr__pager {
  flex: 1 1 auto;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.qr__pager::-webkit-scrollbar { display: none; }
.qr__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 12px 10px 18px;
}

/* Mushaf sayfası */
.mp {
  position: relative;
  min-height: 100%;
  padding: 10px 14px 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, #fffdf6 0%, #fdf6e3 100%);
  border: 1px solid #c9a24f;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 4px #fdf6e3,
    inset 0 0 0 5px rgba(201, 162, 79, 0.65),
    0 10px 24px -16px rgba(80, 60, 20, 0.6);
}
.mp--loading, .mp--error { display: grid; place-items: center; color: var(--ink-soft); }
.mp__spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(8, 122, 80, 0.2);
  border-top-color: var(--emerald);
  border-radius: 50%;
  animation: mp-spin 0.8s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); } }

.mp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  margin-bottom: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #8a6a1e;
  border-bottom: 1px solid rgba(201, 162, 79, 0.45);
}
.mp__head [lang='ar'] { font-family: var(--font-quran); font-size: 1rem; font-weight: 400; }
.mp__foot {
  margin-top: 10px;
  padding-top: 6px;
  text-align: center;
  font-family: var(--font-quran);
  font-size: 1rem;
  color: #8a6a1e;
  border-top: 1px solid rgba(201, 162, 79, 0.45);
}

.mp__text {
  font-family: var(--font-quran);
  font-size: 1.5rem;
  line-height: 2.3;
  text-align: justify;
  color: #1d1a12;
  word-spacing: 0.04em;
}
.ay { border-radius: 6px; transition: background-color 0.25s; cursor: pointer; }
.ay.is-sel, .ma.is-sel { background: rgba(8, 122, 80, 0.12); }
.ay.is-hl, .ma.is-hl { background: rgba(213, 177, 91, 0.38); }

.ay__end {
  display: inline-grid;
  place-items: center;
  min-width: 1.55em;
  height: 1.55em;
  margin: 0 0.12em;
  padding: 0 0.15em;
  font-family: var(--font-quran);
  font-size: 0.62em;
  line-height: 1;
  color: #6f5416;
  vertical-align: 0.15em;
  background: radial-gradient(circle, #fff8e3 55%, #f2d98a 100%);
  border: 1.5px solid #c9a24f;
  border-radius: 50%;
}

.mp__banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 10px 0 6px;
  padding: 8px 10px;
  text-align: center;
  background:
    linear-gradient(90deg, rgba(8, 122, 80, 0.9), #0a6a45 50%, rgba(8, 122, 80, 0.9));
  border: 1.5px solid #c9a24f;
  border-radius: 12px;
  box-shadow: inset 0 0 0 3px rgba(242, 217, 138, 0.35);
}
.mp__banner-ar { font-family: var(--font-quran); font-size: 1.35rem; line-height: 1.6; color: #f7e3a3; }
.mp__banner-tr { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.9); }
.mp__basmala {
  margin: 4px 0 6px;
  text-align: center;
  font-family: var(--font-quran);
  font-size: 1.45rem;
  line-height: 2;
  color: #1d1a12;
}

/* Meal görünümü */
.mp--meal .mp__body { display: flex; flex-direction: column; gap: 4px; }
.ma {
  padding: 8px 6px 10px;
  border-bottom: 1px dashed rgba(201, 162, 79, 0.45);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.25s;
}
.ma:last-child { border-bottom: 0; }
.ma__ar {
  font-family: var(--font-quran);
  font-size: 1.4rem;
  line-height: 2.1;
  text-align: right;
  color: #1d1a12;
}
.ma__tr {
  margin-top: 4px;
  font-size: var(--text-m);
  line-height: 1.55;
  color: #3a3324;
}
.ma__tr b { color: var(--emerald); font-weight: 800; margin-right: 4px; }

/* Yan gezinme okları (fareli cihazlar) */
.qr__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--emerald-deep);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(201, 162, 79, 0.6);
  border-radius: 50%;
  box-shadow: 0 6px 14px -8px rgba(60, 40, 10, 0.6);
}
.qr__nav .icon { width: 20px; height: 20px; }
.qr__nav--next { left: 6px; }
.qr__nav--prev { right: 6px; }
@media (hover: hover) and (pointer: fine) {
  .qr__nav { display: grid; }
  .qr__slide { padding-left: 50px; padding-right: 50px; }
}

.qr__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 252, 243, 0.92);
  border-top: 1px solid rgba(201, 162, 79, 0.45);
}
.qr__range { flex: 1 1 auto; accent-color: var(--emerald); }
.qr__pageno { flex: none; min-width: 62px; text-align: right; font-size: var(--text-s); font-weight: 700; color: #6f5416; }

/* Ayet paneli */
.qr__ayah {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(60px + env(safe-area-inset-bottom));
  z-index: 3;
  padding: 14px 14px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 40px -16px rgba(20, 30, 20, 0.55);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out);
}
.qr__ayah.is-open { opacity: 1; transform: none; }
.qr__ayah-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qr__ayah-head strong { font-size: var(--text-m); color: var(--emerald-deep); }
.qr__ayah-tr {
  max-height: 32vh;
  overflow-y: auto;
  margin: 8px 0 12px;
  font-size: var(--text-m);
  line-height: 1.55;
  color: var(--ink);
}
.qr__ayah-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr__ayah-actions .btn { min-height: 42px; gap: 6px; }
.qr__ayah-actions .icon { width: 16px; height: 16px; }

/* ---------- Arama ---------- */
.qsrch {
  position: absolute;
  inset: 0;
  z-index: 68;
  display: flex;
  flex-direction: column;
  background: var(--white);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out);
}
.qsrch.is-open { opacity: 1; transform: none; }
.qsrch__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  color: #fff;
  background: linear-gradient(180deg, #0a6a45 0%, #064f34 100%);
}
.qsrch__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  font-size: var(--text-m);
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 999px;
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(242, 217, 138, 0.0);
}
.qsrch__input:focus { box-shadow: inset 0 0 0 2px #f2d98a; }
.qsrch__results { flex: 1 1 auto; overflow-y: auto; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); }
.qsrch__help p { font-size: var(--text-s); font-weight: 700; color: var(--ink-soft); margin: 4px 2px 8px; }
.qsrch__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qsrch__chips button {
  padding: 8px 12px;
  font-size: var(--text-s);
  font-weight: 700;
  color: var(--emerald-deep);
  background: var(--soft);
  border: 0;
  border-radius: 999px;
}
.qsrch__note, .qsrch__count { margin: 12px 4px 8px; font-size: var(--text-s); color: var(--ink-soft); }
.qsrch__count { font-weight: 700; color: var(--emerald-deep); }

.hit {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 14px;
  text-align: left;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.hit:active { background: var(--soft); }
.hit--quick { background: linear-gradient(180deg, #fff, #f3faf6); border-color: rgba(8, 122, 80, 0.25); }
.hit__ref { font-size: var(--text-m); font-weight: 800; color: var(--emerald-deep); }
.hit__ref small { font-weight: 600; color: var(--ink-soft); }
.hit__sub { font-size: var(--text-xs); color: var(--ink-soft); }
.hit__text { font-size: var(--text-s); line-height: 1.5; color: var(--ink); }
.hit__text--ar { font-family: var(--font-quran); font-size: 1.15rem; line-height: 1.9; text-align: right; }
.hit mark { padding: 0 2px; color: inherit; background: rgba(213, 177, 91, 0.45); border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  .qr, .qsrch, .qr__ayah { transition: none; }
}

/* ---------- Arama: kelime önerileri ve devamı ---------- */
.qsrch__suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.qsrch__suggest:empty { display: none; }
.qsrch__word {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 12px;
  font: inherit;
  font-size: var(--text-s);
  font-weight: 700;
  color: var(--emerald-deep);
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.qsrch__word small { font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); }
.qsrch__more { margin: 8px 0 4px; }

/* Birlikte çevrilmiş ayetler */
.ma__note { font-style: italic; color: var(--ink-soft); }
.qr__ayah-note { margin: 0 0 6px; font-size: var(--text-xs); font-weight: 700; color: var(--emerald); }
