/* ============================================================
   Aalim — Premium Islamic Knowledge Platform
   Professional Modern Islamic Design System
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;500;600;700&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ────────────────────────────────── */
:root {
  /* Dark Scale */
  --dark-950:  #020617;
  --dark-900:  #0a0f1e;
  --dark-800:  #0f172a;
  --dark-700:  #1e293b;
  --dark-600:  #334155;
  --dark-500:  #475569;

  /* Islamic Green Scale */
  --green-950: #022c22;
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-300: #6ee7b7;

  /* Gold Scale */
  --gold-600:  #b45309;
  --gold-500:  #d97706;
  --gold-400:  #f59e0b;
  --gold-300:  #fbbf24;
  --gold-200:  #fde68a;

  /* Text */
  --white:          #f8fafc;
  --text-primary:   #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;

  /* Typography */
  --font-ur: 'Noto Nastaliq Urdu', serif;
  --font-ar: 'Amiri', serif;
  --font-en: 'Inter', sans-serif;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;

  /* Shadows / Glows */
  --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);
  --shadow-glow-gold:  0 0 20px rgba(245, 158, 11, 0.15);
  --shadow-card:       0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg:         0 8px 40px rgba(0, 0, 0, 0.5);

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-base:   0.2s ease;
  --transition-slow:   0.3s ease;

  /* Layout */
  --navbar-h:  68px;
  --max-width: 1280px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-en);
  background-color: var(--dark-950);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-900); }
::-webkit-scrollbar-thumb {
  background: var(--dark-600);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--green-700); }

/* ── Screen Reader Only ───────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Islamic Geometric Pattern Utility ────────────────────── */
.pattern-border {
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 8px,
      rgba(16, 185, 129, 0.06) 8px,
      rgba(16, 185, 129, 0.06) 9px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(245, 158, 11, 0.04) 8px,
      rgba(245, 158, 11, 0.04) 9px
    );
}

.pattern-bg {
  background-image:
    repeating-linear-gradient(
      60deg,
      transparent,
      transparent 20px,
      rgba(16, 185, 129, 0.03) 20px,
      rgba(16, 185, 129, 0.03) 21px
    ),
    repeating-linear-gradient(
      -60deg,
      transparent,
      transparent 20px,
      rgba(16, 185, 129, 0.03) 20px,
      rgba(16, 185, 129, 0.03) 21px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 20px,
      rgba(245, 158, 11, 0.02) 20px,
      rgba(245, 158, 11, 0.02) 21px
    );
}

/* ── Keyframe Animations ──────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
  50%       { box-shadow: 0 0 30px rgba(16, 185, 129, 0.5); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

@keyframes borderRotate {
  to { transform: rotate(360deg); }
}

/* ── Loading Spinner ──────────────────────────────────────── */
.loading-spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.loading-spinner::before {
  content: '';
  display: block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(16, 185, 129, 0.2);
  border-top-color: var(--green-500);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loading-spinner.sm::before { width: 18px; height: 18px; border-width: 2px; }
.loading-spinner.lg::before { width: 40px; height: 40px; border-width: 4px; }

/* Full-page loader overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ── Navbar ───────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-h);
  background: rgba(10, 15, 30, 0.82);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  padding: 0 24px;
  transition: background var(--transition-slow);
}

.navbar.scrolled {
  background: rgba(10, 15, 30, 0.96);
  border-bottom-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-en);
  background: linear-gradient(135deg, var(--green-400), var(--gold-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  transition: opacity var(--transition-base);
}

.nav-brand:hover { opacity: 0.85; }
.nav-brand .brand-emoji { font-size: 1.5rem; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition-base), background var(--transition-base);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green-400);
  background: rgba(16, 185, 129, 0.1);
}

.nav-links a.active {
  color: var(--green-400);
}

/* Quran Nav Highlight (Honoring Kalam Allah) */
.nav-quran-highlight {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(217, 119, 6, 0.18) 100%) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  color: #fef08a !important;
  font-weight: 700 !important;
  border-radius: 20px !important;
  padding: 6px 14px !important;
  box-shadow: 0 0 14px rgba(217, 119, 6, 0.22) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.25s ease !important;
}
.nav-quran-highlight:hover,
.nav-quran-highlight[aria-current="page"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.38) 0%, rgba(217, 119, 6, 0.32) 100%) !important;
  border-color: #fbbf24 !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.45) !important;
  transform: translateY(-1px) !important;
}

/* Mobile Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition-base);
}

/* ── Layout Shell ─────────────────────────────────────────── */
.page-wrapper {
  padding-top: var(--navbar-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.main-content {
  flex: 1;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,   rgba(6, 78, 59, 0.45) 0%,  transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 100%,  rgba(180, 83, 9, 0.15) 0%, transparent 60%),
    linear-gradient(170deg, var(--dark-900) 0%, var(--green-950) 50%, var(--dark-900) 100%);
  padding: 80px 24px 60px;
}

/* Subtle geometric overlay on hero */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(16, 185, 129, 0.04) 40px,
      rgba(16, 185, 129, 0.04) 41px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(245, 158, 11, 0.03) 40px,
      rgba(245, 158, 11, 0.03) 41px
    );
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--dark-950));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  animation: fadeInUp 0.6s ease both;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.hero-title .accent-green {
  background: linear-gradient(135deg, var(--green-400), var(--green-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title .accent-gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-arabic {
  font-family: var(--font-ar);
  font-size: 1.8rem;
  color: var(--gold-300);
  margin-bottom: 8px;
  line-height: 1.8;
  direction: rtl;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition:
    background     var(--transition-base),
    color          var(--transition-base),
    box-shadow     var(--transition-base),
    transform      var(--transition-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

/* Primary — green */
.btn-primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: var(--white);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.45);
}

/* Secondary — outlined */
.btn-secondary {
  background: transparent;
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.btn-secondary:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--green-400);
  box-shadow: var(--shadow-glow-green);
}

/* Gold */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
  color: var(--dark-900);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.25);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-300));
  box-shadow: 0 4px 24px rgba(245, 158, 11, 0.45);
}

/* Ghost */
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Sizes */
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 30px; font-size: 1rem; }

/* Icon-only */
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ── Filter Buttons ───────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 7px 16px;
  background: var(--dark-700);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  font-family: var(--font-en);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-400);
  border-color: rgba(16, 185, 129, 0.3);
}

.filter-btn.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-400);
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: var(--shadow-glow-green);
}

/* ── Topic Tags ───────────────────────────────────────────── */
.topic-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-base);
}

.topic-tag:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

.topic-tag.gold {
  background: rgba(245, 158, 11, 0.1);
  color: var(--gold-300);
  border-color: rgba(245, 158, 11, 0.2);
}

.topic-tag.gold:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

/* ── Glassmorphism Card Base ──────────────────────────────── */
.glass-card {
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.glass-card:hover {
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
}

/* ── Book Card ────────────────────────────────────────────── */
.book-card {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition-slow);
  animation: fadeIn 0.4s ease both;
}

.book-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
  transform: translateY(-3px);
}

.book-card-title {
  font-family: var(--font-ar);
  font-size: 1.2rem;
  color: var(--gold-300);
  direction: rtl;
  line-height: 1.7;
}

.book-card-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Dua Card ─────────────────────────────────────────────── */
.dua-card {
  background: var(--dark-800);
  border: 1px solid rgba(245, 158, 11, 0.1);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all var(--transition-slow);
  animation: fadeIn 0.4s ease both;
  position: relative;
  overflow: hidden;
}

.dua-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(to bottom, var(--gold-400), var(--gold-600));
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.dua-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
  box-shadow: var(--shadow-card), var(--shadow-glow-gold);
  transform: translateY(-2px);
}

.dua-arabic {
  font-family: var(--font-ar);
  font-size: 1.6rem;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 2;
}

