/* ==========================================================================
   ARBAEEN - Forty Hadith of Imam an-Nawawi Interactive Reader
   Classical Manuscript Typography & Scholarly Aesthetics
   ========================================================================== */

:root {
  /* Color Palette - Default: Sepia / Manuscript Parchment */
  --bg-primary: #f8f4ea;
  --bg-surface: #fffdf7;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #f3edd9;
  --border-color: #dfd3bd;
  --border-subtle: #ece3cf;
  --border-ornament: #c8b183;
  
  --text-primary: #2b221a;
  --text-secondary: #5e5142;
  --text-muted: #8b7d6c;
  --text-arabic: #1f1812;
  
  --gold-primary: #9e6d23;
  --gold-hover: #825717;
  --gold-light: #faeecf;
  --gold-glow: rgba(158, 109, 35, 0.15);
  
  --emerald-primary: #1e5944;
  --emerald-light: #e0efe7;
  --crimson-primary: #8a2522;
  --crimson-light: #fbebea;

  --sidebar-bg: #f4eee0;
  --sidebar-hover: #eae1cd;
  --sidebar-active: #dfd2b5;
  
  --card-shadow: 0 4px 20px rgba(78, 59, 38, 0.08), 0 1px 3px rgba(78, 59, 38, 0.05);
  --modal-shadow: 0 20px 45px rgba(43, 34, 26, 0.22);
  --paper-grain: radial-gradient(#d6c6a6 0.75px, transparent 0.75px);
  
  /* Font Variables */
  --font-arabic: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  --font-heading: 'Cinzel', 'Plus Jakarta Sans', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Dynamic font sizes */
  --arabic-size: 30px;
  --english-size: 17px;
  --arabic-line-height: 2.25;
  --english-line-height: 1.75;

  --header-height: 70px;
  --sidebar-width: 340px;
  --transition-speed: 0.25s;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* Light / Library Theme */
[data-theme="light"] {
  --bg-primary: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-surface-subtle: #edf1f5;
  --border-color: #dbe2ea;
  --border-subtle: #e9eef3;
  --border-ornament: #047857;
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-arabic: #0f172a;
  
  --gold-primary: #047857;
  --gold-hover: #065f46;
  --gold-light: #d1fae5;
  --gold-glow: rgba(4, 120, 87, 0.15);

  --sidebar-bg: #f0f3f6;
  --sidebar-hover: #e4e9ef;
  --sidebar-active: #d6e0ea;
  
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --modal-shadow: 0 20px 45px rgba(0, 0, 0, 0.15);
}

/* Dark / Night Reflection Theme */
[data-theme="dark"] {
  --bg-primary: #10141a;
  --bg-surface: #181f28;
  --bg-surface-elevated: #202936;
  --bg-surface-subtle: #232d3b;
  --border-color: #2b3747;
  --border-subtle: #202a36;
  --border-ornament: #cfa85b;
  
  --text-primary: #eceff4;
  --text-secondary: #a8b5c6;
  --text-muted: #79879c;
  --text-arabic: #f8fafc;
  
  --gold-primary: #d4a953;
  --gold-hover: #e2ba66;
  --gold-light: #2c2517;
  --gold-glow: rgba(212, 169, 83, 0.2);

  --sidebar-bg: #141a22;
  --sidebar-hover: #1e2632;
  --sidebar-active: #273343;
  
  --card-shadow: 0 4px 25px rgba(0, 0, 0, 0.45);
  --modal-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

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

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

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

/* Background Subtle Texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--paper-grain);
  background-size: 24px 24px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Typography elements */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: 0.02em;
  font-weight: 600;
  color: var(--text-primary);
}

p {
  margin-bottom: 1rem;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

input, select {
  font-family: inherit;
  color: inherit;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   APP HEADER & NAVIGATION BAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  backdrop-filter: blur(8px);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--gold-glow);
  border: 1px solid var(--border-ornament);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.brand-arabic-badge {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--gold-primary);
  margin-left: 0.35rem;
  font-weight: bold;
}

/* Header Middle: Quick Search and Quick Jump */
.header-search-wrap {
  flex: 1;
  max-width: 440px;
  position: relative;
}

.header-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.45rem 1rem;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.header-search-box:focus-within {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background-color: var(--bg-surface);
}

.header-search-box input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: var(--text-primary);
}

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

.search-clear-btn {
  color: var(--text-muted);
  padding: 2px;
  border-radius: 50%;
}
.search-clear-btn:hover {
  color: var(--text-primary);
}

.search-shortcut-badge {
  font-size: 0.65rem;
  font-family: monospace;
  background: var(--border-color);
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--gold-glow);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.icon-btn.active {
  background-color: var(--gold-primary);
  color: #fff;
  border-color: var(--gold-primary);
}

.btn-pill {
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-subtle);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.btn-pill:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  background: var(--gold-glow);
}

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

