/* ==========================================================================
   القرآن الكريم — Emerald & Gold Islamic Glassmorphism Design System
   ========================================================================== */

:root {
  /* Deep Emerald Palette */
  --bg-deep: #03130e;
  --bg-emerald: #062118;
  --bg-emerald-mid: #0a3124;
  --bg-surface: rgba(9, 41, 30, 0.56);
  --bg-surface-strong: rgba(7, 31, 23, 0.84);
  --bg-surface-hover: rgba(14, 58, 43, 0.68);

  /* Gold Accents */
  --gold-primary: #d4af37;
  --gold-light: #f1d77a;
  --gold-dim: #9c7c22;
  --gold-glow: rgba(212, 175, 55, 0.22);
  --emerald-glow: rgba(24, 154, 108, 0.24);

  /* Glass Borders & Shadows */
  --glass-border: rgba(212, 175, 55, 0.18);
  --glass-border-strong: rgba(212, 175, 55, 0.36);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --shadow-card: 0 14px 40px rgba(0, 0, 0, 0.36);
  --shadow-glow: 0 0 28px rgba(212, 175, 55, 0.14);

  /* Text Colors */
  --text-primary: #f7f3e8;
  --text-secondary: #d2ded7;
  --text-muted: #9eb7ab;

  /* Status / Revelation Badges */
  --makkah-bg: rgba(212, 175, 55, 0.14);
  --makkah-border: rgba(212, 175, 55, 0.34);
  --makkah-text: #f1d77a;
  --madinah-bg: rgba(34, 184, 132, 0.14);
  --madinah-border: rgba(34, 184, 132, 0.34);
  --madinah-text: #7ae2b8;

  /* Typography */
  --font-ui: "Cairo", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-quran: "Amiri", "Scheherazade New", Georgia, serif;
  --quran-font-size: 1.95rem;

  /* Layout */
  --header-height: 74px;
  --player-height: 86px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition-fast: 180ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-smooth: 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  background: radial-gradient(circle at 50% 0%, #0b3326 0%, var(--bg-emerald) 38%, var(--bg-deep) 100%);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  padding-bottom: calc(var(--player-height) + 28px);
}

button,
input,
select,
a {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(3, 19, 14, 0.85);
}

::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.5);
  background-clip: content-box;
}

/* Ambient Islamic Geometric Backdrop */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.45;
}

.ambient-glow--top {
  width: 620px;
  height: 620px;
  top: -220px;
  right: -120px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18), transparent 70%);
}

.ambient-glow--bottom {
  width: 680px;
  height: 680px;
  bottom: -240px;
  left: -160px;
  background: radial-gradient(circle, rgba(16, 138, 96, 0.24), transparent 70%);
}

.geometric-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='0.9'%3E%3Cpolygon points='48,6 59,37 90,48 59,59 48,90 37,59 6,48 37,37'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='10'/%3E%3Cpath d='M0 0l24 24M96 0L72 24M0 96l24-24M96 96L72 72'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: 18px;
}

/* Glass Card Utility */
.glass-card {
  background: linear-gradient(155deg, rgba(12, 52, 39, 0.62), rgba(5, 25, 18, 0.72));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-lg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 55%, #b68d28 100%);
  color: #071e16;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(212, 175, 55, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--glass-border);
  color: var(--text-secondary);
}

.btn-ghost:hover,
.btn-ghost.is-active {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--glass-border-strong);
  color: var(--gold-light);
}

.btn-glass {
  background: rgba(11, 47, 35, 0.65);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

.btn-glass:hover:not(:disabled) {
  background: rgba(16, 66, 49, 0.85);
  border-color: var(--glass-border-strong);
}

.btn-glass:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.btn-icon-sm:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--glass-border-strong);
  color: var(--gold-light);
}