.dua-transliteration {
  font-size: 0.9rem;
  color: var(--green-400);
  font-style: italic;
}

.dua-translation {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Name Card ────────────────────────────────────────────── */
.name-card {
  background: var(--dark-700);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  transition: all var(--transition-base);
  animation: fadeIn 0.3s ease both;
}

.name-card:hover {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-2px);
}

.name-arabic {
  font-family: var(--font-ar);
  font-size: 1.4rem;
  color: var(--gold-300);
  direction: rtl;
}

.name-english {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.name-meaning {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.gender-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.gender-badge.male {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.gender-badge.female {
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

/* ── Q&A Card ─────────────────────────────────────────────── */
.qa-card {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  transition: all var(--transition-slow);
  animation: fadeIn 0.4s ease both;
}

.qa-card:hover {
  border-color: rgba(16, 185, 129, 0.25);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
  transform: translateY(-2px);
}

.qa-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
}

.qa-question-ur {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 2;
}

.qa-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Reference Card ───────────────────────────────────────── */
.ref-card {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--gold-400);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-base);
  animation: fadeIn 0.3s ease both;
}

.ref-card:hover {
  border-left-color: var(--gold-300);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: var(--shadow-glow-gold);
}

.ref-card-source {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ref-card-arabic {
  font-family: var(--font-ar);
  font-size: 1.1rem;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.9;
}

.ref-card-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Ayah Card (Quran) ────────────────────────────────────── */
.ayah-card {
  background: linear-gradient(145deg, var(--dark-800), rgba(6, 78, 59, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
}

.ayah-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.ayah-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
}

.ayah-arabic {
  font-family: var(--font-ar);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 2.2;
}

.ayah-ref {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ayah-ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--green-400);
}

.ayah-translation {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

/* ── Hadith Arabic Main (large display) ──────────────────── */
.hadith-arabic-main {
  font-family: var(--font-ar);
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 2.3;
  padding: 24px 28px;
  background: rgba(15, 23, 42, 0.6);
  border-right: 3px solid var(--green-500);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ── Hadith Navigation Buttons ────────────────────────────── */
.nav-h-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--dark-700);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-family: var(--font-en);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
}

.nav-h-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-400);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-glow-green);
}

.nav-h-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Result Cards (Search) ────────────────────────────────── */
.result-card {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-slow);
  animation: fadeIn 0.35s ease both;
}

.result-card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
  transform: translateY(-2px);
}

.result-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: fit-content;
}

.result-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.result-arabic {
  font-family: var(--font-ar);
  font-size: 1.05rem;
  color: var(--gold-300);
  direction: rtl;
  text-align: right;
  line-height: 1.9;
}

.result-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-snippet mark {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-300);
  border-radius: 3px;
  padding: 1px 3px;
}

/* ── Chat Section ─────────────────────────────────────────── */
.chat-section {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--navbar-h) - 40px);
  max-height: 800px;
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.chat-header {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(8px);
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.chat-header-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-info span {
  font-size: 0.78rem;
  color: var(--green-400);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

/* Aalim (AI) message bubble */
.aalim-msg {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  animation: fadeIn 0.3s ease both;
}

.aalim-msg .msg-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.aalim-msg .msg-bubble {
  max-width: 75%;
  background: var(--dark-800);
  border: 1px solid rgba(16, 185, 129, 0.12);
  border-radius: 18px 18px 18px 4px;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.7;
  box-shadow: var(--shadow-card);
}

.aalim-msg .msg-bubble .arabic-inline {
  font-family: var(--font-ar);
  color: var(--green-400);
  font-size: 1.05rem;
  direction: rtl;
  display: block;
  margin: 6px 0;
}

/* User message bubble */
.user-msg {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-direction: row-reverse;
  animation: fadeIn 0.3s ease both;
}

.user-msg .msg-bubble {
  max-width: 70%;
  background: linear-gradient(135deg, var(--green-900), var(--green-800));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.65;
}

.user-msg.rtl .msg-bubble {
  font-family: var(--font-ur);
  direction: rtl;
  text-align: right;
  font-size: 1rem;
  line-height: 2;
}

.msg-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

/* Chat Input */
.chat-input-area {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 10px 14px;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.chat-input-wrapper:focus-within {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--shadow-glow-green);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-en);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  min-height: 24px;
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-base);
  color: var(--white);
  font-size: 0.9rem;
}

.chat-send-btn:hover {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
  transform: scale(1.05);
}

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  padding: 12px 0;
  margin-bottom: 8px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  list-style: none;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.breadcrumb ol li {
  display: flex;
  align-items: center;
  gap: 4px;
}

.breadcrumb ol li a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-base);
}

.breadcrumb ol li a:hover { color: var(--green-400); }

.breadcrumb ol li + li::before {
  content: '/';
  color: var(--dark-500);
}

.breadcrumb ol li:last-child {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Section Headings ─────────────────────────────────────── */
.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.65;
}

.section-arabic {
  font-family: var(--font-ar);
  font-size: 1.4rem;
  color: var(--gold-300);
  direction: rtl;
  margin-bottom: 4px;
}

/* Decorative line accent */
.title-accent {
  display: inline-block;
  position: relative;
}

.title-accent::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--green-500), transparent);
  border-radius: 1px;
}

/* ── Section Divider ──────────────────────────────────────── */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(16, 185, 129, 0.25) 20%,
    rgba(245, 158, 11, 0.15) 50%,
    rgba(16, 185, 129, 0.25) 80%,
    transparent
  );
  margin: 32px 0;
}

/* ── Search Bar ───────────────────────────────────────────── */
.search-bar {
  position: relative;
  max-width: 640px;
}

.search-input {
  width: 100%;
  padding: 14px 52px 14px 18px;
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: var(--font-en);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: var(--shadow-glow-green);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 1rem;
}

/* ── Grid Layouts ─────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ── Stats Row ────────────────────────────────────────────── */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--transition-slow);
}

.stat-card:hover {
  border-color: rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-400);
  background: linear-gradient(135deg, var(--green-400), var(--green-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Feature Card ─────────────────────────────────────────── */
.feature-card {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all var(--transition-slow);
  cursor: default;
}

.feature-card:hover {
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
  transform: translateY(-3px);
}

.feature-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.feature-icon.gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border-color: rgba(245, 158, 11, 0.2);
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feature-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── Alert / Info Boxes ───────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
  border: 1px solid;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--green-400);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--gold-300);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 24px 0;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.page-link:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--green-400);
  border-color: rgba(16, 185, 129, 0.3);
}

.page-link.active {
  background: var(--green-700);
  border-color: var(--green-600);
  color: var(--white);
  box-shadow: var(--shadow-glow-green);
}

.page-link.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── Form Elements ────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-en);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--shadow-glow-green);
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.65; }

/* ── Badge / Pill ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-400);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-300);
}

.badge-muted {
  background: rgba(71, 85, 105, 0.3);
  color: var(--text-muted);
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: var(--dark-900);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 60px 0 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--green-400), var(--gold-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-family: var(--font-ar);
  font-size: 1.2rem;
  color: var(--gold-300);
  direction: rtl;
  text-align: right;
  line-height: 1.8;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-links a:hover { color: var(--green-400); }

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── Decorative Islamic Separator ─────────────────────────── */
.islamic-sep {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold-400);
  font-size: 1.1rem;
  margin: 28px 0;
}

.islamic-sep::before,
.islamic-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(245, 158, 11, 0.3),
    rgba(16, 185, 129, 0.2),
    transparent
  );
}

/* ── Tooltip ──────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-700);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--dark-700) 25%,
    var(--dark-600) 50%,
    var(--dark-700) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text  { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 12px; }
.skeleton-card  { height: 160px; border-radius: var(--radius-lg); }

/* ── RTL Support ──────────────────────────────────────────── */
[dir="rtl"],
.rtl {
  direction: rtl;
  text-align: right;
}

