/* ==========================================================================
   Jamia Quran Academy - Full Quran Reader & Teaching Mode Styles
   ========================================================================== */

.quran-app [hidden],
.menu-drawer[hidden],
.quran-toast[hidden] {
  display: none !important;
}

.quran-hero {
  background: radial-gradient(circle at top, #0f3d2e 0%, #064e3b 65%, #032b20 100%);
  color: #ffffff;
  padding: 36px 0 32px;
  text-align: center;
  border-bottom: 3px solid var(--accent, #d4af37);
}

.quran-hero h1 {
  color: #ffffff;
  font-size: 2.2rem;
  margin: 10px 0 8px;
}

.quran-hero p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 680px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.6;
}

.quran-app-shell {
  background: #f8faf9;
  padding: 28px 0 60px;
  min-height: 75vh;
}

.quran-app {
  max-width: 1040px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(6, 78, 59, 0.08);
  overflow: visible;
  position: relative;
}

/* Reader Top Bar */
.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: #064e3b;
  color: #ffffff;
  border-radius: 17px 17px 0 0;
  position: relative;
  z-index: 20;
}

.home-button,
.menu-button,
.current-surah-button,
.focus-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 9px 14px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.home-button:hover,
.menu-button:hover,
.current-surah-button:hover,
.focus-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(212, 175, 55, 0.7);
}

.focus-button.is-active {
  background: #d4af37;
  color: #032b20;
  border-color: #d4af37;
}

.home-svg,
.settings-svg,
.duas-svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.chevron-down,
.chevron-right-svg,
.search-svg,
.back-arrow-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.surah-picker-wrap {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
}

.current-surah-button {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(212, 175, 55, 0.55);
  min-width: 230px;
  justify-content: center;
}

.current-surah-button em {
  font-style: normal;
  color: #fde68a;
  font-weight: 500;
  margin-left: 4px;
}

.current-surah-button:disabled {
  opacity: 0.85;
  cursor: default;
}

.reader-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 3px;
}

.grid-icon i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 1.5px;
  background: currentColor;
}

/* Subheader */
.reader-subheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 24px;
  background: #f0fdf4;
  border-bottom: 1px solid #dcfce7;
  color: #064e3b;
  font-size: 0.95rem;
  font-weight: 600;
}

.revelation-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.revelation-icon {
  width: 18px;
  height: 18px;
  color: #15803d;
}

.reading-progress {
  height: 4px;
  background: #e2e8f0;
  width: 100%;
  overflow: hidden;
}

.reading-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #15803d, #d4af37);
  width: 0%;
  transition: width 0.15s ease-out;
}

/* Surah Picker Popover */
.surah-picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, 92vw);
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  padding: 14px;
  z-index: 60;
}

.picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  margin-bottom: 10px;
}

.picker-search input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 0.95rem;
  color: #0f172a;
  outline: none;
}

.picker-list {
  max-height: 330px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.picker-list button {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #1e293b;
  cursor: pointer;
  font-size: 0.95rem;
}

.picker-list button:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.picker-list button.selected {
  background: #064e3b;
  color: #ffffff;
}

.picker-list button span {
  font-weight: 700;
  font-size: 0.85rem;
  opacity: 0.75;
}

.picker-list button small {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  color: #15803d;
}

.picker-list button.selected small {
  color: #fde68a;
}

/* Reading Stage */
.reading-stage {
  --font-scale: 1;
  padding: 24px 28px 36px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 70px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #064e3b;
}

.loader {
  width: 24px;
  height: 24px;
  border: 3px solid #bbf7d0;
  border-top-color: #064e3b;
  border-radius: 50%;
  animation: quranSpin 0.8s linear infinite;
}

@keyframes quranSpin {
  to { transform: rotate(360deg); }
}

.verse-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reading-verse {
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.reading-verse:hover {
  border-color: #86efac;
}

.reading-verse.is-active {
  border-color: #15803d;
  background: #f6fef9;
  box-shadow: 0 6px 22px rgba(21, 128, 61, 0.1);
}

.verse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.ayah-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.reading-verse.is-active .ayah-number {
  background: #064e3b;
  color: #ffffff;
  border-color: #064e3b;
}

.arabic-verse {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  font-size: calc(2.15rem * var(--font-scale));
  line-height: 2.15;
  color: #0f172a;
  text-align: right;
  margin: 0 0 18px;
  word-spacing: 3px;
}

.translation-lines {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.translation-line {
  padding: 12px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border-left: 3px solid #cbd5e1;
}

.translation-line.english-line {
  border-left-color: #15803d;
}

.translation-line.urdu-line {
  border-left-color: #d4af37;
}

.translation-line.urdu-dr-line {
  border-left: none;
  border-right: 3px solid #064e3b;
  margin-bottom: 12px;
  text-align: right;
}

.translation-line.urdu-dr-line p {
  font-family: 'Amiri', 'Jameel Noori Nastaleeq', serif;
  font-size: calc(1.25rem * var(--font-scale));
  line-height: 2;
  color: #1e293b;
  margin: 0 0 4px;
}

.translation-line p {
  font-size: calc(1.04rem * var(--font-scale));
  line-height: 1.75;
  color: #1e293b;
  margin: 0 0 4px;
}

.translation-line span {
  display: block;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 500;
}

/* Bottom Floating Controls */
.reader-controls {
  position: sticky;
  bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 10px auto 24px;
  padding: 10px 18px;
  width: fit-content;
  background: rgba(6, 78, 59, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  z-index: 30;
}

.reader-controls > button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 9px 14px;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.reader-controls > button:hover:not(:disabled),
.settings-button:hover,
.settings-button.selected {
  background: #d4af37;
  color: #032b20;
  border-color: #d4af37;
}

.reader-controls > button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.control-arrow {
  width: 22px;
  height: 22px;
}

.settings-wrap {
  position: relative;
}

.settings-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(310px, 88vw);
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  z-index: 70;
}

.popover-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.popover-heading button {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}

.settings-popover label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}

.settings-popover label.toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-weight: 500;
  cursor: pointer;
}

.settings-popover input[type="range"] {
  width: 100%;
  accent-color: #064e3b;
}

.settings-popover input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #064e3b;
}