/* ==========================================================================
   Sticky Header & Slim Date Top Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(4, 22, 16, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.date-topbar {
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
  background: rgba(2, 14, 10, 0.65);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.date-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-block: 5px;
  flex-wrap: wrap;
}

.date-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.date-topbar__label {
  color: var(--gold-light);
  font-weight: 700;
}

.date-topbar__sep {
  color: var(--gold-dim);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 10px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-emblem {
  color: var(--gold-primary);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.28));
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-title {
  font-family: var(--font-quran);
  font-size: 1.48rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff5d6 0%, var(--gold-light) 45%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.main-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.12);
}

.nav-link {
  padding: 6px 15px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.is-active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.1));
  color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.header-search {
  position: relative;
  flex: 1 1 250px;
  max-width: 340px;
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold-primary);
  opacity: 0.8;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(3, 18, 13, 0.65);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--gold-primary);
  background: rgba(5, 28, 20, 0.92);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

/* Remove browser default clear button in webkit to use our styled one */
.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
}

.search-clear:hover {
  background: rgba(212, 175, 55, 0.22);
  color: var(--gold-light);
}

/* ==========================================================================
   Main Content & Hero
   ========================================================================== */
.main-content {
  padding-block: 24px 36px;
}

.view {
  animation: fadeInView 260ms ease-out;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-panel {
  position: relative;
  padding: 32px 24px;
  text-align: center;
  overflow: hidden;
  margin-bottom: 18px;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12), transparent 68%);
  pointer-events: none;
}

.hero-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--gold-primary);
}

.ornament-line {
  width: 68px;
  height: 1px;
  background: linear-gradient(to left, transparent, var(--gold-primary), transparent);
}

.ornament-star {
  font-size: 1.25rem;
  line-height: 1;
}

.hero-title {
  margin: 0 0 8px;
  font-family: var(--font-quran);
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  margin: 0 auto 20px;
  max-width: 640px;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-pill {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.22);
}

/* Hadith Teaser */
.hadith-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 22px;
  border-radius: var(--radius-md);
}

.hadith-teaser__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
}

.dot-glow {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-primary);
}

.hadith-teaser__text {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.hadith-teaser__link {
  flex-shrink: 0;
}

/* Controls & Filter Bar */
.surah-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--glass-border-strong);
  color: var(--text-primary);
}

.filter-pill.is-active {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.24), rgba(212, 175, 55, 0.1));
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.results-meta {
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Surah Grid & Cards
   ========================================================================== */
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.surah-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(11, 49, 37, 0.55), rgba(4, 22, 16, 0.72));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform var(--transition-smooth), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-smooth);
}

.surah-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  background: linear-gradient(155deg, rgba(16, 68, 51, 0.68), rgba(6, 30, 22, 0.82));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38), var(--shadow-glow);
}

.surah-card.is-playing {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35), 0 12px 32px rgba(212, 175, 55, 0.16);
}

.surah-card__main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

/* 8-point octagonal star number badge */
.surah-number {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--gold-light);
}

.surah-number::before,
.surah-number::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  border-radius: 5px;
  background: rgba(212, 175, 55, 0.06);
  transition: border-color var(--transition-fast), transform var(--transition-smooth);
}

.surah-number::after {
  transform: rotate(45deg);
}

.surah-card:hover .surah-number::before {
  border-color: var(--gold-light);
}

.surah-card:hover .surah-number::after {
  border-color: var(--gold-light);
  transform: rotate(135deg);
}

.surah-number span {
  position: relative;
  z-index: 1;
}

.surah-info {
  min-width: 0;
  flex: 1;
}

