/* ==========================================================================
   Sarkar Haji Ghulam Haider Qadri Ziayee - Digital Memorial & Archive
   Master Stylesheet (Modern Sufi Royal Aesthetic)
   ========================================================================== */

:root {
  --bg-primary: #070d14;
  --bg-secondary: #0c1523;
  --bg-card: rgba(15, 26, 42, 0.85);
  --bg-card-hover: rgba(22, 38, 60, 0.95);
  --bg-glass: rgba(12, 21, 35, 0.75);
  
  --emerald-900: #032b20;
  --emerald-800: #064e3b;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);

  --gold-300: #fde68a;
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --gold-700: #b45309;
  --gold-glow: rgba(245, 158, 11, 0.28);

  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-gold: #fbbf24;

  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-gold: rgba(245, 158, 11, 0.35);
  --border-emerald: rgba(16, 185, 129, 0.35);

  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Amiri', 'Cinzel', Georgia, serif;
  --font-urdu: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', 'Amiri', serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-gold: 0 8px 32px rgba(245, 158, 11, 0.15);
  --shadow-emerald: 0 8px 32px rgba(6, 78, 59, 0.35);

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables (High Contrast, Enhanced Readability) */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.9);

  --emerald-900: #ecfdf5;
  --emerald-800: #d1fae5;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #059669;
  --emerald-glow: rgba(5, 150, 105, 0.18);

  --gold-300: #92400e;
  --gold-400: #b45309;
  --gold-500: #d97706;
  --gold-600: #b45309;
  --gold-700: #78350f;
  --gold-glow: rgba(217, 119, 6, 0.22);

  --text-primary: #090e17;
  --text-secondary: #1e293b;
  --text-muted: #475569;
  --text-gold: #b45309;

  --border-subtle: #e2e8f0;
  --border-gold: rgba(217, 119, 6, 0.4);
  --border-emerald: rgba(5, 150, 105, 0.4);

  --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-gold: 0 8px 32px rgba(217, 119, 6, 0.12);
  --shadow-emerald: 0 8px 32px rgba(6, 78, 59, 0.08);
}

[data-theme="light"] body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(5, 150, 105, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(217, 119, 6, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(241, 245, 249, 0.9) 0%, transparent 50%);
}

[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] h4,
[data-theme="light"] h5,
[data-theme="light"] h6,
[data-theme="light"] summary,
[data-theme="light"] .brand-text h1,
[data-theme="light"] .hero-title,
[data-theme="light"] .section-title-wrap h1,
[data-theme="light"] .section-title-wrap h2,
[data-theme="light"] .tenet-card h3,
[data-theme="light"] .video-body h4,
[data-theme="light"] .article-card h3,
[data-theme="light"] .prayer-form h3,
[data-theme="light"] .calendar-card h3,
[data-theme="light"] .darood-feature h2,
[data-theme="light"] .bio-section h2,
[data-theme="light"] .miracle-card h3,
[data-theme="light"] .astana-info-list strong {
  color: #090e17 !important;
}

[data-theme="light"] p,
[data-theme="light"] .hero-desc,
[data-theme="light"] .section-title-wrap p,
[data-theme="light"] .tenet-card p,
[data-theme="light"] .video-body p,
[data-theme="light"] .article-card p,
[data-theme="light"] .prayer-form p,
[data-theme="light"] .calendar-card p,
[data-theme="light"] .darood-feature p,
[data-theme="light"] .bio-section p,
[data-theme="light"] .miracle-card p,
[data-theme="light"] .astana-info-list div,
[data-theme="light"] details p,
[data-theme="light"] .stat-item p,
[data-theme="light"] .quote-english {
  color: #1e293b !important;
}

[data-theme="light"] .nav-link {
  color: #1e293b;
  font-weight: 600;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
  color: var(--gold-600);
}

