/* ==========================================================================
   HadithHub – Modern Islamic Design System & Stylesheet
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Themes
   -------------------------------------------------------------------------- */
:root {
  /* Colors - Light Theme */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-muted: #f1f5f9;
  --bg-input: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #8293a7;
  --text-inverse: #ffffff;

  --border-subtle: #e2e8f0;
  --border-card: #e5e9f0;
  --border-focus: #059669;

  /* Brand Emeralds */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-dark: #064e3b;
  --primary-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
  --primary-glow: rgba(5, 150, 105, 0.25);

  /* Gold / Amber Accents */
  --gold: #d97706;
  --gold-light: #fef3c7;
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gold-glow: rgba(245, 158, 11, 0.3);

  /* Streak Fire */
  --streak-gradient: linear-gradient(135deg, #ff9800 0%, #ef4444 100%);
  --streak-glow: rgba(239, 68, 68, 0.35);

  /* Status Colors */
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #0284c7;
  --info-light: #e0f2fe;

  /* Shell / Header */
  --header-bg: rgba(255, 255, 255, 0.88);
  --header-border: rgba(226, 232, 240, 0.85);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 14px 34px -4px rgba(5, 150, 105, 0.14), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
  --shadow-elevated: 0 12px 30px rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ar: 'Amiri', 'Traditional Arabic', serif;
  --ar-font-scale: 1.35rem;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  /* Layout */
  --max-width: 960px;
  --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-page: #0a0f15;
  --bg-surface: #111a24;
  --bg-surface-elevated: #162230;
  --bg-surface-muted: #1c2b3d;
  --bg-input: #15202d;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --border-subtle: #1e2e42;
  --border-card: #203348;
  --border-focus: #10b981;

  --primary: #10b981;
  --primary-hover: #34d399;
  --primary-light: rgba(16, 185, 129, 0.15);
  --primary-dark: #064e3b;
  --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --primary-glow: rgba(16, 185, 129, 0.25);

  --gold: #fbbf24;
  --gold-light: rgba(251, 191, 36, 0.12);
  --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  --gold-glow: rgba(251, 191, 36, 0.25);

  --danger-light: rgba(239, 68, 68, 0.15);
  --warning-light: rgba(245, 158, 11, 0.15);
  --info-light: rgba(2, 132, 199, 0.15);

  --header-bg: rgba(13, 21, 30, 0.88);
  --header-border: rgba(30, 46, 66, 0.85);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 14px 34px -4px rgba(16, 185, 129, 0.2), 0 4px 12px -2px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------------------------------
   2. Reset & Global Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

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

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

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

/* --------------------------------------------------------------------------
   3. Header & Navigation (Glassmorphic)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--header-border);
  transition: background-color var(--transition), border-color var(--transition);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
  transition: transform var(--transition);
}

.brand-logo:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--primary-gradient);
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 3px 10px var(--primary-glow);
}

.brand-highlight {
  color: var(--primary);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-surface-muted);
  text-decoration: none;
}

.nav-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
}

.nav-btn {
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
}

.nav-btn-outline {
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  background: transparent;
}

.nav-btn-outline:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-surface-muted);
  text-decoration: none;
}

.nav-btn-primary {
  background: var(--primary-gradient);
  color: #ffffff !important;
  border: none;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.nav-btn-primary:hover {
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Streak Badge */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--streak-gradient);
  color: #ffffff !important;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  box-shadow: 0 3px 10px var(--streak-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.streak-badge:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 5px 14px var(--streak-glow);
  text-decoration: none;
}

.streak-flame {
  display: inline-block;
  animation: flamePulse 1.8s infinite alternate ease-in-out;
}

@keyframes flamePulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255, 152, 0, 0.4)); }
  100% { transform: scale(1.18); filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.7)); }
}

.streak-label {
  font-size: 0.78rem;
  opacity: 0.9;
  font-weight: 500;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
  font-size: 1rem;
}

.theme-toggle-btn:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(15deg);
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: inline-block;
}