.surah-name-ar {
  font-family: var(--font-quran);
  font-size: 1.38rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surah-name-en {
  font-size: 0.8rem;
  color: var(--text-muted);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surah-card__aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.surah-meta-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-rev {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-rev--makkah {
  background: var(--makkah-bg);
  border-color: var(--makkah-border);
  color: var(--makkah-text);
}

.badge-rev--madinah {
  background: var(--madinah-bg);
  border-color: var(--madinah-border);
  color: var(--madinah-text);
}

.surah-ayah-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.card-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-light);
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.card-play-btn:hover {
  background: var(--gold-primary);
  color: #062118;
  border-color: var(--gold-light);
}

/* Skeleton Loader */
.skeleton-card {
  height: 86px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, rgba(11, 49, 37, 0.45) 25%, rgba(22, 79, 60, 0.55) 50%, rgba(11, 49, 37, 0.45) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border: 1px solid rgba(212, 175, 55, 0.1);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.empty-state {
  text-align: center;
  padding: 46px 24px;
}

.empty-state__icon {
  font-size: 2.4rem;
  color: var(--gold-primary);
  margin-bottom: 10px;
}

.empty-state__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.empty-state__desc {
  margin: 0 0 18px;
  color: var(--text-muted);
}

/* ==========================================================================
   Surah Reader View
   ========================================================================== */
.reader-container {
  max-width: 960px;
}

.reader-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.reader-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.font-size-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Ornate Surah Banner */
.surah-banner {
  position: relative;
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 20px;
  overflow: hidden;
}

.surah-banner::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: calc(var(--radius-lg) - 8px);
  pointer-events: none;
}

.surah-banner__content {
  position: relative;
  z-index: 1;
}

.surah-banner__meta-top {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.surah-banner__title {
  margin: 0;
  font-family: var(--font-quran);
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.surah-banner__sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.surah-banner__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.banner-chip {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.surah-banner__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Mushaf Reading Surface */
.mushaf-sheet {
  padding: clamp(22px, 4vw, 44px) clamp(18px, 4.2vw, 48px);
  margin-bottom: 22px;
  background: linear-gradient(170deg, rgba(8, 36, 27, 0.72), rgba(4, 19, 14, 0.84));
}

.bismillah-header {
  text-align: center;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
}

.bismillah-text {
  margin: 0;
  font-family: var(--font-quran);
  font-size: clamp(1.7rem, 3.6vw, 2.35rem);
  color: var(--gold-light);
  line-height: 1.9;
  text-shadow: 0 2px 14px rgba(212, 175, 55, 0.16);
}

/* Continuous Mushaf Flow */
.verses-flow {
  font-family: var(--font-quran);
  font-size: var(--quran-font-size);
  line-height: 2.45;
  text-align: justify;
  text-align-last: center;
  color: #faf6eb;
  word-spacing: 2px;
}

.verse-inline {
  display: inline;
  padding: 2px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.verse-inline:hover {
  background: rgba(212, 175, 55, 0.1);
}

.verse-inline.is-active-ayah {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(20, 140, 97, 0.25));
  color: #fff8e2;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35);
}

/* Verse-by-Verse Card Mode */
.verses-flow.is-list-mode {
  text-align: right;
  text-align-last: right;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verses-flow.is-list-mode .verse-inline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(212, 175, 55, 0.1);
  line-height: 2.25;
}

.verses-flow.is-list-mode .verse-inline:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.25);
}

.verses-flow.is-list-mode .verse-inline.is-active-ayah {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(16, 118, 82, 0.24));
  border-color: var(--gold-primary);
}

/* Ayah End Rosette Marker */
.ayah-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  position: relative;
  min-width: 1.48em;
  height: 1.48em;
  padding-inline: 0.22em;
  margin-inline: 0.26em;
  font-family: var(--font-quran);
  font-size: 0.62em;
  font-weight: 700;
  color: var(--gold-light);
  border: 1.5px solid rgba(212, 175, 55, 0.6);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18), rgba(7, 34, 25, 0.85));
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.12);
  user-select: none;
  line-height: 1;
}

.verse-inline.is-active-ayah .ayah-marker {
  background: var(--gold-primary);
  color: #051b14;
  border-color: var(--gold-light);
}

.sajdah-tag {
  display: inline-block;
  margin-inline-start: 4px;
  font-family: var(--font-ui);
  font-size: 0.45em;
  color: var(--gold-light);
  vertical-align: super;
}

/* Reader Loading & Error */
.reader-loading {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 1rem;
}

.reader-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.85s linear infinite;
}

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

/* Bottom Surah Pagination */
.surah-pagination {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
}

.pagination-btn {
  flex: 1;
  justify-content: flex-start;
  padding: 14px 18px;
  border-radius: var(--radius-md);
}

.pagination-btn--next {
  justify-content: flex-end;
  text-align: left;
}

.pagination-btn__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.pagination-btn__hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pagination-btn__name {
  font-family: var(--font-quran);
  font-size: 1.2rem;
  color: var(--gold-light);
}

/* Timing Unavailable Notice */
.timing-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  border-color: rgba(212, 175, 55, 0.28);
  text-align: center;
}

.timing-note svg {
  flex-shrink: 0;
}

/* ==========================================================================
   Reciters View
   ========================================================================== */
.reciters-container {
  max-width: 1040px;
}

