/* ==========================================================================
   HADITH PORTAL - UNIFIED MODERN DESIGN SYSTEM (URDU & ENGLISH)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Scheherazade+New:wght@400;700&display=swap');

@font-face {
  font-family: 'MehrNastaliqWeb';
  src: url('/fonts/MehrNastaliqWeb.woff2') format('woff2'),
       url('/fonts/MehrNastaliqWeb.woff') format('woff'),
       url('/fonts/MehrNastaliqWeb.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'noorehira';
  src: url('/fonts/noorehira.woff') format('woff'),
       url('/fonts/noorehira.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* --- CSS Variables & Theme Engine --- */
:root {
  /* Brand Palettes (Emerald & Gold) */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-dark: #064e3b;
  --gold: #d97706;
  --gold-hover: #b45309;
  --gold-light: #fef3c7;
  --gold-border: #f59e0b;

  /* Neutral Scale (Emerald Light Default) */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-arabic: #064e3b;
  --text-urdu: #1e293b;
  --text-sanad: #15803d;
  --text-darood: #7c2d12;
  --text-takhrij: #4338ca;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Amiri', 'noorehira', 'Scheherazade New', 'Traditional Arabic', serif;
  --font-arabic-calligraphy: 'Amiri', 'Traditional Arabic', serif;
  --font-urdu: 'MehrNastaliqWeb', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', Tahoma, serif;

  /* Font Sizing Controls (Enhanced Large Crisp Readable Sizes) */
  --arabic-size: 1.62rem;
  --urdu-size: 1.48rem;
  --english-size: 1.08rem;

  /* Spacing & Borders */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 18px;
  --border-radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1);
  --shadow-gold: 0 4px 20px rgba(217, 119, 6, 0.15);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* --- Dark Theme (Midnight Slate OLED) --- */
[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-surface: #111827;
  --bg-surface-secondary: #1f2937;
  --bg-card: #131d2e;
  --bg-card-hover: #1e293b;
  --border-subtle: #1e293b;
  --border-strong: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-arabic: #34d399;
  --text-urdu: #f1f5f9;
  --text-sanad: #4ade80;
  --text-darood: #fcd34d;
  --text-takhrij: #a5b4fc;

  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-light: rgba(16, 185, 129, 0.15);
  --gold: #fbbf24;
  --gold-light: rgba(251, 191, 36, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* --- Sepia Theme (Warm Parchment) --- */
[data-theme="sepia"] {
  --bg-body: #f8f3e6;
  --bg-surface: #fdfbf7;
  --bg-surface-secondary: #f0e6d2;
  --bg-card: #fdfbf7;
  --bg-card-hover: #f5eedc;
  --border-subtle: #e6dac3;
  --border-strong: #d4c5aa;

  --text-primary: #3d2e1e;
  --text-secondary: #5c4732;
  --text-muted: #7d654c;
  --text-arabic: #1e4620;
  --text-urdu: #3d2e1e;
  --text-sanad: #2d6a30;
  --text-darood: #8c2d19;
  --text-takhrij: #3f3678;

  --primary: #2d6a4f;
  --primary-hover: #1b4332;
  --primary-light: #e8f0ea;
  --gold: #b07d1a;
  --gold-light: #f5eccf;
}

/* --- Base Resets --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Layout Containers --- */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 960px;
}

/* --- Reading Progress Bar --- */
#reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.5px;
  background: transparent;
  z-index: 1100;
}

#reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  transition: width 0.1s linear;
}

/* --- Top Navigation Header --- */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 12px;
  width: 100%;
}

.brand-section {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 48px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
  display: block;
}

.header-search-bar {
  flex: 1;
  max-width: 460px;
  margin: 0 10px;
}

.header-search-form {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  width: 100%;
  transition: all var(--transition-fast);
}

.header-search-form:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.header-book-select {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  border: none;
  border-left: 1px solid var(--border-subtle);
  padding: 7px 10px;
  font-family: var(--font-urdu), var(--font-sans);
  font-size: 0.84rem;
  outline: none;
  cursor: pointer;
  max-width: 140px;
}

.header-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

#header-search-input {
  width: 100%;
  padding: 7px 12px;
  border: none;
  background: transparent;
  font-family: var(--font-urdu), var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  color: var(--text-primary);
  text-align: right;
}

