@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;500;600;700;800&display=swap');

:root {
  --gold: #D4A574;
  --gold-dark: #C8956E;
  --gold-light: #E8C9A8;
  --teal: #1B6B8A;
  --teal-dark: #145B76;
  --teal-light: #2A8BAF;
  --green: #1A4D2E;
  --green-dark: #0F3A1F;
  --green-light: #2D7A47;
  --cream: #FAF3E8;
  --cream-dark: #F0E4D1;
  --text: #2C1810;
  --text-sec: #5A4234;
  --bg-dark: #0A1628;
  --bg-card: rgba(255, 255, 255, 0.95);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
}

/* ===== ISLAMIC GEOMETRIC SVG PATTERN ===== */
.islamic-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M40 0L50 10L40 20L30 10Z' fill='%23D4A574'/%3E%3Cpath d='M0 40L10 30L20 40L10 50Z' fill='%23D4A574'/%3E%3Cpath d='M40 40L50 30L60 40L50 50Z' fill='%23D4A574'/%3E%3Cpath d='M80 40L70 30L60 40L70 50Z' fill='%23D4A574'/%3E%3Cpath d='M40 80L50 70L40 60L30 70Z' fill='%23D4A574'/%3E%3Ccircle cx='40' cy='40' r='3' fill='none' stroke='%23D4A574' stroke-width='0.5'/%3E%3C/svg%3E");
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(20px);
  padding: 0 5%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 165, 116, 0.15);
  transition: all 0.4s;
}

.navbar.scrolled {
  background: rgba(10, 22, 40, 0.98);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid var(--gold);
}

.nav-brand span {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(212, 165, 116, 0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(10, 22, 40, 0.82) 0%, rgba(13, 33, 55, 0.80) 40%, rgba(15, 58, 31, 0.78) 100%),
    url('images/aqsa.jpg') center/cover no-repeat;
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
  padding: 120px 5% 80px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--cream), transparent);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
}

.hero-icon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  border: 3px solid var(--gold);
  margin: 0 auto 30px;
  box-shadow: 0 0 60px rgba(212, 165, 116, 0.3);
  animation: float 4s ease-in-out infinite;
}

.hero h1 {
  font-family: 'Amiri', serif;
  font-size: 3.8rem;
  color: var(--gold);
  margin-bottom: 8px;
  text-shadow: 0 0 40px rgba(212, 165, 116, 0.4);
  line-height: 1.3;
}

.hero h2 {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  margin-bottom: 40px;
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.65);
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.9;
}

/* Code Entry */
.code-entry {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 165, 116, 0.25);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  margin: 0 auto 40px;
  backdrop-filter: blur(10px);
}

.code-entry h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 15px;
}

.code-input-wrap {
  display: flex;
  gap: 10px;
}

.code-input-wrap input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 12px;
  border: 2px solid rgba(212, 165, 116, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1rem;
  font-family: 'Cairo';
  outline: none;
  transition: border 0.3s;
  text-align: center;
  letter-spacing: 2px;
}

.code-input-wrap input:focus {
  border-color: var(--gold);
}

.code-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0;
}

.btn-gold {
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo';
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(212, 165, 116, 0.5);
}

/* Download Buttons */
.download-btns {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  border: 2px solid;
}

.dl-btn.android {
  background: rgba(45, 122, 71, 0.15);
  border-color: var(--green-light);
  color: var(--green-light);
}

.dl-btn.windows {
  background: rgba(27, 107, 138, 0.15);
  border-color: var(--teal-light);
  color: var(--teal-light);
}

.dl-btn.web {
  background: rgba(212, 165, 116, 0.15);
  border-color: var(--gold);
  color: var(--gold);
}

.dl-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.dl-btn i {
  font-size: 1.3rem;
}

/* ===== SECTIONS ===== */
section {
  padding: 100px 5%;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-family: 'Amiri', serif;
  font-size: 2.6rem;
  color: var(--green);
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-sec);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-header .ornament {
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 15px auto 0;
  border-radius: 2px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ===== STORY TIMELINE ===== */
#story {
  background: linear-gradient(180deg, rgba(250, 243, 232, 0.92) 0%, rgba(255, 255, 255, 0.92) 100%),
    url('images/kaaba.jpg') center/cover no-repeat;
  background-attachment: fixed;
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  right: 50%;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--teal));
  top: 0;
  bottom: 0;
  transform: translateX(50%);
  border-radius: 3px;
}

.timeline-item {
  display: flex;
  align-items: center;
  margin-bottom: 50px;
  position: relative;
}

.timeline-item:nth-child(odd) {
  flex-direction: row-reverse;
}

.timeline-dot {
  width: 18px;
  height: 18px;
  background: var(--gold);
  border-radius: 50%;
  border: 4px solid var(--cream);
  position: absolute;
  right: calc(50% - 9px);
  z-index: 2;
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.4);
}

.timeline-card {
  width: 42%;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 25px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(212, 165, 116, 0.15);
  transition: transform 0.3s;
}

.timeline-card:hover {
  transform: translateY(-4px);
}