.header-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  background: var(--crimson-primary);
  color: #fff;
  border-radius: 9999px;
  padding: 1px 6px;
  margin-left: 4px;
}

/* Tooltip standard */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #ffffff;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 1000;
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* ==========================================================================
   MAIN WORKSPACE & LAYOUT (SIDEBAR + READER)
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Sidebar Navigation */
.hadith-sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  flex-shrink: 0;
  transition: transform var(--transition-speed) ease, width var(--transition-speed) ease;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sidebar-stats {
  font-size: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 2px 8px;
  color: var(--text-secondary);
}

/* Filter Tags Pill Carousel */
.filter-tags-scroll {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.filter-tags-scroll::-webkit-scrollbar {
  display: none;
}

.tag-chip {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.tag-chip:hover {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

.tag-chip.active {
  background-color: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #fff;
  font-weight: 600;
}

/* Sidebar List */
.sidebar-hadith-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.hadith-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  background-color: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.hadith-list-item:hover {
  background-color: var(--sidebar-hover);
  border-color: var(--border-subtle);
}

.hadith-list-item.active {
  background-color: var(--sidebar-active);
  border-color: var(--border-ornament);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.hadith-list-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background-color: var(--gold-primary);
}

.item-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  flex-shrink: 0;
}

.hadith-list-item.active .item-num-badge {
  background-color: var(--gold-primary);
  color: #ffffff;
  border-color: var(--gold-primary);
}

.item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.item-title-en {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-title-ar {
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  color: var(--text-secondary);
  direction: rtl;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.item-status-icons {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.star-icon-btn {
  color: var(--text-muted);
  padding: 4px;
  border-radius: 50%;
}
.star-icon-btn.bookmarked {
  color: #eab308;
}

.memorized-badge-icon {
  color: #10b981;
  font-size: 0.8rem;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.progress-widget {
  width: 100%;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

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

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-primary), #10b981);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   READER CANVAS (MANUSCRIPT STYLING)
   ========================================================================== */
.reader-canvas {
  flex: 1;
  min-width: 0;
  padding: 2rem 2.5rem 5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Floating Study / Memorization Banner when Active */
.memorization-active-banner {
  width: 100%;
  max-width: 880px;
  background: linear-gradient(135deg, var(--gold-glow), var(--bg-surface-subtle));
  border: 1px solid var(--border-ornament);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.banner-icon {
  color: var(--gold-primary);
}

.banner-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.banner-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
}

.banner-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.segmented-toggle-group {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 2px;
}

.segmented-toggle-btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.segmented-toggle-btn.active {
  background-color: var(--gold-primary);
  color: #fff;
}

/* The Core Manuscript Card */
.manuscript-card {
  width: 100%;
  max-width: 880px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

/* Classical Manuscript Inner Decorative Border */
.manuscript-inner-frame {
  margin: 12px;
  border: 1px solid var(--border-ornament);
  border-radius: calc(var(--radius-lg) - 6px);
  position: relative;
  padding: 2.25rem 2.5rem 2.5rem 2.5rem;
}

/* Corner Rosettes / Islamic Arabesque Ornaments */
.manuscript-inner-frame::before,
.manuscript-inner-frame::after {
  content: "۞";
  position: absolute;
  font-family: var(--font-arabic);
  color: var(--border-ornament);
  font-size: 1.25rem;
  line-height: 1;
}

.manuscript-inner-frame::before {
  top: -8px;
  left: 14px;
  background: var(--bg-surface);
  padding: 0 4px;
}

.manuscript-inner-frame::after {
  bottom: -8px;
  right: 14px;
  background: var(--bg-surface);
  padding: 0 4px;
}

/* Card Header & Metadata */
.manuscript-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-hadith-number {
  background-color: var(--gold-primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-collection {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
}

.card-action-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Bismillah Manuscript Arch */
.bismillah-arch {
  text-align: center;
  margin: 1.25rem 0 2rem 0;
  position: relative;
}

.bismillah-text {
  font-family: var(--font-arabic);
  font-size: 1.85rem;
  color: var(--gold-primary);
  letter-spacing: 0.02em;
  user-select: none;
}

.bismillah-ornament-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.4rem;
}

.bismillah-ornament-line::before,
.bismillah-ornament-line::after {
  content: "";
  height: 1px;
  width: 90px;
  background: linear-gradient(to right, transparent, var(--border-ornament), transparent);
}

.ornament-diamond {
  color: var(--border-ornament);
  font-size: 0.75rem;
}

/* Hadith Titles */
.hadith-headings-section {
  text-align: center;
  margin-bottom: 2rem;
}

.hadith-arabic-title {
  font-family: var(--font-arabic);
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.4;
  direction: rtl;
}

.hadith-english-title {
  font-size: 1.25rem;
  color: var(--gold-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Narrator Attribution Box */
.narrator-card {
  background: var(--bg-surface-subtle);
  border-left: 3px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.narrator-ar {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
}

.narrator-en {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ==========================================================================
   ARABIC TEXT SECTION (SACRED SCRIPTURE DISPLAY)
   ========================================================================== */
.arabic-section {
  position: relative;
  margin-bottom: 2.25rem;
  padding: 1.5rem 1.75rem;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.arabic-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.6rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.arabic-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.arabic-content-text {
  font-family: var(--font-arabic);
  font-size: var(--arabic-size);
  line-height: var(--arabic-line-height);
  color: var(--text-arabic);
  direction: rtl;
  text-align: justify;
  text-justify: amiri;
  word-spacing: 0.08em;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: filter 0.3s ease;
}

/* Clean / No-Tashkeel Mode (dynamically toggled) */
.arabic-content-text.no-tashkeel {
  letter-spacing: 0;
}

/* Flashcard / Hidden Blur State */
.content-hidden-blur {
  filter: blur(8px);
  user-select: none;
  opacity: 0.45;
  cursor: pointer;
}

.hidden-overlay-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--bg-surface);
  border: 1px solid var(--gold-primary);
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-primary);
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.hidden-overlay-prompt:hover {
  background-color: var(--gold-primary);
  color: #ffffff;
  transform: translate(-50%, -50%) scale(1.03);
}

/* ==========================================================================
   AUDIO PLAYER DOCK
   ========================================================================== */
.audio-player-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.audio-controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.audio-left-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.play-pause-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--gold-glow);
  transition: transform 0.15s, background-color 0.2s;
  flex-shrink: 0;
}

.play-pause-btn:hover {
  background-color: var(--gold-hover);
  transform: scale(1.05);
}

.audio-info-meta {
  display: flex;
  flex-direction: column;
}

.audio-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.audio-reciter {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.audio-right-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speed-selector-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.loop-btn {
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
}

.loop-btn.active {
  color: var(--gold-primary);
  background: var(--gold-glow);
  border: 1px solid var(--border-ornament);
}

/* Audio Timeline & Scrubber */
.audio-timeline-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.audio-time {
  font-size: 0.72rem;
  font-family: monospace;
  color: var(--text-muted);
  min-width: 36px;
}

.audio-scrubber-track {
  flex: 1;
  position: relative;
  height: 6px;
  background: var(--border-color);
  border-radius: 9999px;
  cursor: pointer;
  overflow: hidden;
}

.audio-scrubber-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: var(--gold-primary);
  border-radius: 9999px;
  transition: width 0.1s linear;
}

/* Audio Voice Mode Badge (MP3 vs Speech Synthesis fallback) */
.audio-mode-badge {
  font-size: 0.65rem;
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 0.5rem;
}

/* ==========================================================================
   ENGLISH TRANSLATION SECTION
   ========================================================================== */
.english-section {
  position: relative;
  margin-bottom: 2.5rem;
  padding: 1.5rem 1.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.english-content-text {
  font-size: var(--english-size);
  line-height: var(--english-line-height);
  color: var(--text-primary);
  position: relative;
  transition: filter 0.3s ease;
}

.english-content-text p:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   FAWA'ID & COMMENTARY SECTION (KEY LESSONS & BENEFITS)
   ========================================================================== */
.commentary-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
}

.commentary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.commentary-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.fawaid-badge {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  color: var(--gold-primary);
}

/* Tabs */
.commentary-tabs {
  display: flex;
  gap: 0.35rem;
  background: var(--bg-surface-subtle);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.commentary-tab-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.commentary-tab-btn:hover {
  color: var(--gold-primary);
}

.commentary-tab-btn.active {
  background-color: var(--bg-surface);
  color: var(--gold-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.commentary-tab-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}
.commentary-tab-panel.active {
  display: block;
}

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

/* Benefits List Card Items */
.benefit-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.benefit-card-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.15rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.benefit-num-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.traditional-sharh-text {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text-primary);
  direction: rtl;
  text-align: justify;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  white-space: pre-line;
}

/* ==========================================================================
   CARD FOOTER NAVIGATION
   ========================================================================== */
.card-nav-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-adjacent-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.nav-adjacent-btn:hover:not(:disabled) {
  border-color: var(--gold-primary);
  background-color: var(--gold-glow);
  color: var(--gold-primary);
}

.nav-adjacent-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-center-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.memorize-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.memorize-checkbox-label:hover {
  border-color: #10b981;
}

.memorize-checkbox-label input[type="checkbox"] {
  accent-color: #10b981;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   MODALS, DRAWERS & SETTINGS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--modal-shadow);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-backdrop.open .modal-box {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.setting-info h5 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.setting-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
}

.font-size-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface-subtle);
  overflow: hidden;
}

.stepper-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.stepper-btn:hover {
  background: var(--gold-glow);
  color: var(--gold-primary);
}

.stepper-val {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
}

/* Quick Jump Grid in Modal */
.quick-jump-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

.quick-jump-num-btn {
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-subtle);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.quick-jump-num-btn:hover {
  border-color: var(--gold-primary);
  background: var(--gold-glow);
  color: var(--gold-primary);
  transform: translateY(-2px);
}

.quick-jump-num-btn.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: #fff;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1f2937;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) 2.7s forwards;
}

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

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

/* Keyboard Shortcut Dialog List */
.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border-subtle);
}

.shortcut-key {
  font-family: monospace;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* ==========================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 300px;
    --arabic-size: 26px;
  }
  .reader-canvas {
    padding: 1.5rem 1rem 4rem 1rem;
  }
  .manuscript-inner-frame {
    margin: 8px;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 0.6rem 0;
  }
  .header-container {
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .header-search-wrap {
    order: 3;
    max-width: 100%;
    width: 100%;
  }
  .hadith-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 500;
    transform: translateX(-100%);
    box-shadow: 4px 0 25px rgba(0,0,0,0.2);
    width: 85%;
    max-width: 320px;
    height: 100vh;
  }
  .hadith-sidebar.mobile-open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 490;
    display: none;
  }
  .sidebar-backdrop.active {
    display: block;
  }
  .mobile-menu-btn {
    display: flex !important;
  }
  .quick-jump-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .manuscript-inner-frame {
    padding: 1.25rem 1rem;
  }
  .bismillah-text {
    font-size: 1.45rem;
  }
  .hadith-arabic-title {
    font-size: 1.6rem;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none !important;
  }
}

/* ==========================================================================
   PRINT STYLESHEET (CLEAN STUDY SHEETS)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  body::before,
  .site-header,
  .hadith-sidebar,
  .card-action-bar,
  .audio-player-container,
  .card-nav-footer,
  .memorization-active-banner,
  .hidden-overlay-prompt,
  .toast-container,
  .modal-backdrop {
    display: none !important;
  }
  .main-wrapper {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .reader-canvas {
    padding: 0 !important;
    width: 100% !important;
  }
  .manuscript-card {
    border: 2px solid #222 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    page-break-after: always;
  }
  .manuscript-inner-frame {
    border: 1px solid #444 !important;
    margin: 8px !important;
    padding: 1.5rem !important;
  }
  .arabic-content-text {
    filter: none !important;
    color: #000 !important;
  }
  .english-content-text {
    filter: none !important;
    color: #111 !important;
  }
  .content-hidden-blur {
    filter: none !important;
    opacity: 1 !important;
  }
}

/* ==========================================================================
   HEADER NAVIGATION & MULTI-PAGE ENHANCEMENTS
   ========================================================================== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.nav-link:hover {
  color: var(--gold-primary);
  background-color: var(--bg-surface-subtle);
  text-decoration: none;
}

.nav-link.active {
  color: var(--gold-primary);
  background-color: var(--gold-glow);
  border-bottom: 2px solid var(--gold-primary);
}

/* Navigation Dropdowns */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown.active .nav-dropdown-toggle {
  color: var(--gold-primary);
  background-color: var(--bg-surface-subtle);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 0.4rem 0;
  z-index: 1000;
  margin-top: 0.25rem;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.nav-dropdown-item:hover {
  background-color: var(--gold-glow);
  color: var(--gold-primary);
  text-decoration: none;
  padding-left: 1.25rem;
}

.nav-dropdown-item.active {
  color: var(--gold-primary);
  font-weight: 700;
  background-color: var(--bg-surface-subtle);
}

.nav-link-btn {
  background: var(--gold-primary);
  color: #ffffff !important;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.nav-link-btn:hover {
  background: var(--gold-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 1180px) {
  .header-nav {
    display: none;
  }
}

/* Mobile Navigation Dropdown/Drawer */
.mobile-nav-panel {
  display: none;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-nav-panel.open {
  display: flex;
}

.mobile-nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: var(--bg-surface-subtle);
  color: var(--gold-primary);
  text-decoration: none;
}

/* ==========================================================================
   CONTENT PAGE LAYOUT & CLASSICAL ARTICLE CANVAS
   ========================================================================== */
.content-canvas {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem 1.25rem;
  flex: 1;
}

.article-hero {
  text-align: center;
  margin-bottom: 2.25rem;
}

.article-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.article-category-badge {
  background: var(--gold-glow);
  color: var(--gold-primary);
  border: 1px solid var(--border-ornament);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.35rem;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
}

.article-subtitle-ar {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  color: var(--gold-primary);
  direction: rtl;
  margin-bottom: 0.85rem;
}

.article-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.65rem 0;
  max-width: 780px;
  margin: 1rem auto 0 auto;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Classical Article Body & Typography */
.article-prose {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.article-prose p {
  margin-bottom: 1.35rem;
}

.article-prose h2 {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article-prose h2::before {
  content: "✦";
  color: var(--gold-primary);
  font-size: 1.1rem;
}

.article-prose h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--gold-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.article-prose ul, .article-prose ol {
  margin: 0 0 1.5rem 1.75rem;
}

.article-prose li {
  margin-bottom: 0.5rem;
}

/* Classical Quotes, Callouts & Boxes */
.classical-quote-card {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 1.35rem 1.6rem;
  margin: 1.75rem 0;
  position: relative;
}

.classical-quote-ar {
  font-family: var(--font-arabic);
  font-size: 1.45rem;
  direction: rtl;
  text-align: right;
  line-height: 2.1;
  color: var(--text-arabic);
  margin-bottom: 0.75rem;
}

.classical-quote-en {
  font-size: 0.98rem;
  font-style: italic;
  color: var(--text-secondary);
  line-height: 1.7;
}

.classical-quote-source {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-primary);
  margin-top: 0.5rem;
  text-align: right;
}

.callout-box {
  background: var(--gold-glow);
  border: 1px solid var(--border-ornament);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin: 1.75rem 0;
}

.callout-box h4 {
  font-size: 1.05rem;
  color: var(--gold-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-box p:last-child {
  margin-bottom: 0;
}

.hadith-breakdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.hadith-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border-subtle);
  padding-bottom: 0.65rem;
}

.hadith-badge-num {
  background: var(--gold-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
}

/* Classical Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0;
}

.classical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  text-align: left;
}

.classical-table th {
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  font-family: var(--font-heading);
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  font-weight: 600;
}

.classical-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.classical-table tr:nth-child(even) {
  background-color: var(--bg-surface-subtle);
}

/* FAQ Accordion Styling */
.faq-accordion-group {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-card {
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-card:hover {
  border-color: var(--border-ornament);
}

.faq-header {
  width: 100%;
  padding: 1.15rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  gap: 1rem;
}

.faq-icon-arrow {
  color: var(--gold-primary);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-card.open .faq-icon-arrow {
  transform: rotate(180deg);
}

.faq-card.open {
  border-color: var(--gold-primary);
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.faq-content {
  display: none;
  padding: 0 1.35rem 1.35rem 1.35rem;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.98rem;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 1rem;
}

.faq-card.open .faq-content {
  display: block;
}

/* Contact Form Styling */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (max-width: 840px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-info-panel {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.contact-info-panel h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.contact-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.contact-icon {
  color: var(--gold-primary);
  margin-top: 2px;
}

.contact-form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--card-shadow);
}

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

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

.form-submit-btn {
  background: var(--gold-primary);
  color: #ffffff;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.form-submit-btn:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}

.form-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  display: none;
  font-size: 0.92rem;
}

.form-alert.success {
  background: var(--emerald-light);
  color: var(--emerald-primary);
  border: 1px solid var(--emerald-primary);
}

/* ==========================================================================
   MULTI-COLUMN COMPREHENSIVE SITE FOOTER
   ========================================================================== */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 1.5rem 2.5rem 1.5rem;
  margin-top: auto;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--gold-primary);
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2px;
  background: var(--gold-primary);
}

.footer-brand-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 0.85rem;
  margin-bottom: 1.25rem;
}

.footer-tagline-ar {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  color: var(--gold-primary);
  direction: rtl;
  line-height: 1.8;
  margin-top: 0.5rem;
}

.footer-links-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links-list li a {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links-list li a:hover {
  color: var(--gold-primary);
  transform: translateX(3px);
  text-decoration: none;
}

.footer-links-list li a::before {
  content: "›";
  color: var(--gold-primary);
  font-size: 1rem;
  font-weight: bold;
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer-compliance-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

