:root {
  --bg-dark: #030207;
  --bg-deep: #11010f;
  --line-red: #d3003f;
  --line-red-soft: #ff4d6d;
  --gold: #f6d37a;
  --gold-soft: #b88a35;
  --text-muted: #f6f1e1cc;
  --card-dark: rgba(10, 7, 18, 0.8);
  --card-border: rgba(255, 255, 255, 0.15);
  --shadow-strong: 0 10px 50px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(211, 0, 63, 0.55);
  --transition-fast: 0.25s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Cairo", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, rgba(71, 4, 25, 0.65), transparent),
    radial-gradient(circle at 20% 20%, rgba(150, 15, 33, 0.4), transparent),
    var(--bg-dark);
  color: var(--gold);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 45%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0,
      rgba(255, 255, 255, 0.015) 2px,
      transparent 2px,
      transparent 4px
    );
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.35;
}

.page-hero {
  padding: 3.5rem 1.5rem 2rem;
  text-align: center;
  background: linear-gradient(
      145deg,
      rgba(211, 0, 63, 0.15),
      rgba(5, 2, 10, 0.65)
    ),
    var(--bg-deep);
  box-shadow: var(--shadow-strong);
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
}

.hero-kicker {
  margin: 0;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-hero h1 {
  margin: 0.75rem 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--gold);
  text-shadow: 0 0 20px rgba(246, 211, 122, 0.45);
}

.hero-lead {
  margin: 0 auto;
  max-width: 720px;
  color: var(--text-muted);
  font-size: 1rem;
}

.timeline-wrapper {
  padding: 3rem 1.5rem 4rem;
}

.timeline-container {
  position: relative;
  overflow-x: auto;
  padding: 4rem 2rem;
  background: rgba(4, 3, 10, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
}

#timeline-line {
  position: relative;
  height: 6px;
  margin-top: 90px;
  background: linear-gradient(90deg, var(--line-red), var(--line-red-soft));
  border-radius: 999px;
  box-shadow: 0 0 35px rgba(255, 61, 99, 0.65);
}

#timeline-events {
  position: relative;
  display: flex;
  gap: 4rem;
  padding: 3rem 0 1rem;
}

.main-event {
  position: relative;
  min-width: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  animation: fadeInUp 0.8s ease both;
}

.main-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold), var(--gold-soft));
  border: 3px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-glow),
    0 0 35px rgba(246, 211, 122, 0.45) inset;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.main-circle::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: pulseGlow 3s ease-in-out infinite;
}

.main-circle span {
  font-size: 1rem;
  font-weight: 600;
  color: #1a0b08;
}

.main-circle:hover,
.main-circle:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(255, 214, 149, 0.8),
    0 0 35px rgba(255, 103, 129, 0.45) inset;
}

.main-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(246, 211, 122, 0.35);
}

.sub-events {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.sub-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff7c7c, #ff003a);
  box-shadow: 0 0 12px rgba(255, 0, 58, 0.6);
  cursor: pointer;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.sub-dot:hover,
.sub-dot:focus-visible {
  transform: scale(1.3);
  box-shadow: 0 0 18px rgba(255, 129, 150, 0.85);
}

.sub-cards {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  max-width: 340px;
  font-family: "Cairo", "Segoe UI", system-ui, sans-serif;
}

.sub-card {
  background: rgba(18, 13, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: border-color var(--transition-fast),
    transform var(--transition-fast);
}

.sub-card.expanded {
  border-color: rgba(255, 204, 0, 0.35);
  transform: translateY(-2px);
}

.sub-card-header {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  padding: 0.85rem 1.1rem;
  text-align: start;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.sub-card-header span {
  font-size: 1.1rem;
  color: var(--line-red-soft);
}

.sub-card-header .sub-card-toggle {
  font-size: 1.4rem;
  color: var(--line-red);
}

.sub-card-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  line-height: 1.6;
  transition: max-height 0.4s ease, padding-bottom 0.3s ease;
}

.sub-card.expanded .sub-card-body {
  max-height: 320px;
  padding-bottom: 0.95rem;
}

.sub-card-body strong {
  color: var(--gold);
  font-weight: 600;
}

.sub-card-body em {
  color: var(--line-red-soft);
  font-style: normal;
}

.sub-card-body .sub-hadith {
  margin-top: 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.18);
  color: var(--gold);
  font-size: 0.88rem;
  line-height: 1.7;
}

.sub-card-body small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.popup {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 0, 5, 0.85);
  backdrop-filter: blur(8px);
  z-index: 20;
  padding: 1.5rem;
}

.popup.show {
  display: flex;
  animation: fadeIn 0.35s ease;
}

.popup-content {
  width: min(700px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  border-radius: 24px;
  background: rgba(10, 8, 22, 0.95);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-strong);
  animation: popupReveal 0.45s ease;
}

.popup,
.popup * {
  font-family: "Cairo", "Segoe UI", system-ui, sans-serif;
}

.popup-close {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1.25rem;
  border: none;
  background: transparent;
  color: var(--gold);
  font-size: 1.8rem;
  cursor: pointer;
}

.popup h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--gold);
}

.popup p {
  margin-top: 0;
  color: var(--text-muted);
}

.popup-media {
  margin-top: 1.25rem;
}

.popup-hadith {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.25);
  color: var(--gold);
  font-size: 0.95rem;
  line-height: 1.8;
  box-shadow: 0 0 25px rgba(255, 214, 149, 0.1);
}

.popup-hadith cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.popup-media img,
.popup-media iframe {
  width: 100%;
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
}

.popup-media audio {
  width: 100%;
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .timeline-container {
    padding: 2.5rem 1rem;
  }

  #timeline-events {
    gap: 2rem;
  }

  .main-event {
    min-width: 180px;
  }

  .main-circle {
    width: 120px;
    height: 120px;
  }

  .sub-cards {
    max-width: 100%;
  }

  .sub-card-body {
    font-size: 0.88rem;
  }
}

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

@keyframes pulseGlow {
  0% {
    opacity: 0.4;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.9;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.4;
    transform: scale(0.95);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popupReveal {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.timeline-container::-webkit-scrollbar {
  height: 10px;
}

.timeline-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.timeline-container::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--line-red), var(--line-red-soft));
  border-radius: 999px;
}