.rtl .ref-card {
  border-left: none;
  border-right: 3px solid var(--gold-400);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.rtl .hadith-arabic-main {
  border-right: none;
  border-left: 3px solid var(--green-500);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* ── Utility Spacing ──────────────────────────────────────── */
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.py-16 { padding-top: 16px; padding-bottom: 16px; }
.py-24 { padding-top: 24px; padding-bottom: 24px; }
.py-48 { padding-top: 48px; padding-bottom: 48px; }
.py-64 { padding-top: 64px; padding-bottom: 64px; }

/* ── Responsive: Tablet (≤ 1024px) ───────────────────────── */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive: Mobile (≤ 768px) ────────────────────────── */
@media (max-width: 768px) {
  :root {
    --navbar-h: 60px;
  }

  .navbar { padding: 0 16px; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(20px);
    padding: 20px 16px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    gap: 4px;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .nav-toggle { display: flex; }

  .container { padding: 0 16px; }

  .hero {
    min-height: 50vh;
    padding: 60px 16px 40px;
  }

  .hero-title { font-size: 1.75rem; }
  .hero-subtitle { font-size: 0.95rem; }
  .hero-arabic { font-size: 1.4rem; }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }

  .stats-row { flex-direction: column; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .chat-section {
    height: calc(100vh - var(--navbar-h) - 20px);
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .aalim-msg .msg-bubble,
  .user-msg .msg-bubble {
    max-width: 88%;
  }

  .dua-arabic { font-size: 1.3rem; }
  .hadith-arabic-main { font-size: 1.3rem; padding: 18px 20px; }
  .ayah-arabic { font-size: 1.25rem; }

  .filter-bar { gap: 6px; }
  .filter-btn { padding: 6px 12px; font-size: 0.78rem; }

  .section-title { font-size: 1.4rem; }

  .pagination { gap: 4px; }
  .page-link { min-width: 32px; height: 32px; font-size: 0.8rem; }

  .btn-lg { padding: 12px 22px; font-size: 0.9rem; }
}

/* ── Responsive: Small Mobile (≤ 480px) ──────────────────── */
@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem; }
  .hero-badge { font-size: 0.72rem; }

  .ayah-card { padding: 20px 16px; }
  .dua-card  { padding: 20px 16px; }
  .qa-card   { padding: 16px; }
  .book-card { padding: 16px; }

  .chat-messages { padding: 12px; gap: 12px; }
  .chat-input-area { padding: 12px; }

  .footer { padding: 40px 0 24px; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .navbar,
  .chat-input-area,
  .footer,
  .filter-bar,
  .pagination { display: none !important; }

  body { background: #fff; color: #000; }
  .page-wrapper { padding-top: 0; }
}

/* ============================================================
   AALIM CORE UI EXTENSIONS - PREMIUM DESIGN SPECIFICATION
   Complete styling for all platform components, hero, chat & tools
   ============================================================ */

/* ── Container & Utilities ────────────────────────────────── */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ── Navbar ───────────────────────────────────────────────── */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--navbar-h);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-en);
}

.brand-icon {
  font-size: 1.6rem;
}

.brand-name {
  font-family: var(--font-ur);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--gold-400);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--green-400);
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  margin-right: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 12px;
  transition: all var(--transition-base);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.btn-ask {
  background: linear-gradient(135deg, var(--green-700), var(--green-600)) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.25);
  border-radius: 20px !important;
}

.btn-ask:hover {
  background: linear-gradient(135deg, var(--green-600), var(--green-500)) !important;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.6rem;
  cursor: pointer;
  padding: 6px;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 70px 0 50px;
  text-align: center;
  background: radial-gradient(circle at 50% 10%, rgba(6, 78, 59, 0.35) 0%, rgba(2, 6, 23, 0) 70%), var(--dark-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 100px;
  color: var(--green-400);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.arabic-title {
  font-family: var(--font-ur);
  font-size: clamp(3.2rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 30%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: var(--font-en);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-desc {
  font-family: var(--font-ur);
  font-size: 1.15rem;
  line-height: 2;
  color: var(--text-secondary);
  margin-bottom: 35px;
}

/* ── Hero Search / Ask Box ────────────────────────────────── */
.hero-ask {
  max-width: 700px;
  margin: 0 auto 36px;
}

.ask-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 20px;
  padding: 8px 12px 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(16px);
  transition: all var(--transition-base);
}

.ask-box:focus-within {
  border-color: var(--green-400);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 35px rgba(16, 185, 129, 0.3);
}

.ask-box textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-ur);
  font-size: 1.05rem;
  line-height: 1.6;
  resize: none;
  height: 48px;
  padding: 8px 0 0;
}

.ask-box textarea::placeholder {
  color: var(--text-muted);
}

.ask-btn {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 12px 24px;
  font-family: var(--font-ur);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  transition: all var(--transition-fast);
}

.ask-btn:hover {
  background: linear-gradient(135deg, var(--green-500), var(--green-400));
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(16, 185, 129, 0.5);
}

.example-queries {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.example-queries span {
  font-family: var(--font-ur);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.example-queries button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: var(--font-ur);
  font-size: 0.82rem;
  padding: 4px 14px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.example-queries button:hover {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-400);
  border-color: rgba(16, 185, 129, 0.4);
}

/* ── Hero Stats ───────────────────────────────────────────── */
.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 12px 20px;
  border-radius: 16px;
  transition: all var(--transition-base);
}

.stat-item:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
  background: rgba(15, 23, 42, 0.85);
}

.stat-num {
  font-family: var(--font-en);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--gold-400);
  line-height: 1.2;
}

.stat-label {
  font-family: var(--font-ur);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Live Prayer Times Widget ─────────────────────────────── */
.prayer-times-bar {
  background: var(--dark-900);
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  padding: 16px 0;
}

#hpTimingsRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Aalim AI Chat Section (Streamlined Single Centered Card) ── */
.aalim-section {
  padding: 60px 0 80px;
  background: radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.08) 0%, rgba(10, 15, 26, 0.98) 60%), #070b12;
  position: relative;
  overflow: hidden;
}

.aalim-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  width: 60%;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(217, 119, 6, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

.aalim-header-premium {
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  z-index: 2;
}

.ai-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 18px;
  border-radius: 9999px;
  color: #34d399;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.15);
}

.pulsing-emerald-dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: emeraldPulse 2s infinite;
}

@keyframes emeraldPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.aalim-main-title {
  font-family: var(--font-ur);
  font-size: 2.3rem;
  color: #ffffff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.aalim-main-title .title-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.4));
}

.aalim-main-sub {
  font-family: var(--font-ur);
  font-size: 1.1rem;
  color: #94a3b8;
  max-width: 680px;
  margin: 0 auto 16px;
  line-height: 1.9;
}

.aalim-feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.feat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 14px;
  border-radius: 9999px;
  font-size: 0.82rem;
  color: #cbd5e1;
  font-family: var(--font-ur);
  backdrop-filter: blur(6px);
  transition: all 0.25s ease;
}

.feat-pill:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
  transform: translateY(-1px);
}

.feat-pill .pill-icon {
  font-size: 0.95rem;
}

/* ── Centered Chat Card Wrapper ──────────────────────────────── */
.aalim-chat-wrapper {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.chat-panel {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  height: 660px;
  max-height: 85vh;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(16, 185, 129, 0.06);
  overflow: hidden;
}

/* ── Chat Header ─────────────────────────────────────────────── */
.chat-header {
  padding: 16px 24px;
  background: rgba(10, 15, 26, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.chat-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aalim-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
}

.aalim-avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 50%, #d97706 100%);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.aalim-avatar-ring .avatar-icon {
  width: 100%;
  height: 100%;
  background: #0b1324;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.status-indicator-live {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: #10b981;
  border: 2px solid #0b1324;
  border-radius: 50%;
}

.aalim-info {
  display: flex;
  flex-direction: column;
}

.aalim-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aalim-name-row strong {
  color: #ffffff;
  font-size: 1.05rem;
  font-family: var(--font-ur);
  font-weight: 700;
}

.verified-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.72rem;
  padding: 1px 8px;
  border-radius: 9999px;
  font-weight: 600;
}