.section-header-card {
  padding: clamp(20px, 3vw, 30px) 24px;
  text-align: center;
  margin-bottom: 20px;
}

.section-header-card__title {
  margin: 0 0 6px;
  font-family: var(--font-quran);
  font-size: clamp(1.85rem, 3.6vw, 2.5rem);
  color: var(--text-primary);
}

.section-header-card__desc {
  margin: 0 auto;
  max-width: 600px;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.reciters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.reciter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(11, 49, 37, 0.58), rgba(4, 22, 16, 0.76));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.25), inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform var(--transition-smooth), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-smooth);
}

.reciter-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-strong);
  background: linear-gradient(155deg, rgba(16, 68, 51, 0.68), rgba(6, 30, 22, 0.84));
}

.reciter-card.is-selected {
  border-color: var(--gold-primary);
  background: linear-gradient(155deg, rgba(212, 175, 55, 0.14), rgba(6, 34, 25, 0.86));
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35), 0 12px 32px rgba(212, 175, 55, 0.15);
}

.reciter-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.reciter-card__avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(11, 56, 41, 0.8));
  border: 1px solid rgba(212, 175, 55, 0.32);
}

.reciter-card__info {
  flex: 1;
  min-width: 0;
}

.reciter-card__name {
  margin: 0 0 2px;
  font-family: var(--font-quran);
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.reciter-card__rewaya {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.reciter-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.timing-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.timing-pill--yes {
  background: var(--madinah-bg);
  border-color: var(--madinah-border);
  color: var(--madinah-text);
}

.timing-pill--no {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

/* ==========================================================================
   Hadith View
   ========================================================================== */
.hadith-container {
  max-width: 920px;
}

.hadith-controls {
  padding: clamp(18px, 3vw, 26px);
  margin-bottom: 18px;
}

.hadith-controls__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hadith-page-title {
  margin: 0;
  font-family: var(--font-quran);
  font-size: clamp(1.8rem, 3.6vw, 2.35rem);
  line-height: 1.2;
}

.hadith-book-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 5px;
}

.hadith-select {
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border-strong);
  background: rgba(3, 18, 13, 0.82);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.hadith-book-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hadith-forms-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
  align-items: end;
}

.hadith-form {
  min-width: 0;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(3, 18, 13, 0.72);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--gold-primary);
  background: rgba(5, 28, 20, 0.94);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.14);
}

.form-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.input-clear-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.input-clear-btn:hover {
  color: var(--gold-light);
  border-color: var(--glass-border-strong);
}

.hadith-search-panel {
  padding: 18px 20px;
  margin-bottom: 18px;
}

.hadith-search-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hadith-search-panel__title {
  margin: 0;
  font-size: 1rem;
  color: var(--gold-light);
}

.hadith-search-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 390px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.hadith-result-item {
  width: 100%;
  text-align: right;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(3, 18, 13, 0.56);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.hadith-result-item:hover {
  border-color: var(--gold-primary);
  background: rgba(12, 48, 36, 0.72);
}

.hadith-result-item__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.hadith-result-item__num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
}

.hadith-result-item__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hadith-card {
  padding: clamp(22px, 4vw, 38px);
  text-align: center;
}

.hadith-card__header {
  margin-bottom: 20px;
}

.hadith-card__eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 4px;
}

.hadith-card__title {
  margin: 0 0 12px;
  font-family: var(--font-quran);
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.35;
}

.hadith-card__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hadith-card__number {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-light);
}

.hadith-grade-badge {
  display: inline-block;
  padding: 4px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.hadith-grade-badge--sahih {
  background: rgba(34, 184, 132, 0.16);
  border-color: rgba(34, 184, 132, 0.42);
  color: #7ae2b8;
}

.hadith-grade-badge--hasan {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.42);
  color: var(--gold-light);
}

.hadith-grade-badge--daif {
  background: rgba(235, 111, 111, 0.14);
  border-color: rgba(235, 111, 111, 0.38);
  color: #f6aaaa;
}

.hadith-grade-badge--neutral {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-secondary);
}

.hadith-grade-basis {
  margin: 8px auto 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 640px;
}

