/* =============================================================
   QuranSphere — Quran Reader styles (uses the core design tokens)
   ============================================================= */
.qreader { padding-top: 3rem; padding-bottom: 5rem; }
.qreader .container { max-width: var(--container); }

/* Toolbar */
.qr-toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
  margin-bottom: 1.5rem;
}
.qr-search { flex: 1 1 240px; }
.qr-search input,
.qr-select select {
  width: 100%; padding: .7rem .9rem; border-radius: 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-brd);
  color: var(--text); font-family: var(--font-sans); font-size: .95rem;
}
.qr-select { display: flex; flex-direction: column; gap: .35rem; font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.qr-select select { min-width: 200px; }
.qr-search input:focus, .qr-select select:focus {
  outline: none; border-color: var(--glass-brd-strong);
  box-shadow: 0 0 0 3px rgba(212,175,55,.15);
}

/* Layout */
.qr-grid {
  display: grid; grid-template-columns: 340px 1fr; gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .qr-grid { grid-template-columns: 1fr; } }

/* Surah list */
.qr-list {
  max-height: 78vh; overflow-y: auto; padding-right: .3rem;
  display: flex; flex-direction: column; gap: .4rem;
  scrollbar-width: thin;
}
.qr-surah {
  display: flex; align-items: center; gap: .8rem; text-align: left;
  padding: .7rem .8rem; border-radius: 14px; width: 100%;
  background: var(--glass-bg); border: 1px solid var(--glass-brd);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.qr-surah:hover { border-color: var(--glass-brd-strong); transform: translateX(2px); }
.qr-surah.is-active { border-color: var(--gold-500); background: rgba(212,175,55,.08); }
.qr-num {
  flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; font-size: .8rem; font-weight: 700; color: var(--gold-300);
  background: rgba(16,185,129,.1); border: 1px solid var(--glass-brd);
}
.qr-names { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.qr-en { font-weight: 600; font-size: .95rem; }
.qr-meta { font-size: .72rem; color: var(--text-dim); }
.qr-ar-name { font-family: var(--font-arabic); font-size: 1.25rem; color: var(--gold-300); }

/* Reader main */
.qr-main { min-height: 60vh; }
.qr-welcome, .qr-loading, .qr-error {
  padding: 3rem 1.5rem; text-align: center; color: var(--text-dim);
  background: var(--glass-bg); border: 1px solid var(--glass-brd); border-radius: var(--radius);
}
.qr-welcome h3 { color: var(--text); font-family: var(--font-display); font-size: 1.6rem; margin-bottom: .6rem; }
.qr-error { color: #ffb4a2; }

.qr-surah-head {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  padding: 1.4rem 1.6rem; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(6,78,59,.5), rgba(10,21,18,.5));
  border: 1px solid var(--glass-brd-strong); margin-bottom: 1.2rem;
}
.qr-ar-title { font-family: var(--font-arabic); font-size: 2rem; color: var(--gold-300); display: block; }
.qr-surah-title h3 { font-family: var(--font-display); font-size: 1.4rem; margin: .2rem 0; }
.qr-surah-title p { font-size: .82rem; color: var(--text-dim); }
.qr-surah-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

.qr-bismillah {
  text-align: center; font-family: var(--font-arabic); font-size: 2rem;
  color: var(--gold-300); padding: 1rem 0 1.6rem;
}

.qr-ayahs { display: flex; flex-direction: column; gap: .8rem; }
.qr-ayah {
  padding: 1.1rem 1.3rem; border-radius: var(--radius);
  background: var(--glass-bg); border: 1px solid var(--glass-brd);
}
.qr-ayah-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.qr-ayah-num {
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--gold-400);
  padding: .2rem .6rem; border-radius: 999px; background: rgba(212,175,55,.1);
}
.qr-ayah-play {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(16,185,129,.12); border: 1px solid var(--glass-brd); color: var(--emerald-300);
  font-size: .7rem; transition: background .2s var(--ease);
}
.qr-ayah-play:hover { background: rgba(16,185,129,.25); }
.qr-ayah-ar {
  font-family: var(--font-arabic); font-size: 1.9rem; line-height: 2.6; text-align: right;
  color: var(--ink); margin-bottom: .5rem;
}
.qr-ayah-tr { font-size: 1rem; color: var(--text-dim); line-height: 1.7; }

/* Sticky mini-player */
.qr-player {
  position: sticky; bottom: 1rem; margin-top: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem 1.1rem; border-radius: 999px;
  background: rgba(10,21,18,.92); backdrop-filter: blur(14px);
  border: 1px solid var(--glass-brd-strong); box-shadow: var(--shadow-soft);
}
.qr-pp {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold-500); color: #1a1205; font-size: 1rem; font-weight: 700;
  display: grid; place-items: center;
}
.qr-player-meta { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.qr-player-meta strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-player-meta span { font-size: .76rem; color: var(--text-dim); }
.qr-dl {
  flex: 0 0 auto; padding: .5rem .9rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: rgba(16,185,129,.15); border: 1px solid var(--glass-brd); color: var(--emerald-300);
}
.qr-dl:hover { background: rgba(16,185,129,.28); }

/* Print → the browser "Save as PDF" produces a clean sheet */
@media print {
  body * { visibility: hidden !important; }
  .qr-main, .qr-main * { visibility: visible !important; }
  .qr-main { position: absolute; left: 0; top: 0; width: 100%; }
  .qr-surah-actions, .qr-player, .qr-ayah-play { display: none !important; }
  .qr-ayah-ar, .qr-ar-title, .qr-bismillah { color: #000 !important; }
  .qr-ayah-tr, .qr-surah-title p, .qr-ayah-num { color: #333 !important; }
  .qr-ayah, .qr-surah-head { border-color: #ccc !important; background: #fff !important; }
}