[data-theme="light"] .hero-title span {
  background: linear-gradient(135deg, #090e17 40%, var(--gold-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hero-subtitle {
  color: #b45309 !important;
}

[data-theme="light"] .section-dark {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .section-badge {
  background: rgba(4, 120, 87, 0.1) !important;
  border-color: rgba(4, 120, 87, 0.3) !important;
  color: #047857 !important;
}

[data-theme="light"] .stat-item h4 {
  color: #b45309 !important;
}

[data-theme="light"] .form-label {
  color: #090e17 !important;
  font-weight: 600;
}

[data-theme="light"] .form-control {
  background: #ffffff;
  color: #090e17 !important;
  border: 1.5px solid #cbd5e1;
}

[data-theme="light"] .form-control:focus {
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

[data-theme="light"] .quote-box {
  background: linear-gradient(135deg, #f0fdf4, #ffffff) !important;
  border: 1px solid rgba(5, 150, 105, 0.3) !important;
}

[data-theme="light"] .quote-urdu {
  color: #b45309 !important;
}

[data-theme="light"] .quote-author {
  color: #047857 !important;
}

[data-theme="light"] .modal-dialog {
  background: #ffffff;
}

[data-theme="light"] .modal-header h3 {
  color: #090e17;
}

[data-theme="light"] .modal-close {
  color: #64748b;
}

[data-theme="light"] .bio-article {
  background: #ffffff;
  border-color: #e2e8f0;
}

[data-theme="light"] .miracle-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .highlight-quote {
  background: #f0fdf4 !important;
  color: #090e17 !important;
}

[data-theme="light"] details.glass-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .calendar-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .calendar-date {
  background: #fef3c7 !important;
  border: 1px solid #d97706 !important;
}

[data-theme="light"] .calendar-date .day {
  color: #b45309 !important;
}

[data-theme="light"] .darood-feature {
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%) !important;
  border: 1px solid #d97706 !important;
}

[data-theme="light"] .video-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .article-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .search-input {
  background: #ffffff !important;
  color: #090e17 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .filter-btn {
  background: #ffffff !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .filter-btn.active,
[data-theme="light"] .filter-btn:hover {
  background: #d97706 !important;
  color: #ffffff !important;
  border-color: #d97706 !important;
}

[data-theme="light"] .tenet-urdu {
  background: rgba(217, 119, 6, 0.08) !important;
  color: #92400e !important;
  border: 1px solid rgba(217, 119, 6, 0.2) !important;
}

[data-theme="light"] .tenet-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .modal-close {
  color: #64748b;
}

[data-theme="light"] .bio-article {
  background: #ffffff;
}

[data-theme="light"] .bio-section p {
  color: #334155;
}

[data-theme="light"] .miracle-card {
  background: #f8fafc;
}

[data-theme="light"] .miracle-card h3,
[data-theme="light"] .miracle-card h4 {
  color: var(--gold-700);
}

[data-theme="light"] .highlight-quote {
  background: #ecfdf5;
  color: #0f172a;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  color: var(--gold-400);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-subtle);
}

.theme-toggle-btn:hover {
  background: var(--gold-500);
  color: #000;
  transform: rotate(20deg) scale(1.08);
}

/* Language Switcher Pill */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-subtle);
}

.lang-btn {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
}

.lang-btn:hover,
.lang-btn.active {
  color: #000 !important;
  background: var(--gold-500);
  font-weight: 700;
}

.lang-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(6, 78, 59, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(217, 119, 6, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(3, 43, 32, 0.3) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

a {
  color: var(--gold-400);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--gold-300);
}

.text-gold { color: var(--gold-400) !important; }
.text-emerald { color: var(--emerald-500) !important; }
.font-serif { font-family: var(--font-serif); }
.font-urdu { font-family: var(--font-urdu); direction: rtl; text-align: right; }

/* Subtle Gold Divider & Accent */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  color: var(--gold-400);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title-wrap {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem auto;
}

.section-title-wrap h2 {
  margin-bottom: 0.75rem;
}

.title-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem auto;
}

.title-ornament span {
  height: 1px;
  width: 60px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.title-ornament i {
  color: var(--gold-400);
  font-size: 0.85rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-smooth);
}

.site-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-bottom-color: var(--border-gold);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 1rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-emblem {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-800), var(--bg-secondary));
  border: 2px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-family: var(--font-serif);
  font-size: 1.4rem;
  box-shadow: 0 0 15px var(--gold-glow);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  margin: 0;
  white-space: nowrap;
}

.brand-text span {
  font-size: 0.72rem;
  color: var(--gold-400);
  letter-spacing: 0.8px;
  display: block;
  white-space: nowrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  list-style: none;
  flex-wrap: nowrap;
  white-space: nowrap;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0.2rem;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-400), var(--emerald-500));
  transition: var(--transition-smooth);
  border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  border: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: #000;
  font-weight: 700;
  box-shadow: 0 4px 18px var(--gold-glow);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.4);
}

.btn-outline-emerald {
  background: rgba(6, 78, 59, 0.2);
  border: 1px solid var(--emerald-600);
  color: var(--emerald-400);
}

.btn-outline-emerald:hover {
  background: var(--emerald-800);
  color: #fff;
  border-color: var(--emerald-500);
  transform: translateY(-2px);
}

.btn-outline-gold {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--border-gold);
  color: var(--gold-400);
}

.btn-outline-gold:hover {
  background: rgba(245, 158, 11, 0.2);
  color: #fff;
  border-color: var(--gold-400);
  transform: translateY(-2px);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 5rem 0 6rem 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 3.5rem;
}

