:root {
  --night: #0a1429;
  --night2: #1a2644;
  --night3: #243356;
  --gold: #ffd700;
  --gold-soft: #ffed9a;
  --gold-dark: #d4af37;
  --ink: #ffffff;
  --muted: #c7d0ea;
  --muted-dark: #8b9cc7;
  --ring: rgba(255, 215, 0, 0.25);
  --ring-strong: rgba(255, 215, 0, 0.4);
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-light: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  margin: 0;
  background: linear-gradient(180deg, var(--night) 0%, #0a1126 40%, var(--night) 100%);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* Hero Section - Centered and Adjusted */
.hero {
  position: relative;
  padding: 52px 20px 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  background: 
    linear-gradient(135deg, rgba(10, 20, 41, 0.96) 0%, rgba(26, 38, 68, 0.98) 100%),
    radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.06) 0%, transparent 50%),
    url('./assets/images/fond.png') center/cover no-repeat;
  min-height: 36vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, var(--gold-soft) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

@keyframes titleGlow {
  0% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
  }
  100% {
    filter: drop-shadow(0 0 40px rgba(255, 215, 0, 0.6));
  }
}

.gold-text {
  color: var(--gold);
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 1.9;
  margin: 0 auto 20px;
  max-width: 800px;
}

.hero-quote {
  font-style: italic;
  color: var(--gold-soft);
  font-size: clamp(14px, 2vw, 18px);
  margin: 0 auto 28px;
  max-width: 700px;
  opacity: 0.95;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(35, 53, 107, 0.8), rgba(22, 39, 88, 0.8));
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 215, 0, 0.3);
}

.btn.gold {
  background: linear-gradient(135deg, #f7e9b5, #d9b85a);
  color: #121212;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: none;
}

.btn.gold:hover {
  box-shadow: none;
  transform: translateY(-1px);
}

.btn svg {
  transition: transform 0.3s ease;
}

.btn:hover svg {
  transform: translateX(4px);
}

.calli {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 500px;
  background: url('./assets/images/background-calligraphy.png') center/contain no-repeat;
  opacity: 0.15;
  transform: translateY(0);
  will-change: transform;
  pointer-events: none;
  z-index: 1;
}

/* Layout */
.wrapper {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 400px);
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1060px) {
  .wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 0px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #0b1430, #0a122a);
  backdrop-filter: blur(10px);
}

.brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.search {
  position: relative;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-icon {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-dark);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(180deg, rgba(10, 21, 50, 0.8), rgba(10, 20, 45, 0.8));
  color: #fff;
  outline: none;
  font-size: 14px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.search input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
  background: linear-gradient(180deg, rgba(15, 28, 60, 0.9), rgba(12, 24, 52, 0.9));
}

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

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.2);
  border-radius: 3px;
}

.nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin: 4px 0;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.05));
  transition: all 0.3s ease;
  font-size: 14px;
}

.nav a:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.08));
  transform: translateX(4px);
}

.nav a.active {
  border-color: var(--ring);
  color: var(--gold);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.1), rgba(0, 0, 0, 0.2));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(255, 215, 0, 0.08);
  font-weight: 600;
}