.aalim-status-text {
  color: #94a3b8;
  font-size: 0.8rem;
  font-family: var(--font-ur);
}

/* Chat Controls */
.chat-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-select-luxury {
  background-color: #1e293b;
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 8px 16px;
  font-family: var(--font-ur);
  font-size: 0.86rem;
  outline: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
}

.custom-select-luxury:hover,
.custom-select-luxury:focus {
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.custom-select-luxury option {
  background: #0f172a;
  color: #f8fafc;
  padding: 8px;
}

.btn-chat-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 8px 15px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-family: var(--font-ur);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-chat-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ── Chat Messages Stream ────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

/* ── Hero Empty State ────────────────────────────────────────── */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: auto;
  max-width: 720px;
  padding: 30px 20px;
  animation: fadeInMsg 0.4s ease forwards;
}

.empty-state-icon {
  font-size: 3.2rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 14px rgba(16, 185, 129, 0.4));
}

.empty-state-title {
  font-family: var(--font-ur);
  font-size: 1.55rem;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state-desc {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  color: #94a3b8;
  line-height: 1.95;
  margin-bottom: 24px;
}

.empty-state-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(217, 119, 6, 0.28);
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: 9999px;
  font-family: var(--font-ur);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.6;
}

.preset-chip:hover {
  background: rgba(217, 119, 6, 0.16);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fef08a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

/* Message Item */
.message {
  display: flex;
  gap: 12px;
  max-width: 88%;
  animation: fadeInMsg 0.3s ease forwards;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.aalim-msg {
  align-self: flex-start;
  margin-right: auto;
}

.user-msg {
  align-self: flex-end;
  flex-direction: row-reverse;
  margin-left: auto;
}

.msg-avatar-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.msg-bubble {
  padding: 16px 22px;
  border-radius: 18px;
  position: relative;
  word-break: break-word;
}

.aalim-answer-bubble {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.22);
  border-top-right-radius: 4px;
  color: #f1f5f9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.user-speech-bubble {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.3) 100%);
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-top-left-radius: 4px;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.msg-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bot-label {
  font-size: 0.78rem;
  color: #34d399;
  font-weight: 600;
  font-family: var(--font-ur);
}

.bot-label.error-label {
  color: #f87171;
}

.user-label {
  font-size: 0.78rem;
  color: #93c5fd;
  font-weight: 600;
  font-family: var(--font-ur);
}

.msg-time-badge {
  font-size: 0.72rem;
  color: #64748b;
  font-family: var(--font-ur);
}

.user-query-text {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  line-height: 1.9;
  color: #ffffff;
}

/* Islamic Markdown Elements in Answers */
.msg-content-body {
  font-family: var(--font-ur);
  font-size: 1.03rem;
  line-height: 2.05;
  color: #e2e8f0;
}

.msg-para {
  margin-bottom: 12px;
  line-height: 2.1;
}

.islamic-verse-callout {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.09) 0%, rgba(15, 23, 42, 0.75) 100%);
  border-right: 4px solid #d97706;
  border-left: 1px solid rgba(217, 119, 6, 0.2);
  border-top: 1px solid rgba(217, 119, 6, 0.2);
  border-bottom: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.verse-callout-header {
  margin-bottom: 8px;
}

.verse-callout-tag {
  display: inline-block;
  font-size: 0.75rem;
  background: rgba(217, 119, 6, 0.2);
  border: 1px solid rgba(217, 119, 6, 0.4);
  color: #fcd34d;
  padding: 2px 10px;
  border-radius: 9999px;
  font-weight: 600;
  font-family: var(--font-ur);
}

.verse-callout-arabic {
  font-family: var(--font-ar), 'Amiri', serif;
  font-size: 1.35rem;
  line-height: 2.2;
  color: #fef08a;
  text-align: right;
  direction: rtl;
  margin: 8px 0;
}

.verse-callout-translation {
  font-family: var(--font-ur);
  font-size: 1rem;
  line-height: 2.1;
  color: #e2e8f0;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  padding-top: 10px;
  margin-top: 8px;
}

/* Headings in Answer */
.msg-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
}

.heading-num-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35);
}

.heading-icon-dot {
  color: #10b981;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.heading-title-text {
  font-family: var(--font-ur);
  font-size: 1.15rem;
  font-weight: 700;
  color: #6ee7b7;
  margin: 0;
}

/* Bullet Items */
.islamic-bullet-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}

.msg-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.bullet-dot {
  color: #d97706;
  font-size: 0.8rem;
  margin-top: 6px;
  flex-shrink: 0;
}

.bullet-text {
  font-family: var(--font-ur);
  line-height: 2.0;
  color: #cbd5e1;
}

/* Ornament Divider */
.msg-ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 18px 0;
  color: #d97706;
  font-size: 0.85rem;
  letter-spacing: 4px;
  opacity: 0.8;
}

.msg-ornament-divider::before,
.msg-ornament-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(217, 119, 6, 0.3), transparent);
}

.answer-bold {
  color: #fbbf24;
  font-weight: 700;
}

.answer-italic {
  color: #a7f3d0;
  font-style: italic;
}

.quote-inline {
  color: #6ee7b7;
  quotes: none;
}

/* Sources Section Inside Each Answer */
.msg-sources-container {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.msg-sources-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ur);
  font-size: 0.85rem;
  color: #fbbf24;
  margin-bottom: 8px;
  font-weight: 600;
}

.msg-sources-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.msg-source-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #93c5fd;
  text-decoration: none;
  font-family: var(--font-ur);
  transition: all 0.2s ease;
}

.msg-source-pill:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
  transform: translateY(-1px);
}

.msg-source-pill .source-grade {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
}

.msg-source-pill .source-arrow {
  color: #60a5fa;
  font-size: 0.85rem;
}

/* Action Buttons (Copy, Voice, Detail) */
.msg-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.msg-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-family: var(--font-ur);
  cursor: pointer;
  transition: all 0.2s ease;
}

.msg-action-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.msg-action-btn.btn-copied {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

.msg-action-btn.speaking {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #fca5a5;
  animation: pulseSpeaking 1.5s infinite;
}

@keyframes pulseSpeaking {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.error-msg-box {
  color: #fca5a5;
  font-family: var(--font-ur);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ── Chat Input Area ─────────────────────────────────────────── */
.chat-input-area {
  padding: 16px 24px;
  background: rgba(10, 15, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #34d399;
  font-family: var(--font-ur);
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: #10b981;
  border-radius: 50%;
  animation: typingDotBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDotBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Input Container Luxury Capsule */
.input-container-luxury {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 10px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.25s ease;
}

.input-container-luxury:focus-within {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2), 0 8px 25px rgba(0, 0, 0, 0.5);
}

.input-container-luxury textarea {
  flex: 1;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: var(--font-ur);
  font-size: 1.05rem;
  line-height: 1.8;
  resize: none;
  max-height: 140px;
  padding: 4px 0;
}

.input-container-luxury textarea::placeholder {
  color: #64748b;
  font-family: var(--font-ur);
}

.input-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-util-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #cbd5e1;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.input-util-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: scale(1.05);
}

.input-util-btn.listening {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  animation: pulseVoice 1.2s infinite;
}

@keyframes pulseVoice {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.send-btn-luxury {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.send-btn-luxury:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.55);
}

.send-btn-luxury:active:not(:disabled) {
  transform: scale(0.96);
}

.send-btn-luxury:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #334155;
  box-shadow: none;
}

.send-btn-luxury svg {
  transform: rotate(180deg);
}

.input-footer-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #64748b;
  font-family: var(--font-ur);
  padding: 0 4px;
}

.hint-secure {
  color: #10b981;
}

@media (max-width: 640px) {
  .aalim-main-title { font-size: 1.8rem; }
  .chat-panel { height: 580px; border-radius: 18px; }
  .chat-header { padding: 12px 16px; }
  .btn-action-label { display: none; }
  .chat-messages { padding: 16px; }
  .message { max-width: 95%; }
  .msg-bubble { padding: 12px 16px; }
  .empty-state-title { font-size: 1.3rem; }
  .input-footer-hints { flex-direction: column; gap: 4px; align-items: flex-start; }
}

/* ── Books Grid & Cards ───────────────────────────────────── */
.books-section {
  padding: 60px 0;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.book-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 22px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-base);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.book-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.15);
  transform: translateY(-3px);
}