:root:not([data-theme="dark"]) .theme-icon-sun {
  display: none;
}

:root:not([data-theme="dark"]) .theme-icon-moon {
  display: inline-block;
}

/* Language Toggle Button */
.lang-toggle-btn {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.86rem;
  transition: all var(--transition);
}

.lang-toggle-btn:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.lang-toggle-btn .lang-icon {
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   4. Main Container & Solidarity Banner
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Solidarity Banner */
.solidarity-banner {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.08) 0%, rgba(5, 150, 105, 0.12) 100%);
  border: 1px solid rgba(5, 150, 105, 0.25);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.06);
  transition: all var(--transition);
}

[data-theme="dark"] .solidarity-banner {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.25) 0%, rgba(5, 150, 105, 0.15) 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

.solidarity-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.flag-icon {
  font-size: 1.15rem;
}

.solidarity-text {
  font-family: var(--font-ar);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.2px;
}

/* Messages / Alerts */
.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.messages li, .alert {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-info, .messages li.info {
  background-color: var(--info-light);
  color: var(--info);
  border-color: rgba(2, 132, 199, 0.25);
}

.alert-warning, .messages li.warning {
  background-color: var(--warning-light);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.alert-danger, .messages li.error {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.alert-success, .messages li.success {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: rgba(5, 150, 105, 0.25);
}

/* --------------------------------------------------------------------------
   5. Hero Section & Command Search (Homepage)
   -------------------------------------------------------------------------- */
.hero-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 12px 0 20px;
}

.hero-title {
  font-size: 2.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px 0;
  color: var(--text-primary);
  line-height: 1.25;
}

.hero-subtitle {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 28px auto;
  font-weight: 400;
}

/* Command Search Bar */
.search-wrapper {
  max-width: 680px;
  margin: 0 auto 36px auto;
}

.form-search {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  padding: 6px 8px 6px 18px;
  transition: all var(--transition);
}

.form-search:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 6px 24px var(--primary-glow);
  transform: translateY(-2px);
}

.search-icon {
  color: var(--text-muted);
  margin-right: 12px;
  display: flex;
  align-items: center;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 1.02rem;
  color: var(--text-primary);
  outline: none;
  padding: 8px 0;
}

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

.search-btn {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px var(--primary-glow);
  transition: all var(--transition);
}

.search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* Quick Search Tags */
.quick-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-tag-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.quick-tag-item {
  background: var(--bg-surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.quick-tag-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   6. Featured "Hadith of the Day" Showcase Card
   -------------------------------------------------------------------------- */
.daily-showcase-card {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-elevated) 100%);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 44px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.daily-showcase-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.daily-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.daily-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold-light);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.84rem;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(217, 119, 6, 0.2);
}

.daily-source-pill {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

.daily-text-ar {
  font-family: var(--font-ar);
  font-size: 1.35rem;
  line-height: 2.2;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  text-align: right;
  direction: rtl;
}

.daily-text-en {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
}

.daily-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
}

.btn-read-day {
  background: var(--primary-gradient);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-read-day:hover {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--primary-glow);
  text-decoration: none;
}

.daily-sub-actions {
  display: flex;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   7. Collections Grid (Sources)
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-title {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.section-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

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

.source-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}

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

.source-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.source-hadith-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface-muted);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.source-titles {
  margin-bottom: 16px;
}