/* Menu Drawer */
.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 92vw);
  height: 100vh;
  background: #ffffff;
  box-shadow: -12px 0 40px rgba(15, 23, 42, 0.22);
  z-index: 1200;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.drawer-heading h2 {
  font-size: 1.35rem;
  color: #064e3b;
  margin: 0;
}

.drawer-heading button {
  background: #f1f5f9;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.4rem;
  cursor: pointer;
  color: #334155;
}

.drawer-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
}

.drawer-action-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.drawer-action-btn span:nth-child(2) {
  flex: 1;
  text-align: left;
}

.drawer-action-btn b {
  background: #064e3b;
  color: #ffffff;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.82rem;
}

.drawer-jump-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-jump-box h3 {
  font-size: 0.95rem;
  color: #064e3b;
  margin: 0;
}

.drawer-jump-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.drawer-jump-row select,
.drawer-jump-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.92rem;
  background: #ffffff;
}

.drawer-jump-row button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: #064e3b;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.drawer-back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  border: none;
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 600;
  color: #064e3b;
  cursor: pointer;
  margin-bottom: 10px;
}

.drawer-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #064e3b;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Duas Reading Mode */
.duas-reading-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.duas-reading-heading .eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #15803d;
  margin-bottom: 4px;
}

.duas-reading-heading h2 {
  margin: 0 0 6px;
  color: #064e3b;
}

.duas-reading-heading p {
  margin: 0;
  color: #475569;
}

.duas-count {
  background: #064e3b;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.duas-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 20px;
}

.duas-search input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 0.98rem;
}

.duas-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dua-card {
  padding: 20px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
}

.dua-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: #475569;
}

.dua-number {
  background: #ecfdf5;
  color: #064e3b;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.dua-surah-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.05rem;
  color: #064e3b;
}

.dua-arabic {
  font-family: 'Amiri', serif;
  font-size: calc(1.95rem * var(--font-scale));
  line-height: 2.1;
  color: #0f172a;
  text-align: right;
  margin: 0 0 14px;
}

.dua-translation {
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 3px solid #15803d;
}

.dua-translation.dua-urdu {
  border-left-color: #d4af37;
}

.dua-translation.dua-urdu-dr {
  border-left: none;
  border-right: 3px solid #064e3b;
  text-align: right;
}

.dua-translation p {
  margin: 0 0 4px;
  font-size: calc(1rem * var(--font-scale));
  line-height: 1.7;
}

.dua-translation small {
  color: #475569;
  font-size: 0.84rem;
}

.open-dua-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: #064e3b;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.open-dua-button .control-arrow {
  width: 16px;
  height: 16px;
}

/* Teacher Focus Mode (hides outer site chrome for clean screen-sharing) */
body.teacher-focus-mode .top-bar,
body.teacher-focus-mode .navbar,
body.teacher-focus-mode .quran-hero,
body.teacher-focus-mode .footer,
body.teacher-focus-mode .floating-whatsapp {
  display: none !important;
}

body.teacher-focus-mode .quran-app-shell {
  padding: 0;
  background: #ffffff;
}

body.teacher-focus-mode .quran-app {
  max-width: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

body.teacher-focus-mode .reader-header {
  border-radius: 0;
}

/* Toast */
.quran-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 1300;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  .reader-header {
    padding: 12px 14px;
    flex-wrap: wrap;
  }
  .current-surah-button {
    min-width: 0;
    width: 100%;
  }
  .surah-picker-wrap {
    order: 3;
    flex-basis: 100%;
  }
  .reading-stage {
    padding: 16px 14px 28px;
  }
  .reading-verse {
    padding: 16px;
  }
  .arabic-verse {
    font-size: calc(1.75rem * var(--font-scale));
  }
  .focus-button span,
  .settings-button span {
    display: none;
  }
}