.book-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.book-info {
  flex: 1;
}

.book-title-ar {
  font-family: var(--font-ar);
  font-size: 1.25rem;
  color: var(--gold-300);
  line-height: 1.4;
}

.book-title-ur {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2px;
}

.book-author {
  font-family: var(--font-en);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.book-count {
  display: inline-block;
  font-family: var(--font-ur);
  font-size: 0.78rem;
  color: var(--green-400);
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 6px;
}

.book-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform var(--transition-base), color var(--transition-base);
}

.book-card:hover .book-arrow {
  color: var(--green-400);
  transform: translateX(-4px);
}

/* ── Popular Search Tags ──────────────────────────────────── */
.popular-section {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.popular-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.popular-tag {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 18px;
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: var(--font-ur);
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition-base);
}

.popular-tag:hover {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-400);
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
}

/* ── Features Section ─────────────────────────────────────── */
.features-section {
  padding: 60px 0;
  background: rgba(10, 15, 30, 0.5);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 26px;
  text-align: center;
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: rgba(16, 185, 129, 0.25);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-family: var(--font-ur);
  font-size: 1.2rem;
  color: #ffffff;
  margin-bottom: 8px;
}

.feature-card p {
  font-family: var(--font-ur);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── FAQ Section ──────────────────────────────────────────── */
.faq-section {
  padding: 60px 0;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.faq-item {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 22px;
  text-decoration: none;
  display: block;
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
  background: rgba(15, 23, 42, 0.85);
}

.faq-cat {
  font-family: var(--font-en);
  font-size: 0.76rem;
  color: var(--gold-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.faq-question {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.7;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  background: #020617;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 40px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.footer-brand {
  font-family: var(--font-ur);
  font-size: 1.3rem;
  color: var(--gold-400);
  font-weight: 700;
}

.footer-note {
  font-family: var(--font-ur);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  margin-top: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  font-family: var(--font-ur);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--green-400);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .aalim-container {
    grid-template-columns: 1fr;
  }
  .refs-panel {
    height: 350px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links.active,
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    background: rgba(10, 15, 30, 0.98);
    padding: 20px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    z-index: 99998;
  }
  .ask-box {
    flex-direction: column;
    padding: 14px;
    gap: 10px;
  }
  .ask-box textarea {
    width: 100%;
    height: 60px;
  }
  .ask-btn {
    width: 100%;
    justify-content: center;
  }
  .hero-stats {
    gap: 10px;
  }
  .stat-item {
    min-width: 45%;
    padding: 10px 14px;
  }
}

/* ============================================================
   AALIM SUBPAGES DESIGN SYSTEM (PRAYER TIMES, ZAKAT, NAMES, DUAS, QA)
   ============================================================ */

/* ── Names Directory ──────────────────────────────────────── */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.name-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-base);
}

.name-card:hover {
  border-color: rgba(16, 185, 129, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.name-ar {
  font-family: var(--font-ar);
  font-size: 1.6rem;
  color: var(--gold-300);
  text-align: right;
  line-height: 1.3;
}

.name-ur {
  font-family: var(--font-ur);
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
}

.name-en {
  font-family: var(--font-en);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.name-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.badge-quranic {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-ur);
}

.gender-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.gender-tab {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-ur);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.gender-tab:hover,
.gender-tab.active {
  background: var(--green-700);
  color: #ffffff;
  border-color: var(--green-500);
}

.girl-tab.active {
  background: #db2777 !important;
  border-color: #f472b6 !important;
}

.alpha-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.alpha-btn {
  width: 38px;
  height: 38px;
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-ur);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
}

.alpha-btn:hover,
.alpha-btn.active {
  background: var(--gold-500);
  color: var(--dark-950);
  font-weight: 700;
}

/* ── Duas Page ────────────────────────────────────────────── */
.cat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.cat-pill {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 18px;
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: var(--font-ur);
  font-size: 0.88rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.cat-pill:hover,
.cat-pill.active {
  background: var(--green-700);
  color: #ffffff;
  border-color: var(--green-500);
}

.tag-count {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.75rem;
}

.dua-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 24px;
  border-right: 4px solid var(--gold-500);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dua-title {
  font-family: var(--font-ur);
  font-size: 1.3rem;
  color: #ffffff;
  margin-bottom: 14px;
}

.dua-urdu {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 2;
  margin: 14px 0;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  border-radius: 10px;
}

.dua-lang-en {
  font-family: var(--font-en);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.dua-virtue {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--green-300);
  font-family: var(--font-ur);
  font-size: 0.92rem;
  line-height: 1.8;
  margin-top: 14px;
}

.dua-ref {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ── Hadiths, Ayahs & Proofs ──────────────────────────────── */
.hadith-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.hadith-meta-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.translation-box {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 18px 20px;
  margin: 14px 0;
}

.translation-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--gold-400);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.urdu-trans {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  line-height: 2;
  color: var(--text-primary);
}

.en-trans {
  font-family: var(--font-en);
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ref-grade {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-400);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-play-ayah {
  background: var(--dark-700);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gold-400);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-play-ayah:hover {
  background: var(--gold-500);
  color: var(--dark-950);
}

.nav-hadith {
  display: flex;
  justify-content: space-between;
  margin: 30px 0;
}

.nav-btns {
  display: flex;
  gap: 12px;
}

.nav-btn {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: 10px;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--green-700);
  border-color: var(--green-500);
}

/* ── Prayer Times Page ────────────────────────────────────── */
.pt-hero {
  padding: 40px 0 20px;
  text-align: center;
}

.pt-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 30px;
  flex-wrap: wrap;
}

.pt-select {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 12px;
  font-family: var(--font-ur);
  font-size: 0.9rem;
  outline: none;
}

.pt-btn-loc {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green-400);
  padding: 8px 18px;
  border-radius: 12px;
  font-family: var(--font-ur);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.pt-btn-loc:hover {
  background: var(--green-700);
  color: #fff;
}

.pt-countdown-box {
  background: radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  max-width: 500px;
  margin: 0 auto 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.pt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.pt-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 22px 16px;
  text-align: center;
  transition: all 0.2s;
}

.pt-card:hover,
.pt-card.active {
  border-color: var(--green-400);
  background: rgba(6, 78, 59, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.2);
}

.pt-name-ur {
  font-family: var(--font-ur);
  font-size: 1.25rem;
  color: #ffffff;
  font-weight: 700;
}

.pt-name-en {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 2px 0 12px;
}

.pt-time {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gold-400);
  font-family: var(--font-en);
  direction: ltr;
}

.qibla-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  margin-bottom: 40px;
}

.hijri-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  color: var(--gold-400);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 4px 14px;
  border-radius: 20px;
  font-family: var(--font-ur);
  font-size: 0.88rem;
  margin-top: 10px;
}

/* ── Zakat Page ───────────────────────────────────────────── */
.zk-container {
  max-width: 900px;
  margin: 0 auto;
}

