/* ==================== LOADING BANNER, SURAH INDEX & AUDIO PLAYER ==================== */
.loading-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--emerald-50);
  border: 1.5px solid var(--emerald-700);
  border-radius: 14px;
  padding: 14px 20px;
  margin: 0 auto 20px;
  max-width: 520px;
  text-align: right;
}
.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3.5px solid rgba(29, 78, 216, 0.2);
  border-top-color: var(--emerald-900);
  border-radius: 50%;
  animation: agSpin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes agSpin {
  to { transform: rotate(360deg); }
}
.loading-text { display: flex; flex-direction: column; gap: 2px; }
.loading-text strong { color: var(--emerald-900); font-size: 15px; }
.loading-text span { color: var(--ink-muted); font-size: 13px; }

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.welcome-actions button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.btn-gold-solid {
  background: linear-gradient(135deg, #c89b3c 0%, #a67c24 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 26px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(166, 124, 36, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.btn-gold-solid:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(166, 124, 36, 0.36);
}

/* Top navigation tabs + reciter dropdown */
.nav-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.nav-tab {
  background: rgba(255, 255, 255, 0.14);
  color: #f4f1e6;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-tab:hover { background: rgba(255, 255, 255, 0.24); }
.nav-tab--active {
  background: #c89b3c;
  color: #fff;
  border-color: #e5c985;
}
.reciter-select {
  background: rgba(255, 255, 255, 0.96);
  color: var(--emerald-950);
  border: 1px solid var(--gold-300);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  max-width: 245px;
}

/* Surah Index Toolbar & Grid */
.index-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.index-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pill {
  background: var(--surface);
  color: var(--emerald-900);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.filter-pill--active {
  background: var(--emerald-900);
  color: #fff;
  border-color: var(--emerald-900);
}
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  padding-bottom: 96px;
}
.surah-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.surah-card:hover {
  border-color: var(--gold-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.surah-card--playing {
  border-color: var(--emerald-700);
  background: var(--emerald-50);
}
.surah-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  cursor: pointer;
  flex: 1;
}
.surah-num-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  color: #f6e6b8;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--gold-300);
}
.surah-info { min-width: 0; }
.surah-name {
  font-family: var(--font-quran);
  font-size: 21px;
  font-weight: 700;
  color: var(--emerald-950);
  line-height: 1.3;
}
.surah-meta {
  font-size: 12.5px;
  color: var(--ink-muted);
}
.surah-card-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Audio Play Buttons (Surah & Ayah) */
.btn-play-pill, .btn-read-pill {
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-play-pill {
  background: var(--emerald-900);
  color: #fff;
  border: 1px solid var(--emerald-800);
}
.btn-play-pill:hover { background: var(--emerald-700); }
.btn-play-pill--active {
  background: #b91c1c;
  border-color: #991b1b;
}
.btn-read-pill {
  background: var(--gold-100);
  color: var(--emerald-950);
  border: 1px solid var(--gold-300);
}
.btn-read-pill:hover { background: var(--gold-300); }

.btn-play-surah-top, .btn-play-ayah-top {
  background: #c89b3c;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.btn-play-surah-top:hover, .btn-play-ayah-top:hover { background: #a67c24; }

.result-actions-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Surah Reader View & Real-Time Word-by-Word Tracking */
.surah-banner {
  background: linear-gradient(135deg, var(--emerald-950), var(--emerald-800));
  color: #fff;
  border-radius: 20px;
  padding: 26px 24px;
  text-align: center;
  margin-bottom: 20px;
  border: 1.5px solid var(--gold-500);
}
.surah-banner-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.surah-banner-title {
  font-family: var(--font-quran);
  font-size: 36px;
  margin: 0 0 8px;
  color: #f6e6b8;
}
.surah-bismillah {
  font-family: var(--font-quran);
  font-size: 28px;
  margin: 8px 0 0;
  color: #fff;
}
.surah-ayahs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 100px;
}
.surah-ayah-row {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.surah-ayah-row--playing,
.result-card--playing {
  border-color: #c89b3c !important;
  background: linear-gradient(135deg, #f0f9ff 0%, #fefce8 100%) !important;
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.14) !important;
}
.surah-ayah-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.surah-ayah-text {
  font-family: var(--font-quran);
  font-size: 26px;
  line-height: 2.1;
  color: var(--ink);
  margin: 0;
  cursor: pointer;
}

/* Word-by-word active follow-along highlight */
.q-word {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 8px;
  transition: background-color 0.12s ease, color 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}
.q-word--spoken {
  color: #1e40af;
}
.q-word--active {
  background: linear-gradient(135deg, #122d66 0%, #116b53 100%);
  color: #fef08a !important;
  box-shadow: 0 3px 12px rgba(29, 78, 216, 0.35), 0 0 0 2px #c89b3c;
  transform: scale(1.06);
  font-weight: 700;
}
.q-word--active mark.hl {
  background: transparent;
  color: #fde047;
}

/* Floating Sticky Audio Player Bar */
.audio-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #0b1c3f 0%, #122d66 100%);
  color: #fff;
  border-top: 2px solid #c89b3c;
  padding: 10px 18px;
  z-index: 999;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.25);
}
.audio-bar-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.audio-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.audio-pulse { font-size: 22px; }
.audio-title { font-weight: 700; font-size: 15px; color: #f6e6b8; }
.audio-sub { font-size: 12.5px; color: #dbeafe; }
#quranAudio {
  flex: 1 1 280px;
  height: 36px;
  max-width: 480px;
}
.audio-controls-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.audio-mini-select {
  background: rgba(255, 255, 255, 0.14);
  color: #fef08a;
  border: 1px solid rgba(200, 155, 60, 0.6);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.audio-mini-select option {
  background: #0b1c3f;
  color: #ffffff;
}
.sync-nudge-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 2px 6px;
}
.sync-btn {
  background: rgba(200, 155, 60, 0.85);
  color: #fff;
  border: none;
  border-radius: 5px;
  width: 22px;
  height: 22px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.sync-btn:hover { background: #eab308; color: #0b1c3f; }
.sync-lbl {
  font-size: 11.5px;
  font-weight: 700;
  color: #dbeafe;
  min-width: 52px;
  text-align: center;
  direction: ltr;
}
.autoplay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  cursor: pointer;
  color: #f6e6b8;
  user-select: none;
}
.btn-close-audio {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 15px;
  cursor: pointer;
}
.btn-close-audio:hover { background: #dc2626; border-color: #dc2626; }