.hadith-card__chain {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.hadith-card__body {
  margin: 0 0 22px;
  padding: 24px 20px;
  border-radius: var(--radius-md);
  background: rgba(3, 18, 13, 0.52);
  border: 1px solid rgba(212, 175, 55, 0.14);
  font-family: var(--font-quran);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  line-height: 2.15;
  color: var(--text-primary);
  text-align: justify;
  text-align-last: center;
}

.hadith-source-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(212, 175, 55, 0.14);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.hadith-source-bar__label {
  color: var(--gold-light);
  font-weight: 700;
}

.hadith-source-bar__link {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hadith-source-bar__link:hover {
  color: #fff3c4;
}

.hadith-card__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Centered Footer Credit */
.site-credit {
  margin-top: 34px;
  padding: 16px 12px 10px;
  text-align: center;
  border-top: 1px solid rgba(212, 175, 55, 0.12);
}

.site-credit__text {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed;
  bottom: calc(var(--player-height) + 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(7, 34, 25, 0.94);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
}

/* ==========================================================================
   Persistent Bottom Audio Player
   ========================================================================== */
.glass-player {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 50;
  background: rgba(4, 21, 15, 0.88);
  border-top: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.45);
}

.audio-player__inner {
  min-height: var(--player-height);
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.7fr) minmax(160px, 1fr);
  align-items: center;
  gap: 16px;
  padding-block: 10px;
}

.player-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-track__link {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  text-align: right;
  min-width: 0;
  transition: background var(--transition-fast);
}

.player-track__link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.player-track__icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--gold-light);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(11, 56, 41, 0.8));
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.player-track__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-track__surah {
  font-family: var(--font-quran);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track__reciter {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-reciter-chip {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.28);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.player-reciter-chip:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold-primary);
}

.player-ayah-pill {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: var(--gold-light);
}

/* Center Controls */
.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.player-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.player-btn:hover {
  color: var(--gold-light);
  background: rgba(255, 255, 255, 0.06);
}

.player-btn--sm {
  width: 32px;
  height: 32px;
}

.player-btn.is-active {
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.34);
}

.player-btn--primary {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: #051c14;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.player-btn--primary:hover {
  background: linear-gradient(135deg, #f8e399, var(--gold-light));
  color: #051c14;
  transform: scale(1.05);
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.4px solid rgba(5, 28, 20, 0.25);
  border-top-color: #051c14;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.player-progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-label {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  min-width: 38px;
  text-align: center;
}

/* Custom Range Inputs */
.seek-bar,
.volume-bar {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}

.seek-bar {
  flex: 1;
}

.seek-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-light);
  border: 2px solid #062118;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
  transition: transform var(--transition-fast);
}

.seek-bar::-webkit-slider-thumb:hover,
.volume-bar::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.seek-bar::-moz-range-thumb,
.volume-bar::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--gold-light);
  border: 2px solid #062118;
}

/* Extras */
.player-extras {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.player-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  direction: ltr;
}

.player-chip:hover {
  border-color: var(--glass-border-strong);
  color: var(--gold-light);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-bar {
  width: 78px;
}

/* ==========================================================================
   Responsive Breakpoints (Mobile-First Polish)
   ========================================================================== */
@media (max-width: 900px) {
  .audio-player__inner {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "track buttons"
      "progress progress";
    gap: 8px 12px;
  }

  .player-track {
    grid-area: track;
  }

  .player-center {
    display: contents;
  }

  .player-buttons {
    grid-area: buttons;
    gap: 8px;
  }

  .player-progress {
    grid-area: progress;
  }

  .player-extras {
    display: none;
  }

  body {
    padding-bottom: 120px;
  }
}

@media (max-width: 680px) {
  .header-inner {
    gap: 10px;
  }

  .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .hadith-teaser {
    flex-direction: column;
    align-items: flex-start;
  }

  .hadith-forms-grid {
    grid-template-columns: 1fr;
  }

  .hadith-book-pills {
    display: none;
  }

  .surah-grid,
  .reciters-grid {
    grid-template-columns: 1fr;
  }

  .player-reciter-chip {
    display: none;
  }

  .surah-pagination {
    flex-direction: column;
  }

  .pagination-btn--next {
    justify-content: space-between;
    text-align: right;
  }

  .verses-flow {
    line-height: 2.3;
    text-align: right;
    text-align-last: right;
  }

  .player-track__icon {
    width: 34px;
    height: 34px;
  }
}
