/* Cache Busted V5 */
/* ─── Light Mode (Default) ─── */
:root {
  --bg: #fafaf8;
  --bg-alt: #f0ede6;
  --surface: #ffffff;
  --surface-hover: #f8f6f2;
  --border: #e8e4dc;
  --border-light: #f0ece4;
  --text: #1a1a1a;
  --text-secondary: #5a5550;
  --text-muted: #6b6660; /* Darkened for 4.5:1 contrast */
  --gold: #b8860b;
  --gold-light: #d4a84c;
  --gold-pale: #f5e9c0;
  --gold-bg: rgba(184,134,11,0.08);
  --primary: #1a3a5c;
  --primary-light: #2a5a8c;
  --green: #2d6a4f;
  --green-bg: #ecfdf5;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
  --nav-bg: rgba(250,250,248,0.85);
  --hero-bg: #f5f0e8;
  --card-border: 1px solid var(--border);
  --result-bg: #fffdf7;
  --result-border: #e8d9b0;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.3s ease;
}

/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --bg: #070b14;
  --bg-alt: #0c1222;
  --surface: #10162a;
  --surface-hover: #161e38;
  --border: rgba(201,168,76,0.15);
  --border-light: rgba(255,255,255,0.06);
  --text: #f0f4ff;
  --text-secondary: #a8b8d8;
  --text-muted: #8495bc; /* Brightened for 4.5:1 contrast */
  --gold-bg: rgba(201,168,76,0.1);
  --nav-bg: rgba(7,11,20,0.9);
  --hero-bg: #070b14;
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
  --card-border: 1px solid rgba(201,168,76,0.12);
  --result-bg: #10162a;
  --result-border: rgba(201,168,76,0.25);
}

/* ─── Font fallback to prevent CLS ─── */
@font-face {
  font-family: 'Noto Naskh Arabic Fallback';
  src: local('Tahoma'), local('Arial');
  size-adjust: 105%;
  ascent-override: 95%;
  descent-override: 25%;
}

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

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