.timeline-card h3 {
  color: var(--teal);
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.timeline-card .year {
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.timeline-card p {
  color: var(--text-sec);
  font-size: 0.95rem;
}

/* ===== PILLARS ===== */
#pillars {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0D2137 100%);
}

#pillars .section-header h2,
#pillars .section-header p {
  color: var(--cream);
}

.pillar-group {
  margin-bottom: 60px;
}

.pillar-group h3 {
  font-family: 'Amiri', serif;
  color: var(--gold);
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 10px;
}

.pillar-group>p {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 165, 116, 0.15);
  border-radius: var(--radius);
  padding: 25px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(212, 165, 116, 0.35);
  background: rgba(255, 255, 255, 0.08);
}

.card h4 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.card p,
.card li {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.card i {
  color: var(--gold);
  font-size: 1.8rem;
  margin-bottom: 12px;
  display: block;
}

.card-book {
  display: flex;
  gap: 15px;
  align-items: stretch;
}

.card-book img {
  width: 90px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(212, 165, 116, 0.3);
  flex-shrink: 0;
}

.card-book-info {
  display: flex;
  flex-direction: column;
}

.card-book-info h4 {
  margin-bottom: 4px;
}

.card-book-info .btn-book-dl {
  margin-top: auto;
}

.btn-book-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 7px 16px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Cairo';
  transition: all 0.3s;
}

.btn-book-dl:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 165, 116, 0.4);
}

.btn-book-dl i {
  font-size: 0.85rem;
  margin-bottom: 0;
  display: inline;
  color: #fff;
}

/* ===== CURRICULUM ===== */
#curriculum {
  background: #fff;
}

.curriculum-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.tab-btn {
  padding: 12px 24px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold-dark);
  border-radius: 50px;
  font-family: 'Cairo';
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn.active,
.tab-btn:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(212, 165, 116, 0.3);
}

.tab-content {
  display: none;
  animation: fadeUp 0.5s;
}

.tab-content.active {
  display: block;
}

.level-header {
  background: linear-gradient(135deg, var(--green) 0%, var(--teal) 100%);
  color: #fff;
  padding: 20px 30px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.level-header h3 {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.level-header span {
  opacity: 0.8;
  font-size: 0.9rem;
}

.chapter {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 2px;
}

.chapter-title {
  padding: 15px 25px;
  background: rgba(212, 165, 116, 0.08);
  font-weight: 700;
  color: var(--green);
  font-size: 1.05rem;
  border-right: 4px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chapter-title span {
  font-size: 0.85rem;
  color: var(--teal);
  font-weight: 500;
}

.lesson-row {
  display: flex;
  align-items: center;
  padding: 12px 25px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: background 0.2s;
  gap: 15px;
}

.lesson-row:hover {
  background: rgba(212, 165, 116, 0.04);
}

.lesson-num {
  min-width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.lesson-info {
  flex: 1;
}

.lesson-info h5 {
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.lesson-info p {
  color: var(--text-sec);
  font-size: 0.82rem;
}

.grammar-note {
  padding: 10px 25px;
  background: rgba(27, 107, 138, 0.06);
  color: var(--teal);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.level-footer {
  padding: 15px 25px;
  background: rgba(26, 77, 46, 0.04);
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-top: none;
}

/* ===== DOWNLOAD SECTION ===== */
#download {
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
}

.download-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  max-width: 900px;
  margin: 0 auto;
}

.download-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 35px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

.download-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.download-card i {
  font-size: 3rem;
  margin-bottom: 15px;
}

.download-card.android-card i {
  color: var(--green-light);
}

.download-card.windows-card i {
  color: var(--teal);
}

.download-card.web-card i {
  color: var(--gold-dark);
}

.download-card h3 {
  color: var(--text);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.download-card p {
  color: var(--text-sec);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.download-card .btn-dl {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  transition: all 0.3s;
}

.download-card.android-card .btn-dl {
  background: linear-gradient(135deg, var(--green-light), var(--green));
}

.download-card.windows-card .btn-dl {
  background: linear-gradient(135deg, var(--teal-light), var(--teal));
}

.download-card.web-card .btn-dl {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}

.download-card .btn-dl:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 50px 5% 30px;
  text-align: center;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal), var(--green), var(--teal), var(--gold));
}

.footer h3 {
  font-family: 'Amiri', serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.footer p {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.footer .copy {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ===== ANIMATIONS ===== */
@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    left: 0;
    background: rgba(10, 22, 40, 0.98);
    flex-direction: column;
    padding: 20px;
    gap: 5px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero h2 {
    font-size: 1.1rem;
  }

  .hero-icon {
    width: 80px;
    height: 80px;
  }

  .code-input-wrap {
    flex-direction: column;
  }

  .timeline::before {
    right: 20px;
  }

  .timeline-dot {
    right: 11px;
  }

  .timeline-item,
  .timeline-item:nth-child(odd) {
    flex-direction: row;
    justify-content: flex-start;
    padding-right: 50px;
  }

  .timeline-card {
    width: 100%;
  }

  section {
    padding: 60px 5%;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .curriculum-tabs {
    gap: 5px;
  }

  .tab-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}