.zk-card {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.zk-title {
  font-family: var(--font-ur);
  font-size: 1.4rem;
  color: var(--gold-400);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.zk-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.zk-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zk-label {
  font-family: var(--font-ur);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.zk-input {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ffffff;
  font-family: var(--font-en);
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s;
}

.zk-input:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.zk-result-box {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.8), rgba(4, 120, 87, 0.6));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  margin-bottom: 30px;
}

.zk-result-val {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold-300);
  font-family: var(--font-en);
  margin: 10px 0;
}

.zk-guide-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  font-family: var(--font-ur);
  line-height: 2;
  color: var(--text-secondary);
}

/* ── QA & Proofs Page ─────────────────────────────────────── */
.qa-full-q {
  font-family: var(--font-ur);
  font-size: 1.6rem;
  color: #ffffff;
  margin-bottom: 20px;
  line-height: 1.6;
}

.qa-cat-badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 14px;
  border-radius: 100px;
  font-family: var(--font-en);
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.qa-answer {
  background: var(--dark-900);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 30px;
  font-family: var(--font-ur);
  font-size: 1.15rem;
  line-height: 2.1;
  color: var(--text-primary);
  margin-bottom: 30px;
}

.proof-box {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 20px;
}

.proof-title {
  font-family: var(--font-ur);
  font-size: 1.1rem;
  color: var(--gold-400);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proof-item {
  font-family: var(--font-ur);
  font-size: 1rem;
  line-height: 1.9;
  color: var(--text-secondary);
}

.fiqh-box {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  padding: 20px;
  font-family: var(--font-ur);
  line-height: 1.9;
  color: var(--gold-300);
  margin-top: 20px;
}

/* ── Search Page ──────────────────────────────────────────── */
.search-page {
  padding: 50px 0;
}

.search-box-large {
  display: flex;
  gap: 12px;
  max-width: 750px;
  margin: 0 auto 30px;
  background: var(--dark-900);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 20px;
  padding: 8px 12px 8px 20px;
}

.search-btn {
  background: linear-gradient(135deg, var(--green-600), var(--green-500));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 12px 28px;
  font-family: var(--font-ur);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.search-filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 35px;
}

.results-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ============================================================
   SUPPLEMENTARY UI & COMPONENT STYLES
   ============================================================ */

/* Breadcrumb separator */
.bc-sep {
  color: var(--dark-600);
  margin: 0 4px;
}

/* General outline button */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: rgba(16, 185, 129, 0.06);
  color: var(--green-400);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--green-700);
  color: #ffffff;
  border-color: var(--green-500);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.books-more {
  text-align: center;
  margin-top: 36px;
}

/* Books filter tabs */
.books-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0;
  justify-content: center;
}

.tab-btn {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 10px 22px;
  border-radius: 30px;
  cursor: pointer;
  font-family: var(--font-ur);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.tab-btn:hover,
.tab-btn.active {
  background: var(--green-700);
  color: #ffffff;
  border-color: var(--green-500);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* Names Search and References */
.search-name-box {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.search-name-box input {
  flex: 1;
  background: var(--dark-800);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px 18px;
  font-family: var(--font-ur);
  font-size: 1rem;
  transition: all var(--transition-base);
}

.search-name-box input:focus {
  outline: none;
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.name-ref {
  font-size: 0.75rem;
  color: var(--dark-500);
  margin-top: 6px;
  font-family: var(--font-ur);
}

/* Hadith topics and related */
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related-item {
  background: var(--dark-800);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 3px solid var(--green-500);
  border-radius: 12px;
  padding: 14px;
  font-family: var(--font-ur);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
}

.related-item:hover {
  border-color: var(--green-400);
  background: var(--dark-700);
  color: #ffffff;
  transform: translateX(-3px);
}

/* Urdu Text formatting */
.urdu-text {
  font-family: var(--font-ur);
  line-height: 2;
  direction: rtl;
  text-align: right;
}

/* Zakat Hero */
.zk-hero {
  text-align: center;
  padding: 48px 20px 32px;
}

/* Health check & Setup utility classes */
.score-box {
  background: var(--dark-900);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.score-num { font-size: 2.5rem; font-weight: 700; color: var(--green-400); }
.score-label { color: var(--text-secondary); font-size: 0.9rem; }
.score-ok { color: var(--green-400); }
.score-fail { color: #ef4444; }
.success-banner {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--green-500);
  color: var(--green-300);
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.fail-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.check-name { font-weight: 600; color: var(--text-primary); }
.check-detail { font-size: 0.85rem; color: var(--text-secondary); }
.check-fix { font-size: 0.8rem; color: #f59e0b; margin-top: 4px; }
.check-icon { font-size: 1.2rem; }
.warn { color: #f59e0b; }
.subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 24px; }
.box { background: var(--dark-900); border-radius: 16px; padding: 24px; border: 1px solid rgba(255, 255, 255, 0.07); }

.score { display: inline-block; font-weight: 700; }

/* ============================================================
   MULTILINGUAL & GLOBAL LANGUAGE SWITCHER STYLES
   ============================================================ */
.nav-extra-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

details.lang-dropdown-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

summary.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  list-style: none;
}
summary.lang-switch-btn::-webkit-details-marker {
  display: none;
}
summary.lang-switch-btn::marker {
  display: none;
}

summary.lang-switch-btn:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--green-300);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

details.lang-dropdown-wrapper[open] summary.lang-switch-btn {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: var(--green-300);
}

details.lang-dropdown-wrapper[open] .lang-arrow {
  transform: rotate(180deg);
}

.lang-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-curr-name {
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

.lang-arrow {
  font-size: 0.75rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  background: #0b1120;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.8), 0 0 1px rgba(16, 185, 129, 0.3);
  min-width: 220px;
  padding: 8px;
  z-index: 99999;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

details.lang-dropdown-wrapper[open] .lang-menu {
  display: block !important;
  animation: aalimMenuFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes aalimMenuFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

html[dir="ltr"] .lang-menu {
  right: 0;
  left: auto;
}

html[dir="rtl"] .lang-menu {
  left: 0;
  right: auto;
}

.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.86rem;
  transition: all 0.18s ease;
}

.lang-menu-item:hover {
  background: rgba(16, 185, 129, 0.16);
  color: #ffffff;
  transform: translateX(2px);
}

html[dir="rtl"] .lang-menu-item:hover {
  transform: translateX(-2px);
}

.lang-menu-item.active {
  background: rgba(16, 185, 129, 0.24);
  color: var(--green-400);
  font-weight: 600;
}

.lang-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.lang-item-native {
  font-weight: 500;
  color: var(--text-primary);
}

.lang-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

html[dir="rtl"] .lang-item-sub {
  margin-left: 0;
  margin-right: auto;
}

.lang-check {
  color: var(--green-400);
  font-size: 0.85rem;
  font-weight: bold;
}

/* Footer Language Switcher adjustments */
.footer-lang-switcher summary.lang-switch-btn {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  width: 100%;
  justify-content: space-between;
}

.footer-lang-switcher .lang-menu {
  bottom: calc(100% + 8px);
  top: auto;
}

/* ── Directional Typography & Layouts ── */
html[dir="ltr"] body {
  font-family: var(--font-en, 'Inter', system-ui, -apple-system, sans-serif);
  text-align: left;
}

html[dir="ltr"] .hero-desc,
html[dir="ltr"] .aalim-main-sub,
html[dir="ltr"] .chat-empty-state {
  font-family: var(--font-en, 'Inter', system-ui, -apple-system, sans-serif);
}

html[dir="ltr"] .nav-links a {
  font-family: var(--font-en, 'Inter', system-ui, -apple-system, sans-serif);
}

html[dir="rtl"] body {
  font-family: var(--font-ur, 'Noto Nastaliq Urdu', 'Amiri', serif);
  text-align: right;
}

@media (max-width: 768px) {
  .nav-extra-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  html[dir="rtl"] .nav-extra-actions {
    margin-left: 0;
    margin-right: auto;
  }
  .lang-curr-name {
    display: inline-block;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
  }
  .lang-switch-btn {
    padding: 6px 9px;
  }
  .mobile-lang-drawer-row {
    display: block;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .mobile-lang-drawer-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
  }
  .mobile-lang-chips {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .mobile-lang-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
  }
  .mobile-lang-chip:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
  }
  .mobile-lang-chip.active {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: var(--green-400);
    font-weight: 600;
  }
  .mobile-lang-chip .chip-flag {
    font-size: 1.1rem;
    line-height: 1;
  }
  .mobile-lang-chip .chip-name {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-lang-chip .chip-check {
    margin-left: auto;
    color: var(--green-400);
    font-size: 0.8rem;
  }
  html[dir="rtl"] .mobile-lang-chip .chip-check {
    margin-left: 0;
    margin-right: auto;
  }
}

.mobile-lang-drawer-row {
  display: none;
}




/* ==========================================================================
   AALIM.COM GRAND MAJESTIC REDESIGN STYLES (HEADER, MEGA MENU, SIDEBAR, BOOKS)
   ========================================================================== */

/* ── Tier 1: Islamic Utility Topbar ─────────────────────────────────────── */
.site-header-grand {
  position: relative;
  width: 100%;
  z-index: 1100;
  background: #070d1e;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.45);
}

.topbar-islamic {
  background: linear-gradient(90deg, #050a18 0%, #0a1329 50%, #050a18 100%);
  border-bottom: 1px solid rgba(217, 119, 6, 0.18);
  font-size: 0.82rem;
  color: #94a3b8;
  padding: 6px 0;
  line-height: 1.5;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar-bismillah {
  font-family: var(--font-ar, 'Amiri', serif);
  font-size: 1.05rem;
  color: #fef08a;
  text-shadow: 0 0 10px rgba(254, 240, 138, 0.35);
  letter-spacing: 0.04em;
  font-weight: 600;
}

.topbar-ayah-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.22);
  color: #a7f3d0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: var(--font-ar, 'Amiri', serif);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.8rem;
}

.topbar-prayer-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #38bdf8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
}
.topbar-prayer-link:hover {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
}

.btn-sidebar-toggle-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fef08a;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-family: var(--font-ur);
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-sidebar-toggle-top:hover {
  background: rgba(245, 158, 11, 0.24);
  border-color: #fbbf24;
  color: #ffffff;
}

/* ── Tier 2: Grand Brand Bar & Global Search ────────────────────────────── */
.header-brand-bar {
  background: linear-gradient(180deg, #090f23 0%, #0c1530 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px 0;
}

.brand-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.grand-brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-emblem-wrap {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(217, 119, 6, 0.2) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.18);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.grand-brand-logo:hover .brand-emblem-wrap {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
}

.brand-emblem {
  font-size: 1.85rem;
  line-height: 1;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name-calligraphy {
  font-family: var(--font-ur, 'Jameel Noori Nastaleeq', 'Amiri', serif);
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, #34d399 0%, #fbbf24 60%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
}

.brand-en-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

.brand-tagline {
  font-family: var(--font-ur);
  font-size: 0.85rem;
  color: #94a3b8;
  font-weight: 400;
}

/* Global Search Box in Brand Bar */
.header-search-wrap {
  flex: 1;
  max-width: 580px;
  position: relative;
}

.header-search-form {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: all 0.25s ease;
}
.header-search-form:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3), inset 0 1px 3px rgba(0, 0, 0, 0.4);
  background: rgba(15, 23, 42, 0.98);
}

.header-search-icon {
  font-size: 1.05rem;
  margin-right: 8px;
  color: #94a3b8;
  opacity: 0.7;
}

.header-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--font-ur);
  font-size: 0.95rem;
  padding: 6px 4px;
}
.header-search-input::placeholder {
  color: #64748b;
  font-size: 0.88rem;
}

.header-search-submit-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #ffffff;
  padding: 7px 18px;
  border-radius: 999px;
  font-family: var(--font-ur);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}
.header-search-submit-btn:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

.header-search-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 0 12px;
  font-size: 0.75rem;
  color: #64748b;
  font-family: var(--font-ur);
}
.header-search-tags a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}
.header-search-tags a:hover {
  color: #34d399;
  text-decoration: underline;
}

/* Brand Bar Actions */
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-grand-ask {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(217, 119, 6, 0.24) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  color: #fef08a;
  padding: 9px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  transition: all 0.25s ease;
  overflow: hidden;
}
.btn-grand-ask:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(217, 119, 6, 0.4) 100%);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
}