.nav a span:last-child {
  color: var(--gold-soft);
  font-weight: 700;
  font-size: 12px;
  background: rgba(255, 215, 0, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
}

/* Main Content */
.main {
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--ring);
  border-radius: 999px;
  padding: 8px 16px;
  color: var(--gold);
  background: linear-gradient(180deg, rgba(19, 35, 82, 0.6), rgba(11, 21, 54, 0.6));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.section-title h2,
.section-title h3 {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
}

.stats {
  color: var(--muted);
  font-size: 14px;
}

.content-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Name Card - Odd numbers with gradient background */
.name {
  position: relative;
  padding: 48px 40px;
  border-radius: 32px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  overflow: visible; /* avoid clipping Arabic diacritics */
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 215, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 0 80px rgba(255, 255, 0, 0.03);
  isolation: isolate;
  background: linear-gradient(160deg, var(--night) 0%, var(--night2) 100%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  scroll-margin-top: 120px;
  backdrop-filter: blur(10px);
}

/* Odd number blocks with gradient */
.name.theme-a {
  background: 
    radial-gradient(circle at top right, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
    linear-gradient(160deg, var(--night) 0%, var(--night2) 100%);
  border-color: var(--gold);
}

.name.theme-b {
  background: linear-gradient(160deg, var(--night) 0%, var(--night2) 100%);
  border-color: rgba(255, 255, 255, 0.85);
}

.name:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 30px 100px rgba(0, 0, 0, 0.6),
    inset 0 0 100px rgba(255, 255, 0, 0.04);
  border-color: rgba(255, 215, 0, 0.2);
}

.name.active {
  border-color: var(--ring);
}

.halo {
  display: none;
}

.name-number {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.15);
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-weight: 800;
  font-size: 16px;
  z-index: 10;
}

.ar-name {
  font-family: 'Scheherazade New', 'Amiri', serif;
  text-align: center;
  font-size: clamp(30px, 6vw, 64px);
  color: var(--gold);
  margin: 6px 0 18px;
  line-height: 1.35; /* more headroom for diacritics */
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-soft) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes arabicPulse {
  0%, 100% { 
    transform: scale(1);
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
  }
  50% { 
    transform: scale(1.02);
    filter: drop-shadow(0 6px 16px rgba(255, 215, 0, 0.6));
  }
}

.fr-name {
  text-align: center;
  font-weight: 800;
  font-size: clamp(18px, 2.6vw, 24px);
  letter-spacing: 0.02em;
  color: #fff;
  margin: 0 0 32px;
  line-height: 1.3;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .cards {
    grid-template-columns: 1fr;
  }
  .name {
    padding: 32px 24px;
  }
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 24px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  border-color: rgba(255, 215, 0, 0.2);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.1), 0 12px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.card h4 {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Audio buttons aligned at same level */
.audio-btn {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  color: var(--gold);
  flex-shrink: 0;
  vertical-align: middle;
}

.audio-btn:hover {
  background: rgba(255, 215, 0, 0.25);
  border-color: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

.card .ar {
  font-family: 'Amiri', serif;
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 2;
  color: var(--gold-soft);
  margin-bottom: 16px;
  text-align: right;
  direction: rtl;
}

.card .fr {
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.8;
  font-size: 15px;
  margin-bottom: 16px;
}

.audio-player {
  width: 100%;
  margin-top: auto;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
}

.audio-player audio {
  width: 100%;
  outline: none;
}

.audio-player audio::-webkit-media-controls-panel {
  background: rgba(0, 0, 0, 0.2);
}

.verse-ref {
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.8;
}

.name-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 8px;
}

.name-footer code {
  background: rgba(255, 215, 0, 0.1);
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--gold-soft);
  font-size: 12px;
  font-family: 'Inter', monospace;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

/* Progress Navigation */
.progress {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateX(150%);
  transition: transform 0.5s ease, opacity 0.5s ease;
  opacity: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(10, 20, 41, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.progress.visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.dot:hover {
  background: rgba(255, 215, 0, 0.6);
  transform: scale(1.3);
}

.dot.active {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  border-color: rgba(255, 215, 0, 0.4);
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(217, 184, 90, 0.2));
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 99;
  backdrop-filter: blur(10px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(217, 184, 90, 0.3));
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3);
}

/* Footer */
footer {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 60px;
  font-size: 14px;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 60px 20px 40px;
  }
  
  .main {
    padding: 24px 16px;
  }
  
  .progress {
    display: none;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}



/* FORCE TRESORS TITLE IN PURE BLACK */
.tresors-title {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #000000 !important;
  color: #000000 !important;
}



/* ======= TRESORS SECTION ======= */
.tresors {
  width: 100%;
  padding: 44px 0 56px;
  background: linear-gradient(180deg, #f5f7ff 0%, #e7ecff 100%);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.tresors-inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
  padding: 0 18px;
}
.tresors-title {
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 800;
  color: #000000 !important;
  margin-bottom: 10px;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: #000 !important;
}
.tresors-desc {
  font-size: 17px;
  color: #262e4b;
  max-width: 740px;
  margin: 0 auto 18px;
  line-height: 1.7;
}
.tresors-icons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 15px;
  color: #303959;
  margin-bottom: 24px;
}
.btn-tresors {
  padding: 11px 24px;
  font-size: 16px;
  border-radius: 999px;
}