body {
  font-family: 'Noto Naskh Arabic', 'Tahoma', serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

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

/* ─── Container ─── */
.container-v5 {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ═══════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════ */
.nav-v5 {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 12px 16px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav-v5.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Amiri', serif;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
}

[data-theme="dark"] .logo-mark { color: var(--bg); }

.logo-text {
  font-family: 'Amiri', serif;
  font-size: 20px;
  color: var(--gold);
  font-weight: 700;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; right: 0;
  width: 0; height: 1.5px;
  background: var(--gold);
  transition: width var(--transition);
}
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 40px; height: 40px;
  background: var(--gold-bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: all var(--transition);
  color: var(--gold);
}
.theme-toggle:hover { background: rgba(184,134,11,0.15); }

.hamburger {
  width: 40px; height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; right: 0;
  width: 280px; height: 100vh;
  background: var(--surface);
  z-index: 200;
  padding: 60px 24px 24px;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--transition);
}
.mobile-menu.open { transform: translateX(0); display: block; }
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.mobile-menu-overlay.open { display: block; }
.mobile-menu ul { list-style: none; }
.mobile-menu li { margin-bottom: 8px; }
.mobile-menu a {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.mobile-menu a:hover { background: var(--gold-bg); color: var(--gold); }
.mobile-menu-close {
  position: absolute;
  top: 16px; left: 16px;
  width: 36px; height: 36px;
  background: var(--bg-alt);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}

/* ═══════════════════════════════════════════
   HERO SECTION (Updated with Moon & Canvas)
   ═══════════════════════════════════════════ */
.hero-v5 {
  position: relative;
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 16px 40px;
  background: var(--hero-bg);
  overflow: hidden;
}

/* Canvas for stars */
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.hero-v5::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(30,48,96,0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .hero-v5::before {
  background: radial-gradient(ellipse at center, rgba(30,48,96,0.3) 0%, transparent 70%);
}

.hero-content { 
  position: relative; 
  z-index: 2; 
  width: 100%; 
  max-width: 650px; 
  min-height: 480px; /* Lock height to prevent text reflow from pushing search-box down */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero-moon-icon {
  display: block;
  margin: 0 auto 20px;
  width: 50px;
  height: 50px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: '';
  width: 30px; height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

.hero-title {
  font-family: 'Amiri', serif;
  font-size: clamp(32px, 7vw, 56px);
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 16px;
  font-weight: 700;
}

.hero-title .highlight {
  color: #d97706; /* Fallback for accessibility checkers, better contrast */
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.9;
}

.hero-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 0.9rem;
  margin-bottom: 25px;
}
.hero-badges span {
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: bold;
}
.badge-orange { background: rgba(217, 119, 6, 0.1); color: #b45309; }
.badge-green { background: rgba(5, 150, 105, 0.1); color: #047857; }
.badge-blue { background: rgba(37, 99, 235, 0.1); color: #1d4ed8; }

[data-theme="dark"] .badge-orange { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
[data-theme="dark"] .badge-green { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
[data-theme="dark"] .badge-blue { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }

/* ─── Search Box ─── */
.search-box {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  min-height: 380px; /* Reserve generous space to absolutely prevent CLS */
}

.textarea-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 15px;
}

.textarea-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--gold-bg);
}

.textarea-wrapper textarea {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Noto Naskh Arabic', 'Noto Naskh Arabic Fallback', 'Tahoma', serif;
  font-size: 16px;
  line-height: 1.6;
  resize: none;
  height: 120px; /* FIXED height to prevent CLS when font loads */
  min-height: 120px;
  max-height: 250px;
  padding: 0;
  direction: rtl;
}

.textarea-wrapper textarea::placeholder { color: var(--text-muted); }

.submit-btn-full {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  border-radius: var(--radius);
  width: 100%;
  padding: 16px;
  margin-top: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(184,134,11,0.3);
}

[data-theme="dark"] .submit-btn-full { color: var(--bg); }

.submit-btn-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184,134,11,0.45);
}

.submit-btn-full:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Search Filters */
.search-filters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

@media (min-width: 600px) {
  .search-filters {
    grid-template-columns: repeat(4, 1fr);
  }
}

.search-filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23b8860b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: left 12px top 50%;
  background-size: 10px auto;
  padding-left: 30px;
}

.search-filters select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-bg);
}

/* ═══════════════════════════════════════════
   RESULT CARD
   ═══════════════════════════════════════════ */
.result-section {
  display: none;
  padding: 0 16px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.result-section.visible { display: block; animation: fadeUp 0.5s ease; }

.result-card {
  background: var(--result-bg);
  border: 1px solid var(--result-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.result-icon {
  width: 44px; height: 44px;
  background: var(--gold-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--gold);
  flex-shrink: 0;
}

.result-title {
  font-family: 'Amiri', serif;
  font-size: 20px;
  color: var(--text);
  font-weight: 700;
}

.result-body {
  font-size: 15px;
  line-height: 2;
  color: var(--text);
}

.result-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.result-action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.result-action-btn:hover {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: var(--gold);
}

/* Loading Animation */
.loading-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 40px;
}
.loading-dots span {
  width: 12px; height: 12px;
  background: var(--gold);
  border-radius: 50%;
  animation: dotPulse 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════
   SECTIONS (Services, Symbols, Articles)
   ═══════════════════════════════════════════ */
.section-v5 {
  padding: 0 16px 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.section-divider {
  text-align: center;
  padding: 60px 0 40px;
}
.divider-text {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 14px;
  letter-spacing: 0.1em;
}
.divider-text::before, .divider-text::after {
  content: '';
  width: 120px; height: 1px;
  background: linear-gradient(to left, var(--border), transparent);
}
.divider-text::after {
  background: linear-gradient(to right, var(--border), transparent);
}

.section-title-v5 {
  font-family: 'Amiri', serif;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 8px;
  text-align: center;
  font-weight: 700;
}

.section-sub {
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Services Grid ─── */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.service-card {
  background: var(--surface);
  border: var(--card-border);
  border-right: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
  box-shadow: var(--shadow-sm);
}

.service-card:hover {
  border-color: var(--gold);
  border-right: 3px solid var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: var(--surface-hover);
}

.service-icon-v5 {
  width: 48px; height: 48px;
  background: var(--gold-bg);
  border: 1px solid rgba(184,134,11,0.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 22px;
  color: var(--gold);
}

.service-card h3 {
  font-family: 'Amiri', serif;
  font-size: 19px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 700;
}

.service-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.service-arrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a6308;
  font-size: 14px;
  margin-top: 16px;
  transition: gap 0.2s;
  font-weight: 500;
}
.service-card:hover .service-arrow { gap: 10px; }

/* ─── Symbols Grid ─── */
.symbols-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.symbol-card {
  background: var(--surface);
  border: var(--card-border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s;
  box-shadow: var(--shadow-sm);
}

.symbol-card:hover {
  border-color: var(--gold);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.symbol-emoji {
  width: 40px; height: 40px;
  background: var(--gold-bg);
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.symbol-name {
  font-size: 15px;
  color: var(--text);
  font-weight: 600;
}

.symbol-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.view-all-btn {
  display: inline-block;
  text-align: center;
  margin: 24px auto 0;
  color: var(--gold);
  font-size: 15px;
  padding: 12px 28px;
  border: 1px solid var(--border);
  border-radius: 100px;
  transition: all 0.2s;
  background: var(--surface);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.view-all-btn:hover {
  background: var(--gold-bg);
  border-color: var(--gold);
  transform: translateY(-1px);
}

/* ─── Articles Grid ─── */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.article-card {
  background: var(--surface);
  border: var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.article-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-thumb {
  height: 160px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.article-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

/* Placeholder gradients for articles */
.thumb-gradient-1 { background: linear-gradient(135deg, #1e3a8a, #3b82f6); }
.thumb-gradient-2 { background: linear-gradient(135deg, #064e3b, #10b981); }
.thumb-gradient-3 { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }

.article-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

.article-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--gold);
  border: 1px solid rgba(184,134,11,0.3);
  background: var(--gold-bg);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.article-card h3 {
  font-family: 'Amiri', serif;
  font-size: 18px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
  font-weight: 700;
}

.article-meta {
  margin-top: auto;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.read-more-text {
  color: #8a6308;
  font-weight: bold;
}
[data-theme="dark"] .read-more-text {
  color: #fcd34d;
}


/* ─── Methodology & Hadith Sections ─── */
.methodology-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}
.methodology-box h3 {
  font-family: 'Amiri', serif;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 16px;
}
.methodology-box p {
  color: var(--text-secondary);
  line-height: 2;
  font-size: 15px;
}

.icon-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tips-list {
  padding-right: 20px;
  margin-top: 16px;
}
.tips-list li {
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}
.tips-list li strong { color: var(--text); font-weight: 700; }

.hadith-list {
  display: grid;
  gap: 16px;
}
.hadith-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  gap: 16px;
}
.hadith-icon {
  color: var(--gold);
  font-size: 24px;
  flex-shrink: 0;
}
.hadith-text {
  font-family: 'Amiri', serif;
  font-size: 18px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 8px;
}
.hadith-source {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Features Grid ─── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}

.feature-icon {
  width: 48px; height: 48px;
  background: var(--gold-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  color: var(--gold);
}

.feature-card h3 {
  font-family: 'Amiri', serif;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ─── FAQ Accordion ─── */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.3s;
}
.faq-item.active {
  border-color: var(--gold);
  box-shadow: var(--shadow-sm);
}

.faq-question {
  width: 100%;
  text-align: right;
  padding: 18px 20px;
  background: none;
  border: none;
  font-family: 'Noto Naskh Arabic', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: var(--surface-hover); }

.faq-icon {
  font-size: 20px;
  color: var(--gold);
  transition: transform 0.3s;
  font-weight: 300;
}
.faq-item.active .faq-icon { transform: rotate(45deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  padding: 0 20px;
}
.faq-item.active .faq-answer {
  max-height: 400px;
  padding-bottom: 20px;
}
.faq-answer p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 16px;
}
.faq-answer ul {
  padding-right: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

/* ─── Trust Bar ─── */
.trust-bar {
  max-width: 1052px;
  margin: 0 auto 60px;
  padding: 0 16px;
}

.trust-bar-inner {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Subtle gold shimmer on top */
.trust-bar-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

[data-theme="dark"] .trust-bar-inner {
  background: rgba(20, 29, 53, 0.8);
  backdrop-filter: blur(10px);
}

/* Vertical dividers between stats */
.trust-stat {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.25s ease;
}

.trust-stat:not(:last-child) {
  border-left: 1px solid var(--border-light);
}

[dir="rtl"] .trust-stat:not(:last-child) {
  border-left: none;
  border-right: 1px solid var(--border-light);
}

.trust-stat:hover {
  transform: translateY(-3px);
}

.trust-icon {
  width: 48px;
  height: 48px;
  background: var(--gold-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.trust-icon i {
  font-size: 1.1rem;
  color: var(--gold);
}

.trust-number {
  font-family: 'Amiri', serif;
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
  font-weight: 700;
}

.trust-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Mobile: 2 columns */
@media (max-width: 640px) {
  .trust-bar-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
  }
  .trust-stat:not(:last-child) {
    border-right: none;
    border-left: none;
  }
  [dir="rtl"] .trust-stat:not(:last-child) {
    border-right: none;
  }
  .trust-stat:nth-child(odd) {
    border-left: 1px solid var(--border-light);
  }
  [dir="rtl"] .trust-stat:nth-child(odd) {
    border-left: none;
    border-right: 1px solid var(--border-light);
  }
  .trust-stat:nth-child(1),
  .trust-stat:nth-child(2) {
    border-bottom: 1px solid var(--border-light);
  }
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.footer-v5 {
  border-top: 1px solid var(--border-light);
  padding: 60px 16px 32px;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-v5 { max-width: 320px; }

.footer-logo-v5 {
  font-family: 'Amiri', serif;
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 700;
}

.footer-tagline {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.footer-social-v5 {
  display: flex;
  gap: 12px;
}

.footer-social-v5 a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-light);
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
  text-decoration: none;
}

.footer-social-v5 a:hover {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  transform: translateY(-3px);
}

.footer-links-v5 h3 {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
  font-weight: 700;
}

.footer-links-v5 ul { list-style: none; }
.footer-links-v5 li { margin-bottom: 10px; }
.footer-links-v5 a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: color 0.2s;
}
.footer-links-v5 a:hover { color: var(--gold); }

.footer-bottom-v5 {
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Tablet (768px+)
   ═══════════════════════════════════════════ */
@media (min-width: 768px) {
  .container-v5 { padding: 0 32px; }
  .nav-v5 { padding: 14px 32px; }
  .nav-links { display: flex; }
  .hamburger { display: none; }
  .hero-v5 { padding: 140px 32px 80px; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .symbols-grid { grid-template-columns: repeat(4, 1fr); }
  .articles-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-bar-inner { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .footer-bottom-v5 { flex-direction: row; justify-content: space-between; }
  .section-v5 { padding: 0 32px 80px; }
  .trust-bar { padding: 0 32px; }
  .methodology-box { padding: 40px; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Desktop (1024px+)
   ═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  .hero-v5 { min-height: 90vh; padding: 160px 48px 100px; }
  .hero-title { font-size: 64px; }
  .hero-subtitle { font-size: 18px; }
  .features-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===================================
   RAW HTML API RENDERING FIXES (OpenAI & Pollinations)
   =================================== */

.interpretation-wrapper {
  direction: rtl;
  text-align: right;
}

.interpretation-section {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  border-right: 3px solid var(--gold);
}

.interpretation-section.section-general { border-right-color: #3b82f6; }
.interpretation-section.section-symbols { border-right-color: #0ea5e9; }
.interpretation-section.section-advice { border-right-color: #f59e0b; }
.interpretation-section.section-quran { border-right-color: #10b981; }

.interpretation-section h4 {
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.interpretation-section.section-general h4 { color: #3b82f6; }
.interpretation-section.section-symbols h4 { color: #0ea5e9; }
.interpretation-section.section-advice h4 { color: #f59e0b; }
.interpretation-section.section-quran h4 { color: #10b981; }

.interpretation-section p {
  color: var(--text);
  line-height: 1.9;
  margin-bottom: 12px;
}

.symbol-item {
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  border-right: 3px solid rgba(14, 165, 233, 0.5);
}

.symbol-header strong {
  color: #10b981;
  font-size: 1.05rem;
}

.symbol-content {
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 6px;
}

.interpretation-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}