.btn-grand-mega-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--font-ur);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-grand-mega-toggle:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.btn-grand-mega-toggle .arrow-down {
  font-size: 0.65rem;
  transition: transform 0.25s ease;
}
.btn-grand-mega-toggle[aria-expanded="true"] .arrow-down {
  transform: rotate(180deg);
}

/* ── Tier 3: Primary Navigation Strip ───────────────────────────────────── */
.navbar-main-strip {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: rgba(8, 14, 29, 0.94);
  backdrop-filter: blur(20px) saturate(1.7);
  -webkit-backdrop-filter: blur(20px) saturate(1.7);
  border-bottom: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.nav-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-links-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.96rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
}
.nav-item:hover {
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
}
.nav-item.active {
  color: #34d399;
  background: rgba(16, 185, 129, 0.18);
  border-bottom: 2px solid #10b981;
}

.nav-drop-indicator {
  font-size: 0.7rem;
  opacity: 0.6;
}

.nav-item-highlight {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fef08a !important;
}
.nav-item-highlight:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24) 0%, rgba(16, 185, 129, 0.2) 100%);
  border-color: #f59e0b;
  color: #ffffff !important;
}

.badge-new {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--font-ur);
  font-weight: 700;
}

.nav-controls-extra {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-nav-sidebar-pill,
.btn-mega-trigger-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-ur);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-nav-sidebar-pill:hover,
.btn-mega-trigger-pill:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #ffffff;
}

.nav-mobile-toggle {
  display: none;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-ur);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ── Interactive Mega Menu Drawer ───────────────────────────────────────── */
.mega-menu-overlay {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(7, 12, 26, 0.97);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border-bottom: 2px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  z-index: 1040;
}

.mega-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-container {
  padding: 24px 24px 32px;
}

.mega-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.mega-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ur);
  font-size: 1.15rem;
  color: #fef08a;
}

.btn-mega-close {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 5px 14px;
  border-radius: 8px;
  font-family: var(--font-ur);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-mega-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.mega-col {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}
.mega-col:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.mega-col-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}

.col-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.mega-col.col-quran .col-icon-wrap {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}
.mega-col.col-books .col-icon-wrap {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}
.mega-col.col-timeline .col-icon-wrap {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}
.mega-col.col-tools .col-icon-wrap {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.mega-col-header h4 {
  font-family: var(--font-ur);
  font-size: 1.1rem;
  color: #f8fafc;
  margin: 0 0 3px;
  font-weight: 700;
}
.mega-col-header p {
  font-family: var(--font-ur);
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.mega-col-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mega-col-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #cbd5e1;
  font-family: var(--font-ur);
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.02);
}
.mega-col-list li a:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  transform: translateX(-3px);
}
html[dir="ltr"] .mega-col-list li a:hover {
  transform: translateX(3px);
}