.source-title-en {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.source-title-ar {
  font-family: var(--font-ar);
  font-size: 1.15rem;
  color: var(--primary);
  margin: 0;
  direction: rtl;
  text-align: left;
}

/* Source Progress Bar */
.source-progress-wrapper {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.source-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.source-progress-pct {
  font-weight: 600;
  color: var(--primary);
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-surface-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* --------------------------------------------------------------------------
   8. Reader View & Hadith Card (hadith.html)
   -------------------------------------------------------------------------- */
.reader-header {
  margin-bottom: 28px;
}

.reader-progress-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.reader-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

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

.font-size-controls {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px 4px;
  box-shadow: var(--shadow-sm);
}

.btn-font-scale {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-font-scale:hover {
  background: var(--bg-surface-muted);
  color: var(--text-primary);
}

/* The Hadith Card */
.hadith-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: all var(--transition);
}

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

.hadith-badge-no {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.read-check-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-light);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.text-ar {
  font-family: var(--font-ar);
  font-size: var(--ar-font-scale);
  line-height: 2.25;
  color: var(--text-primary);
  margin: 0 0 24px 0;
  text-align: justify;
  text-align-last: right;
  direction: rtl;
  letter-spacing: 0.1px;
}

.hadith-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  color: var(--text-muted);
  position: relative;
}

.hadith-divider::before, .hadith-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.divider-ornament {
  padding: 0 16px;
  font-size: 1.1rem;
  color: var(--gold);
}

.text-en {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0 0 24px 0;
}

.hadith-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

/* Buttons */
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
  color: #ffffff;
  text-decoration: none;
}

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

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--text-muted);
  color: var(--text-primary);
  text-decoration: none;
}

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

.btn-danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.84rem;
}

/* Pagination / Reader Controls */
.reader-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
  direction: ltr !important;
}

.btn-next {
  background: var(--primary-gradient);
  font-weight: 700;
  padding: 10px 24px;
}

/* --------------------------------------------------------------------------
   9. Profile Dashboard
   -------------------------------------------------------------------------- */
.profile-dashboard {
  margin-bottom: 40px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.profile-user-info h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.profile-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stats Row */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-metric-icon.flame {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.stat-metric-icon.book {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-metric-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Profile Collections Table */
.profile-table-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
}

.profile-table th {
  background: var(--bg-surface-muted);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.profile-table tbody tr:last-child td {
  border-bottom: none;
}

.profile-table tbody tr:hover {
  background-color: var(--bg-surface-muted);
}

/* --------------------------------------------------------------------------
   10. Auth Cards (Login & Signup)
   -------------------------------------------------------------------------- */
.auth-wrapper {
  max-width: 440px;
  margin: 32px auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.form-auth {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-auth input[type="text"],
.form-auth input[type="email"],
.form-auth input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: all var(--transition);
}

.form-auth input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px 24px;
  margin-top: auto;
  transition: background-color var(--transition);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-brand {
  max-width: 340px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.footer-logo svg {
  color: var(--primary);
}

.footer-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}

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

.btn-share-footer {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(5, 150, 105, 0.3);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 20px;
  text-align: center;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-bottom p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   12. Toast Feedback Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-elevated);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* --------------------------------------------------------------------------
   13. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.85rem;
  }

  .header-container {
    padding: 10px 16px;
  }

  .nav-item:not(.nav-profile) {
    display: none;
  }

  .hadith-card {
    padding: 22px 20px;
  }

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

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

  .footer-container {
    flex-direction: column;
    gap: 20px;
  }
}

/* --------------------------------------------------------------------------
   14. Arabic & RTL Support (dir="rtl")
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Amiri", sans-serif;
}

[dir="rtl"] .form-search {
  padding: 6px 18px 6px 8px;
}

[dir="rtl"] .search-icon {
  margin-right: 0;
  margin-left: 12px;
}

[dir="rtl"] .search-btn {
  flex-direction: row-reverse;
}

[dir="rtl"] .profile-user-info {
  text-align: right;
}

[dir="rtl"] .profile-table th,
[dir="rtl"] .profile-table td {
  text-align: right;
}

[dir="rtl"] .profile-table th:last-child,
[dir="rtl"] .profile-table td:last-child {
  text-align: left !important;
}

[dir="rtl"] .share-arrow {
  display: inline-block;
  transform: scaleX(-1);
}

[dir="rtl"] .reader-header h1 {
  text-align: right;
}

[dir="rtl"] .section-header {
  text-align: right;
}

[dir="rtl"] .section-title {
  text-align: right;
}

[dir="rtl"] .section-desc {
  text-align: right;
}