.hero-content {
  z-index: 2;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gold-400);
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.hero-title {
  margin-bottom: 1.25rem;
  line-height: 1.18;
}

.hero-title span {
  background: linear-gradient(135deg, #fff 40%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.15rem;
  color: #cbd5e1;
  max-width: 600px;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item h4 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gold-400);
  margin-bottom: 0.2rem;
}

.stat-item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Portrait Frame */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.portrait-frame {
  position: relative;
  width: 360px;
  height: 440px;
  border-radius: 200px 200px 24px 24px;
  padding: 12px;
  background: linear-gradient(180deg, var(--gold-500), var(--emerald-700));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px var(--gold-glow);
}

.portrait-frame::before {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 215px 215px 36px 36px;
  border: 1px dashed var(--gold-500);
  opacity: 0.4;
  animation: rotateBorder 30s linear infinite;
  pointer-events: none;
}

.portrait-inner {
  width: 100%;
  height: 100%;
  border-radius: 190px 190px 16px 16px;
  overflow: hidden;
  background: var(--bg-secondary);
  position: relative;
}

.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s ease;
}

.portrait-frame:hover .portrait-img {
  transform: scale(1.05);
}

.portrait-badge {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 2px solid var(--gold-500);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.4rem;
  white-space: nowrap;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--gold-300);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ==========================================================================
   Section Styling & Cards
   ========================================================================== */
.section {
  padding: 6rem 0;
  position: relative;
}

.section-dark {
  background: rgba(12, 21, 35, 0.5);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-5px);
  box-shadow: var(--shadow-gold);
}

/* 3 Pillars / Tenets */
.tenets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.tenet-card {
  position: relative;
  overflow: hidden;
}

.tenet-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: rgba(6, 78, 59, 0.4);
  border: 1px solid var(--emerald-600);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-400);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.tenet-card h3 {
  margin-bottom: 0.75rem;
  color: #fff;
}

.tenet-card p {
  margin-bottom: 1.25rem;
}

.tenet-urdu {
  font-family: var(--font-urdu);
  color: var(--gold-300);
  font-size: 1.1rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ==========================================================================
   Spiritual Lineage Tree (Shajra-e-Tariqat)
   ========================================================================== */
.lineage-tree-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  padding: 2rem 0;
}

.lineage-tree-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-500), var(--emerald-500), var(--gold-500));
  transform: translateX(-50%);
}

.lineage-node {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
  z-index: 1;
}

.lineage-card {
  width: 85%;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  text-align: center;
  backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.lineage-card:hover {
  background: var(--bg-secondary);
  box-shadow: 0 0 25px var(--gold-glow);
  transform: scale(1.02);
}

.lineage-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-400);
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 0.4rem;
}

.lineage-card h4 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.lineage-card p {
  color: var(--emerald-400);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.lineage-era {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ==========================================================================
   Video Theater & Grid
   ========================================================================== */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--gold-500);
  color: #000;
  font-weight: 700;
  border-color: var(--gold-400);
  box-shadow: 0 4px 15px var(--gold-glow);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.video-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-6px);
  box-shadow: var(--shadow-gold);
}

.video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.video-card:hover .video-thumb {
  transform: scale(1.08);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: var(--transition-smooth);
}

.play-btn-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--gold-500);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
  transition: var(--transition-smooth);
}

.video-card:hover .play-btn-circle {
  transform: scale(1.15);
  background: #fff;
}

.video-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(7, 13, 20, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--gold-300);
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.video-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.video-body h4 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 0.6rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Video Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 900px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-size: 1.15rem;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.6rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: #fff;
}

.modal-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   Quotes & Pearls of Wisdom Carousel
   ========================================================================== */
.quotes-container {
  max-width: 860px;
  margin: 0 auto;
}

.quote-box {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.3), rgba(15, 26, 42, 0.85));
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.quote-box::before {
  content: '“';
  position: absolute;
  top: 10px;
  left: 30px;
  font-size: 6rem;
  font-family: var(--font-serif);
  color: var(--gold-500);
  opacity: 0.25;
  line-height: 1;
}

.quote-theme {
  display: inline-block;
  color: var(--gold-400);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.quote-english {
  font-size: 1.35rem;
  font-style: italic;
  color: #f1f5f9;
  line-height: 1.8;
  margin-bottom: 1.75rem;
}

.quote-urdu {
  font-family: var(--font-urdu);
  font-size: 1.4rem;
  color: var(--gold-300);
  line-height: 2;
  margin-bottom: 1.5rem;
}

.quote-author {
  font-size: 0.95rem;
  color: var(--emerald-400);
  font-weight: 600;
}

.quote-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.quote-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quote-dot.active {
  background: var(--gold-400);
  transform: scale(1.3);
}

/* ==========================================================================
   Astana Haideria & Contact
   ========================================================================== */
.astana-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.astana-info-list {
  list-style: none;
  margin: 1.5rem 0;
}

.astana-info-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: #cbd5e1;
}