.mega-link-item {
  width: 100%;
}
.mega-link-item .surah-num,
.mega-link-item .book-yr,
.mega-link-item .era-num,
.mega-link-item .tool-emoji {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

.mega-link-item .book-yr {
  width: auto;
  padding: 2px 7px;
  font-size: 0.72rem;
  background: rgba(245, 158, 11, 0.15);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.mega-link-item .era-num {
  width: auto;
  padding: 2px 7px;
  font-size: 0.72rem;
  background: rgba(139, 92, 246, 0.15);
  color: #d8b4fe;
}

.mega-link-item div {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.mega-link-item div strong {
  font-size: 0.92rem;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mega-link-item div span {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-link-item.highlight-tarteeb {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.mega-link-item.highlight-tarteeb:hover {
  background: rgba(245, 158, 11, 0.2);
}

.mega-link-item.highlight-timeline {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.mega-link-item.highlight-ai {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(217, 119, 6, 0.14) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.mega-view-all {
  margin-top: 6px;
}
.mega-btn-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #34d399 !important;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}
.mega-btn-more:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #ffffff !important;
  transform: none !important;
}

/* ── Off-Canvas Responsive Sidebar Drawer ───────────────────────────────── */
.offcanvas-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 18, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s;
}

.offcanvas-sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.offcanvas-sidebar-window {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 380px;
  max-width: 88vw;
  background: #090f22;
  border-left: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: -10px 0 45px rgba(0, 0, 0, 0.7);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  right: 0;
  transform: translateX(100%);
}
html[dir="rtl"] .offcanvas-sidebar-window {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 10px 0 45px rgba(0, 0, 0, 0.7);
  transform: translateX(-100%);
}

.offcanvas-sidebar-overlay.active .offcanvas-sidebar-window {
  transform: translateX(0);
}

.offcanvas-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.offcanvas-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ur);
  font-size: 1.05rem;
  color: #fef08a;
}

.btn-offcanvas-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-offcanvas-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.offcanvas-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
}

/* ── Sidebar Component & Widgets ────────────────────────────────────────── */
.aalim-site-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar-widget {
  background: rgba(13, 20, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.sidebar-widget:hover {
  border-color: rgba(16, 185, 129, 0.25);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ur);
  font-size: 1.02rem;
  color: #f8fafc;
  margin: 0;
  font-weight: 700;
}

.widget-title-icon {
  font-size: 1.15rem;
}

.widget-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-ur);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}
.widget-badge.live-pulse {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.widget-badge.gold {
  background: rgba(245, 158, 11, 0.15);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.widget-hijri-sub {
  font-family: var(--font-ur);
  font-size: 0.82rem;
  color: #fbbf24;
  margin-bottom: 10px;
  text-align: center;
  background: rgba(245, 158, 11, 0.08);
  padding: 4px;
  border-radius: 8px;
}

/* Prayer Widget Grid */
.prayer-times-widget-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.prayer-time-cell {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.prayer-time-cell .p-name {
  font-family: var(--font-ur);
  font-size: 0.88rem;
  color: #cbd5e1;
}
.prayer-time-cell .p-val {
  font-family: var(--font-en);
  font-size: 0.85rem;
  font-weight: 700;
  color: #34d399;
}

.widget-action-link {
  display: block;
  text-align: center;
  font-family: var(--font-ur);
  font-size: 0.82rem;
  color: #38bdf8;
  text-decoration: none;
  padding-top: 6px;
}
.widget-action-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* Ask AI Widget */
.widget-ai-desc {
  font-family: var(--font-ur);
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0 0 12px;
  line-height: 1.5;
}

.widget-ai-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(217, 119, 6, 0.25) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  text-decoration: none;
  padding: 10px;
  border-radius: 10px;
  font-family: var(--font-ur);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.widget-ai-btn:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(217, 119, 6, 0.4) 100%);
  color: #ffffff;
}

.widget-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quick-prompt-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.8rem;
  transition: all 0.2s;
}
.quick-prompt-chip:hover {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

/* Mini Book Jump List */
.mini-book-jump-list,
.mini-timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-book-item,
.mini-timeline-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
}
.mini-book-item:hover,
.mini-timeline-item:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.25);
  transform: translateX(-2px);
}
html[dir="ltr"] .mini-book-item:hover,
html[dir="ltr"] .mini-timeline-item:hover {
  transform: translateX(2px);
}

.mini-book-item .mb-info,
.mini-timeline-item .mt-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mini-book-item .mb-title,
.mini-timeline-item .mt-title {
  font-family: var(--font-ur);
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-book-item .mb-author,
.mini-timeline-item .mt-desc {
  font-family: var(--font-ur);
  font-size: 0.74rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-book-item .mb-year,
.mini-timeline-item .mt-era {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.15);
  color: #fef08a;
  border: 1px solid rgba(245, 158, 11, 0.25);
  flex-shrink: 0;
}

/* Hadith & Dua Card in Sidebar */
.daily-hadith-card,
.daily-dua-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.daily-hadith-text,
.daily-dua-ar {
  font-family: var(--font-ar, 'Amiri', serif);
  font-size: 1rem;
  line-height: 1.6;
  color: #fef08a;
  background: rgba(254, 240, 138, 0.05);
  border: 1px solid rgba(254, 240, 138, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
}
.daily-hadith-ur,
.daily-dua-ur {
  font-family: var(--font-ur);
  font-size: 0.84rem;
  color: #cbd5e1;
  line-height: 1.6;
}
.daily-hadith-ref {
  font-family: var(--font-ur);
  font-size: 0.76rem;
  color: #34d399;
}

/* ── 2-Column Layout with Sidebar ───────────────────────────────────────── */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  align-items: start;
}

.main-content-col {
  min-width: 0;
}

.sidebar-col {
  position: sticky;
  top: 70px;
}

/* ── Chronological Books Cards & Badges ─────────────────────────────────── */
.books-chronological-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.book-card-chronological {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(10, 16, 32, 0.95) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.book-card-chronological:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.15);
}

.book-card-chronological.is-quran-card {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(180deg, rgba(20, 27, 48, 0.95) 0%, rgba(13, 20, 39, 0.98) 100%);
  box-shadow: 0 10px 35px rgba(245, 158, 11, 0.18);
}

.book-card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.book-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-ur);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.book-order-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-family: var(--font-en);
  font-size: 0.78rem;
  font-weight: 700;
}

.book-card-body {
  margin-bottom: 20px;
}

.book-title-ar {
  font-family: var(--font-ar, 'Amiri', serif);
  font-size: 1.65rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 6px;
  line-height: 1.3;
}
.book-card-chronological.is-quran-card .book-title-ar {
  color: #fef08a;
  text-shadow: 0 0 14px rgba(254, 240, 138, 0.35);
}

.book-title-ur {
  font-family: var(--font-ur);
  font-size: 1.05rem;
  color: #94a3b8;
  margin: 0 0 14px;
}

.book-author-meta {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.author-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.author-label {
  font-family: var(--font-ur);
  font-size: 0.78rem;
  color: #64748b;
}

.author-role-badge {
  font-family: var(--font-ur);
  font-size: 0.72rem;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 7px;
  border-radius: 6px;
}

.author-name-text {
  font-family: var(--font-ur);
  font-size: 1.02rem;
  font-weight: 700;
  color: #e2e8f0;
}

.book-category-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.book-cat-tag {
  font-family: var(--font-ur);
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.book-unit-tag {
  font-family: var(--font-ur);
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.book-desc-ur {
  font-family: var(--font-ur);
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.7;
  margin: 0;
}

.book-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-book-primary {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 9px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}
.btn-book-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-book-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 9px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-family: var(--font-ur);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}
.btn-book-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ── Responsive Media Queries ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .layout-with-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar-col {
    display: none; /* Accessible via offcanvas drawer and toggle buttons */
  }
}

@media (max-width: 768px) {
  .topbar-ayah-pill {
    display: none;
  }
  .header-brand-bar {
    padding: 12px 0;
  }
  .brand-bar-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .grand-brand-logo {
    justify-content: center;
  }
  .header-search-wrap {
    max-width: 100%;
  }
  .header-actions-group {
    justify-content: center;
  }
  .nav-mobile-toggle {
    display: block;
  }
  .nav-links-row {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 10px 0;
  }
  .nav-links-row.mobile-open {
    display: flex;
  }
  .mega-menu-grid {
    grid-template-columns: 1fr;
  }
  .books-chronological-grid {
    grid-template-columns: 1fr;
  }
}