.header-search-submit {
  border-radius: 0;
  padding: 7px 15px;
  font-size: 0.85rem;
  height: 100%;
  border: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mobile-search-drawer {
  padding: 10px 0 14px;
  border-top: 1px solid var(--border-subtle);
  width: 100%;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 0.65rem;
  padding: 2px 5px;
}

.mobile-only-toggle {
  display: none;
}

/* --- Buttons & Badges --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--border-subtle);
  color: var(--text-primary);
}

.btn-gold {
  background: var(--gold);
  color: #ffffff;
}

.btn-gold:hover {
  background: var(--gold-hover);
  color: #ffffff;
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-surface-secondary);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  background: var(--bg-surface-secondary);
  border-color: var(--primary);
  color: var(--primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-gold {
  background: var(--gold-light);
  color: var(--gold);
}

/* --- Hero Banner Section --- */
.hero-section {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-secondary) 100%);
  border-bottom: 1px solid var(--border-subtle);
  padding: 48px 0 40px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-title-ar {
  font-family: var(--font-urdu);
  font-size: 2.75rem;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.hero-title-en {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.hero-description {
  max-width: 680px;
  margin: 0 auto 24px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.hero-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 14px 22px;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
}

.hero-stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.hero-stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* --- Hadith of the Day Feature Card --- */
.hotd-card {
  background: var(--bg-card);
  border: 1.5px solid var(--gold-border);
  border-radius: var(--border-radius-lg);
  padding: 24px 28px;
  margin: 0 auto 36px;
  max-width: 850px;
  box-shadow: var(--shadow-gold);
  text-align: right;
  position: relative;
}

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

.hotd-arabic {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  color: var(--text-arabic);
  line-height: 1.9;
  margin-bottom: 12px;
  direction: rtl;
}

.hotd-urdu {
  font-family: var(--font-urdu);
  font-size: 1.2rem;
  color: var(--text-urdu);
  line-height: 1.9;
  margin-bottom: 12px;
  direction: rtl;
}

.hotd-english {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
  direction: ltr;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 10px;
}

/* --- Collection Grid (Home Page) --- */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
  padding: 36px 0 60px;
}

.collection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.collection-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.collection-card.featured {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--primary-light) 100%);
}

.collection-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.collection-title-urdu {
  font-family: var(--font-urdu);
  font-size: 1.7rem;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 4px;
  direction: rtl;
}

.collection-title-en {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.collection-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  direction: rtl;
  font-family: var(--font-urdu);
}

.collection-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* --- Sticky Chapter / Book Navigation Bar --- */
.reader-sticky-nav {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 72px;
  z-index: 900;
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
}

.reader-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb-sep {
  color: var(--border-strong);
}