.astana-info-list i {
  color: var(--gold-400);
  font-size: 1.25rem;
  margin-top: 0.2rem;
}

.prayer-form {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 2.5rem;
}

.prayer-form h3 {
  color: #fff;
  margin-bottom: 0.5rem;
}

.prayer-form p {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: rgba(7, 13, 20, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 10px var(--gold-glow);
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #04080d;
  border-top: 1px solid var(--border-subtle);
  padding: 5rem 0 2rem 0;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-links h4 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 1.25rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.6rem;
}

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

.footer-links a:hover {
  color: var(--gold-400);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background: var(--gold-500);
  color: #000;
  border-color: var(--gold-400);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Keyframe Animations & Responsiveness
   ========================================================================== */
@keyframes rotateBorder {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    max-width: 500px;
    margin: 0 auto;
  }

  .astana-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .lineage-tree-wrapper::before {
    left: 20px;
  }

  .lineage-node {
    justify-content: flex-start;
    padding-left: 50px;
  }

  .lineage-card {
    width: 100%;
    text-align: left;
  }
}

/* ==========================================================================
   Comprehensive Responsive Device Optimization
   ========================================================================== */

/* Laptops & Medium Screens */
@media (max-width: 1240px) {
  .nav-menu {
    gap: 0.75rem;
  }
  .nav-link {
    font-size: 0.88rem;
  }
  .nav-actions .btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }
}

/* Tablets & Mobile Navigation Breakpoint */
@media (max-width: 1080px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-gold);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    gap: 0.4rem;
    z-index: 999;
  }

  .nav-menu.mobile-open {
    display: flex !important;
    animation: slideDownMenu 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes slideDownMenu {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-menu .nav-link {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: rgba(245, 158, 11, 0.12);
    color: var(--gold-400);
  }

  .nav-actions .btn {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--gold-400);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
  }

  .mobile-toggle:hover {
    background: var(--gold-500);
    color: #000;
  }
}

/* Tablets (992px and below) */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    max-width: 500px;
    margin: 0 auto;
  }

  .astana-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .darood-feature {
    grid-template-columns: 1fr;
    padding: 2.25rem;
    gap: 2rem;
  }
}

/* Mobile Devices & Phablets (768px and below) */
@media (max-width: 768px) {
  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0.5rem 0.25rem 1rem 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 2rem;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.5rem 1.15rem;
    font-size: 0.85rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .portrait-frame {
    width: 260px;
    height: 330px;
  }

  .section {
    padding: 4.5rem 0;
  }
}

/* Compact Smartphones (480px and below) */
@media (max-width: 480px) {
  .nav-container {
    height: 68px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .brand-logo {
    gap: 0.55rem;
  }

  .brand-emblem {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .brand-text h1 {
    font-size: 0.88rem;
  }

  .brand-text span {
    font-size: 0.62rem;
  }

  .lang-switch {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
  }

  .theme-toggle-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .mobile-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .hero-section {
    padding: 3.5rem 0 2rem 0;
  }

  .hero-title {
    font-size: 1.75rem !important;
  }

  .hero-desc {
    font-size: 0.95rem !important;
    line-height: 1.75;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.2rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .stat-item {
    padding: 1rem;
  }

  .stat-item h4 {
    font-size: 1.8rem;
  }

  .portrait-frame {
    width: 220px;
    height: 280px;
  }

  .portrait-badge {
    font-size: 0.78rem;
    padding: 0.4rem 0.9rem;
    bottom: -15px;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section-title-wrap {
    margin-bottom: 2.25rem;
  }

  .section-title-wrap h1 {
    font-size: 1.8rem;
  }

  .section-title-wrap h2 {
    font-size: 1.55rem;
  }

  .calendar-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 1rem;
  }

  .calendar-date {
    width: 100%;
    height: auto;
    padding: 0.5rem 1rem;
    flex-direction: row;
    justify-content: space-between;
  }

  .darood-feature {
    padding: 1.5rem !important;
    gap: 1.5rem;
  }

  .article-card {
    padding: 1.35rem;
  }

  .quote-box {
    padding: 2rem 1.25rem;
  }

  .quote-english {
    font-size: 1.15rem !important;
  }

  .quote-urdu {
    font-size: 1.2rem !important;
  }
}

/* ==========================================================================
   Core Web Vitals & Rendering Performance Optimizations
   ========================================================================== */
.tenets-grid,
.video-grid,
.article-grid,
.bio-article,
.astana-grid {
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

/* Input font size for mobile Safari */
.form-control,
.search-input {
  font-size: 16px !important;
}

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