/* --- Prominent Hadith Page Book Header --- */
.hadith-page-book-header {
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.hadith-page-book-header:hover {
  border-color: var(--border-strong);
}

.hadith-header-book-title {
  transition: transform var(--transition-fast);
}

.hadith-header-book-title:hover h1 {
  color: var(--primary-hover) !important;
}

.hadith-header-book-title:hover {
  transform: translateY(-2px);
}

/* --- Customizer Toolbar --- */
.customizer-bar {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.customizer-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customizer-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.font-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.font-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.toggle-switch-btn {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-switch-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* --- Hadith Reading Card --- */
.hadith-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.hadith-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.hadith-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.hadith-number-pill {
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hadith-ref-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* --- Arabic Text Box --- */
.hadith-arabic-box {
  background: var(--bg-surface-secondary);
  border-radius: var(--border-radius-md);
  padding: 22px 24px;
  margin-bottom: 20px;
  border-right: 4px solid var(--primary);
  direction: rtl;
  text-align: justify;
}

.hadith-arabic-text {
  font-family: var(--font-arabic);
  font-size: var(--arabic-size);
  color: var(--text-arabic);
  line-height: 2.1;
  word-spacing: 2px;
}

/* --- Urdu Text Box --- */
.hadith-urdu-box {
  margin-bottom: 20px;
  direction: rtl;
  text-align: justify;
  padding: 8px 4px;
}

.hadith-urdu-text {
  font-family: var(--font-urdu);
  font-size: var(--urdu-size);
  color: var(--text-urdu);
  line-height: 2.3;
  word-spacing: 1px;
}

.hadith_sanad_color {
  color: var(--text-sanad);
  font-weight: bold;
}

.darood {
  color: var(--text-darood);
  font-weight: bold;
}

.utakh3 {
  color: var(--text-muted);
  font-size: 0.95em;
}

.arb,
.arbt,
.arabic-inline,
span.arb,
span.arbt,
span.arabic-inline {
  font-family: var(--font-arabic-calligraphy), 'Amiri', 'Traditional Arabic', 'Scheherazade New', 'Lateef', serif !important;
  font-size: 1.02em !important;
  line-height: inherit !important;
  vertical-align: baseline !important;
  color: var(--gold) !important;
  font-weight: 700 !important;
  display: inline !important;
  direction: rtl !important;
  letter-spacing: 0 !important;
  padding: 0 3px !important;
}

.ref,
span.ref {
  display: inline-block !important;
  margin-top: 12px !important;
  font-size: 1.05rem !important;
  color: var(--primary) !important;
  font-family: var(--font-urdu) !important;
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1px solid rgba(16, 185, 129, 0.25) !important;
  border-right: 4px solid var(--primary) !important;
  padding: 4px 12px !important;
  border-radius: 6px !important;
  line-height: 1.8 !important;
  direction: rtl !important;
}

.hfoot {
  display: block;
  background: var(--bg-surface-secondary);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  border-right: 3px solid var(--gold);
  margin-top: 12px;
  font-size: 0.95em;
  color: var(--text-secondary);
}

/* --- English Text Box --- */
.hadith-english-box {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 18px;
  margin-bottom: 20px;
  direction: ltr;
  text-align: left;
}

.hadith-narrator-lead {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.hadith-english-text {
  font-size: var(--english-size);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* --- Tahqeeq, Hukm & Takhreej Section --- */
.hadith-tahqeeq-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-subtle);
}

.tahqeeq-card {
  border-radius: var(--border-radius-md);
  padding: 14px 18px;
  direction: rtl;
  text-align: right;
  transition: all var(--transition-fast);
}

.tahqeeq-card.zai {
  background: var(--primary-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-right: 4px solid var(--primary);
}

.tahqeeq-card.albani {
  background: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-right: 4px solid var(--gold);
}

.tahqeeq-card.general {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-right: 4px solid var(--primary);
}

.tahqeeq-card.takhreej {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-right: 4px solid #6366f1;
}

.tahqeeq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.scholar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-urdu), var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 14px;
}

.scholar-badge.zai {
  background: var(--primary);
  color: #ffffff;
}

.scholar-badge.albani {
  background: var(--gold);
  color: #ffffff;
}

.scholar-badge.general {
  background: var(--text-secondary);
  color: #ffffff;
}

.scholar-badge.takhreej {
  background: #6366f1;
  color: #ffffff;
}

.tahqeeq-content {
  font-family: var(--font-arabic), var(--font-urdu), var(--font-sans);
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.tahqeeq-content.takhreej-text {
  font-family: var(--font-arabic), var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tahqeeq-content .arbt {
  color: var(--text-arabic);
  font-family: var(--font-arabic);
}

[data-theme="dark"] .tahqeeq-card.zai {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .tahqeeq-card.albani {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .tahqeeq-card.takhreej {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="sepia"] .tahqeeq-card.zai {
  background: rgba(45, 106, 79, 0.1);
  border-color: rgba(45, 106, 79, 0.3);
}

[data-theme="sepia"] .tahqeeq-card.albani {
  background: rgba(176, 125, 26, 0.1);
  border-color: rgba(176, 125, 26, 0.3);
}

[data-theme="sepia"] .tahqeeq-card.takhreej {
  background: rgba(67, 56, 202, 0.08);
  border-color: rgba(67, 56, 202, 0.25);
}

/* --- Action Toolbar (Cards) --- */
.hadith-action-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 10px;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hadith-act-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hadith-act-btn:hover {
  background: var(--bg-surface-secondary);
  color: var(--primary);
  border-color: var(--primary);
}

.hadith-act-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* --- 5-Button Dynamic Pagination Bar --- */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.page-num-btn {
  min-width: 44px;
  height: 44px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.page-num-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--bg-surface-secondary);
}

.page-num-btn.current {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

/* --- Table of Babs & Kitabs --- */
.babs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.bab-card-row {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  content-visibility: auto;
  contain-intrinsic-size: 0 350px;
}

.bab-card-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.bab-header-row {
  content-visibility: visible !important;
  scroll-margin-top: 80px;
}

.bab-card-cell {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  direction: rtl;
  gap: 16px;
}

.bab-urdu-title {
  font-family: var(--font-urdu);
  font-size: 1.25rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.bab-arabic-title {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  color: var(--primary);
  line-height: 1.4;
}

/* --- Notes Area --- */
.hadith-notes-box {
  display: none;
  background: var(--bg-surface-secondary);
  border-radius: var(--border-radius-md);
  padding: 16px;
  margin-top: 14px;
}

.notes-textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  resize: vertical;
}

/* --- Toast Notification --- */
#toast-notification {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #111827;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-bottom: 36px;
}

.footer-col-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
  .hero-title-ar {
    font-size: 2.1rem;
  }
  .hero-title-en {
    font-size: 1.6rem;
  }
  .collections-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Distinct & Compact Hadith Research & Wazahat Cards --- */
.hadith-wazahat-compact {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-right: 5px solid #0284c7;
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  margin-top: 16px;
  font-family: var(--font-urdu);
}

[data-theme="dark"] .hadith-wazahat-compact {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.3);
  border-right-color: #38bdf8;
}

.wazahat-badge {
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 1.2rem;
  white-space: nowrap;
  font-family: var(--font-urdu);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

[data-theme="dark"] .wazahat-badge {
  background: rgba(14, 165, 233, 0.25);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}

.wazahat-text {
  font-size: 1.28rem;
  line-height: 2.2;
  color: var(--text-primary);
  font-family: var(--font-urdu);
  flex: 1;
}

.hadith-tahqeeq-compact-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  font-family: var(--font-urdu);
}

.tahqeeq-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-urdu);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-secondary);
  box-sizing: border-box;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.tahqeeq-label {
  font-weight: 700;
  display: inline-block;
  font-size: 0.82rem;
  font-family: var(--font-arabic), var(--font-urdu);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tahqeeq-value {
  display: inline;
  font-family: var(--font-urdu);
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.7;
  word-break: break-word;
  flex: 1;
}

/* 1. Albani Row (Amber / Gold Accent) */
.tahqeeq-row.albani-row {
  background: rgba(217, 119, 6, 0.07);
  border-color: rgba(217, 119, 6, 0.25);
  border-right: 4px solid #d97706;
}
.tahqeeq-label.albani-label {
  color: #92400e;
  background: rgba(217, 119, 6, 0.15);
  border: 1px solid rgba(217, 119, 6, 0.25);
}
[data-theme="dark"] .tahqeeq-row.albani-row {
  background: rgba(217, 119, 6, 0.12);
  border-color: rgba(217, 119, 6, 0.35);
  border-right-color: #f59e0b;
}
[data-theme="dark"] .tahqeeq-label.albani-label {
  background: rgba(217, 119, 6, 0.28);
  color: #fbbf24;
}

/* 2. Zubair Ali Zai Row (Emerald / Green Accent) */
.tahqeeq-row.zai-row {
  background: rgba(22, 163, 74, 0.07);
  border-color: rgba(22, 163, 74, 0.25);
  border-right: 4px solid #16a34a;
}
.tahqeeq-label.zai-label {
  color: #166534;
  background: rgba(22, 163, 74, 0.15);
  border: 1px solid rgba(22, 163, 74, 0.25);
}
[data-theme="dark"] .tahqeeq-row.zai-row {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  border-right-color: #34d399;
}
[data-theme="dark"] .tahqeeq-label.zai-label {
  background: rgba(16, 185, 129, 0.28);
  color: #4ade80;
}

/* 3. Takhreej Row (Indigo / Lavender Accent) */
.tahqeeq-row.takhreej-row {
  background: rgba(99, 102, 241, 0.07);
  border-color: rgba(99, 102, 241, 0.25);
  border-right: 4px solid #6366f1;
}
.tahqeeq-label.takhreej-label {
  color: #3730a3;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
[data-theme="dark"] .tahqeeq-row.takhreej-row {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  border-right-color: #818cf8;
}
[data-theme="dark"] .tahqeeq-label.takhreej-label {
  background: rgba(99, 102, 241, 0.28);
  color: #a5b4fc;
}

/* 4. General Hukm Row (Slate Accent) */
.tahqeeq-row.general-row {
  background: rgba(100, 116, 139, 0.07);
  border-color: rgba(100, 116, 139, 0.25);
  border-right: 4px solid #64748b;
}
.tahqeeq-label.general-label {
  color: #334155;
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.25);
}
[data-theme="dark"] .tahqeeq-row.general-row {
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.35);
  border-right-color: #94a3b8;
}
[data-theme="dark"] .tahqeeq-label.general-label {
  background: rgba(100, 116, 139, 0.28);
  color: #cbd5e1;
}

/* Fix label colors in light theme for zai and takhreej */
[data-theme="light"] .tahqeeq-label.zai-label { color: #166534; }
[data-theme="light"] .tahqeeq-label.takhreej-label { color: #3730a3; }
[data-theme="light"] .tahqeeq-label.general-label { color: #334155; }

/* Global Urdu Font Alignment across all Urdu textual containers */
.hurdu, .hadith-urdu-text, .bab-urdu-title, .cnameurdu, .scnameurdu, .wazahat-text, .tahqeeq-value, .hadith-number-pill, .wazahat-badge, .tahqeeq-label {
  font-family: var(--font-urdu) !important;
}

/* ==========================================================================
   HADITH CANVAS IMAGE STUDIO (حدیث کارڈ اسٹوڈیو)
   ========================================================================== */
.canvas-studio-modal {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  max-width: 620px;
  width: 94%;
  max-height: 92vh;
  overflow-y: auto;
  text-align: center;
  direction: rtl;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}
.canvas-control-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.canvas-toggle-btn {
  padding: 5px 12px;
  font-size: 0.82rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.canvas-toggle-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.canvas-theme-badge {
  padding: 5px 12px;
  font-size: 0.82rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.canvas-theme-badge:hover {
  transform: scale(1.05);
}
.canvas-theme-badge.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.35);
}
.canvas-preview-container {
  position: relative;
  background: #090d16;
  border-radius: var(--border-radius-md);
  padding: 10px;
  margin: 12px 0 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-subtle);
}
#hadith-canvas {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  display: block;
}

/* ==========================================================================
   SANAD VS MATN VISUAL HIERARCHY (سند اور متن کی تفریق)
   ========================================================================== */
.hadith-sanad-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(5, 150, 105, 0.12);
  color: var(--primary);
  margin-left: 6px;
  vertical-align: middle;
}
.hadith-matn-tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(217, 119, 6, 0.15);
  color: var(--gold-hover);
  margin-left: 6px;
  vertical-align: middle;
}

/* ==========================================================================
   AUDIO MEMORIZATION & HIFZ LOOPER (حفظ و تکرار پلیئر)
   ========================================================================== */
.audio-looper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 10px 16px;
  margin: 14px 0;
  flex-wrap: wrap;
  gap: 10px;
}
.audio-play-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.audio-play-btn:hover {
  transform: scale(1.08);
}
.audio-looper-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

/* ==========================================================================
   STUDY FOLDERS & BOOKMARK MANAGER
   ========================================================================== */
.folder-pill {
  padding: 6px 14px;
  border-radius: var(--border-radius-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}
.folder-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ==========================================================================
   KEYWORD SEARCH HIGHLIGHTING
   ========================================================================== */
mark.search-highlight {
  background: #fef08a;
  color: #854d0e;
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 700;
}
[data-theme="dark"] mark.search-highlight {
  background: #854d0e;
  color: #fef08a;
}
[data-theme="sepia"] mark.search-highlight {
  background: #fde68a;
  color: #78350f;
}

/* ==========================================================================
   ACCESSIBILITY & FOCUS VISIBILITY (WCAG 2.1 AA)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary) !important;
  outline-offset: 2px !important;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE BREAKPOINTS)
   ========================================================================== */

/* Tablet & Medium Screens */
@media (max-width: 991px) {
  .desktop-only-search {
    display: none !important;
  }
  .mobile-only-toggle {
    display: inline-flex !important;
  }
  .nav-text-btn {
    display: none !important;
  }
  .hero-stats-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
  }
  .collections-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 14px !important;
  }
}

/* Small Tablets & Large Phones */
@media (max-width: 767px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* Spacing for bottom nav bar on mobile */
  body {
    padding-bottom: 64px;
  }

  .container {
    padding: 0 12px !important;
  }
  .container-narrow {
    max-width: 100% !important;
  }

  /* --- Header: prevent overflow on small screens --- */
  .header-inner {
    min-height: 56px !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  .brand-logo-img {
    height: 34px !important;
    max-width: 150px !important;
  }
  /* Keep only icon buttons in header controls; text buttons hidden */
  .nav-text-btn {
    display: none !important;
  }
  .header-controls {
    gap: 4px !important;
    flex-shrink: 0 !important;
  }

  /* --- Hero Section --- */
  .hero-section {
    padding: 20px 0 16px !important;
  }
  .hero-title-ar {
    font-size: 1.75rem !important;
  }
  .hero-title-en {
    font-size: 1rem !important;
  }
  .hero-description {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
  }
  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 16px !important;
  }
  .hero-stat-card {
    padding: 10px 12px !important;
  }
  .hero-stat-number {
    font-size: 1.3rem !important;
  }

  /* --- Collection Grid --- */
  .collections-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 20px 0 40px !important;
  }
  .collection-card {
    padding: 16px !important;
  }

  /* --- HOTD Card --- */
  .hotd-card {
    padding: 14px !important;
    margin-top: 14px !important;
  }
  .hotd-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .hotd-arabic {
    font-size: 1.28rem !important;
    line-height: 1.8 !important;
  }
  .hotd-urdu {
    font-size: 1.12rem !important;
    line-height: 2 !important;
  }

  /* --- Hadith Card --- */
  .hadith-card {
    padding: 14px 12px !important;
    border-radius: var(--border-radius-md) !important;
  }
  .hadith-arabic-text {
    font-size: 1.32rem !important;
    line-height: 1.9 !important;
  }
  .hadith-urdu-text {
    font-size: 1.18rem !important;
    line-height: 2.1 !important;
  }
  .hadith-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  /* --- Action Toolbar: 2-column grid --- */
  .hadith-action-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .action-buttons-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .hadith-act-btn {
    justify-content: center !important;
    min-height: 40px !important;
    font-size: 0.82rem !important;
    flex: none !important;
  }

  /* --- Reader Sticky Nav: compact on mobile --- */
  .reader-sticky-nav {
    padding: 6px 0 !important;
    top: 56px !important;
  }
  .reader-nav-inner {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  /* Truncate breadcrumbs on mobile */
  .breadcrumbs {
    font-size: 0.75rem !important;
    max-width: calc(100vw - 140px) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
  .breadcrumb-item:not(:first-child):not(:last-child) {
    display: none !important;
  }
  .breadcrumb-sep:not(:last-of-type) {
    display: none !important;
  }

  /* --- Customizer Bar: wrap cleanly --- */
  .customizer-bar {
    padding: 8px 10px !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }
  .customizer-group {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .customizer-label {
    width: 100% !important;
    margin-bottom: 2px !important;
  }

  /* --- Table & Babs --- */
  .babs-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .bab-card-cell {
    padding: 12px 14px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  /* --- Pagination --- */
  .pagination-wrapper {
    gap: 4px !important;
    flex-wrap: wrap !important;
    margin: 20px 0 !important;
  }
  .page-num-btn {
    min-width: 36px !important;
    height: 36px !important;
    font-size: 0.85rem !important;
  }

  /* --- Footer --- */
  .site-footer {
    padding: 32px 0 16px !important;
    margin-top: 32px !important;
  }
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    margin-bottom: 20px !important;
  }
  .footer-bottom {
    flex-direction: column !important;
    text-align: center !important;
    gap: 10px !important;
    font-size: 0.78rem !important;
  }
  .footer-bottom > div:last-child {
    justify-content: center !important;
    gap: 12px !important;
  }

  /* Toast and Back to top rise above bottom nav */
  #toast-notification {
    bottom: 76px !important;
  }
  #back-to-top-btn {
    bottom: 74px !important;
    left: 14px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
  }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .brand-logo-img {
    height: 30px !important;
    max-width: 130px !important;
  }
  .header-inner {
    min-height: 50px !important;
    gap: 3px !important;
  }
  .icon-btn {
    width: 34px !important;
    height: 34px !important;
  }
  .btn {
    padding: 7px 12px !important;
    font-size: 0.82rem !important;
  }
  .hero-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .hadith-arabic-text {
    font-size: 1.22rem !important;
    line-height: 1.85 !important;
  }
  .hadith-urdu-text {
    font-size: 1.1rem !important;
    line-height: 2 !important;
  }
  .bab-urdu-title {
    font-size: 1.15rem !important;
    line-height: 1.9 !important;
  }
  .bab-arabic-title {
    font-size: 1.2rem !important;
  }
  .wazahat-text {
    font-size: 1.05rem !important;
    line-height: 1.9 !important;
  }
  .tahqeeq-value {
    font-size: 0.88rem !important;
  }
  /* Stack 2-col action buttons to 1-col on very small phones */
  .action-buttons-group {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   BOTTOM MOBILE NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  z-index: 950;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  height: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 2px;
  border-radius: var(--border-radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
}

.mobile-nav-item svg {
  transition: transform var(--transition-fast);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary);
}

.mobile-nav-item:hover svg,
.mobile-nav-item.active svg {
  transform: scale(1.1);
}

.mobile-nav-item.active .mobile-nav-dot {
  display: block;
}

.mobile-nav-dot {
  display: none;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: -2px;
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: stretch;
  }
}

