/* ============================================================
   صدقة جارية — محمد سراج الدين زايد رحمه الله
   Design System & Complete Styles
   ============================================================ */

:root {
  /* Colors */
  --bg-dark: #07070b;
  --bg-darker: #040407;
  --bg-section-alt: #0a0a14;
  --gold-primary: #d4a843;
  --gold-secondary: #c9973e;
  --gold-light: #f5d78a;
  --emerald-primary: #1a6b4a;
  --emerald-secondary: #2d9d6f;
  --text-main: #f0f0f0;
  --text-muted: #b0b0b0;
  
  /* Glassmorphism */
  --glass-bg: rgba(15, 15, 22, 0.65);
  --glass-border: rgba(212, 168, 67, 0.15);
  
  /* Typography */
  --font-heading: 'Amiri', serif;
  --font-quran: 'Amiri Quran', serif;
  --font-body: 'Noto Sans Arabic', sans-serif;
  
  /* Layout & Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 16px;
  --border-radius-lg: 24px;
}

/* ============================================================
   Base Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
  /* Islamic Geometric Pattern Background */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4a843' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--gold-primary);
}

.quran-text {
  font-family: var(--font-quran);
  font-size: 2rem;
  line-height: 2.4;
  color: var(--gold-light);
  text-align: center;
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb {
  background: var(--gold-secondary);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-primary); }

/* ============================================================
   Layout
   ============================================================ */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 5rem 0;
  position: relative;
  min-height: auto;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 2.5rem;
  position: relative;
  display: block;
  width: 100%;
}

.section-title::after {
  content: '';
  display: block;
  margin: 10px auto 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

/* ============================================================
   Glassmorphism Card
   ============================================================ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  padding: 2.5rem 2rem;
  transition: var(--transition);
}

.glass-card:hover {
  box-shadow: 0 12px 48px 0 rgba(212, 168, 67, 0.08);
  border-color: rgba(212, 168, 67, 0.25);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  color: var(--bg-darker);
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(212, 168, 67, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
}

.btn-emerald {
  background: linear-gradient(135deg, var(--emerald-primary), var(--emerald-secondary));
  color: white;
  box-shadow: 0 4px 15px rgba(26, 107, 74, 0.3);
}

.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 107, 74, 0.4);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gold-primary);
  color: var(--gold-primary);
}

.btn-outline:hover {
  background: var(--gold-primary);
  color: var(--bg-darker);
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0.4); }
  70% { box-shadow: 0 0 0 18px rgba(212, 168, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.animate-up {
  animation: fadeInUp 0.8s ease forwards;
}

/* ============================================================
   Navigation
   ============================================================ */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(4, 4, 7, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0.75rem 0;
}

nav.scrolled {
  background: rgba(4, 4, 7, 0.97);
}

nav .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  transition: var(--transition);
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  right: 0;
  background-color: var(--gold-primary);
  transition: width 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Hamburger — hidden on desktop */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold-primary);
  margin: 6px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger-btn.active span:nth-child(2) { opacity: 0; }
.hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* ============================================================
   Hero Section
   ============================================================ */
#hero {
  text-align: center;
  padding-top: 6rem;
  padding-bottom: 4rem;
  background: radial-gradient(circle at center, rgba(212, 168, 67, 0.08) 0%, transparent 60%);
}

.hero-frame {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
  animation: float 6s ease-in-out infinite;
}

.hero-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-dark);
}

.bismillah {
  font-family: var(--font-quran);
  font-size: 2rem;
  color: var(--gold-primary);
  margin-bottom: 1.5rem;
}

.hero-name {
  font-size: 2.8rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 20px rgba(212, 168, 67, 0.2);
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.hero-date {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-dua {
  font-family: var(--font-quran);
  font-size: 1.5rem;
  max-width: 550px;
  margin: 0 auto;
  line-height: 2;
  color: var(--gold-light);
}

/* ============================================================
   Fatiha Section
   ============================================================ */
#fatiha .glass-card {
  position: relative;
  overflow: hidden;
  text-align: center;
}

#fatiha .glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid var(--gold-primary);
  opacity: 0.2;
  margin: 12px;
  border-radius: var(--border-radius);
  pointer-events: none;
}

.fatiha-text {
  margin: 2rem auto;
  text-align: center;
  max-width: 700px;
  line-height: 2.8;
  font-size: 1.8rem;
}

.fatiha-stats {
  font-size: 1.2rem;
  color: var(--gold-light);
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

/* ============================================================
   Duas Section
   ============================================================ */
#duas {
  background: var(--bg-section-alt);
}

.duas-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.dua-card {
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.dua-icon {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.dua-text {
  font-family: var(--font-quran);
  font-size: 1.15rem;
  line-height: 2.2;
  color: var(--gold-light);
}

.dua-source {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 0.5rem;
}

/* ============================================================
   Istighfar Section
   ============================================================ */
#istighfar {
  text-align: center;
}

.counter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.counter-display {
  font-size: 4.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(212, 168, 67, 0.3);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.istighfar-btn {
  font-size: 1.3rem;
  padding: 1.25rem 2.5rem;
  border-radius: 50px;
  animation: pulseGlow 2s infinite;
}

.tasbih-toggle {
  margin-top: 0.5rem;
  font-size: 1rem;
  padding: 0.5rem 1.5rem;
}

.personal-counter {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  width: 100%;
}

.personal-counter.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: fadeInUp 0.4s ease;
}

/* ============================================================
   Video Section
   ============================================================ */
.video-wrapper {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
  background: #000;
  display: flex;
  justify-content: center;
}

.video-wrapper video {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

/* ============================================================
   Quran Reader Section
   ============================================================ */
#quran-reader {
  background: var(--bg-section-alt);
}

.khatma-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  font-family: var(--font-heading);
  color: var(--text-main);
}

.progress-container {
  width: 100%;
  height: 10px;
  background: var(--bg-darker);
  border-radius: 5px;
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-primary), var(--emerald-secondary), var(--gold-primary));
  width: 0%;
  transition: width 1s ease;
  border-radius: 5px;
}

.book-container {
  background: #fefbf5;
  border-radius: 8px;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.3),
    inset 0 0 30px rgba(0,0,0,0.03);
  color: #333;
  padding: 1rem;
  min-height: 60vh;
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#quran-page-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.page-number {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold-secondary);
  border: 1px solid var(--gold-secondary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.reader-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

/* ============================================================
   Donate Section
   ============================================================ */
.donate-options {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.donate-btn {
  font-size: 1.3rem;
  padding: 1.2rem 3rem;
  border-radius: 50px;
  animation: pulseGlow 2.5s infinite;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--glass-border);
  padding: 2.5rem 0;
  text-align: center;
  font-family: var(--font-heading);
}

.footer-dua {
  font-size: 1.3rem;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
}

.footer-info {
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

/* ============================================================
   Responsive — Tablet (≤768px)
   ============================================================ */
@media (max-width: 768px) {
  .nav-links {
    gap: 0.75rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .hero-name {
    font-size: 2.2rem;
  }

  .hero-dua {
    font-size: 1.2rem;
  }

  .bismillah {
    font-size: 1.6rem;
  }

  .quran-text {
    font-size: 1.4rem;
    line-height: 2.2;
  }

  .fatiha-text {
    font-size: 1.4rem;
    line-height: 2.4;
  }

  .counter-display {
    font-size: 3.5rem;
  }

  .istighfar-btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
  }

  .khatma-stats {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .duas-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .dua-text {
    font-size: 1.05rem;
  }

  .glass-card {
    padding: 2rem 1.25rem;
  }

  section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.8rem;
    margin-bottom: 2rem;
  }

  .book-container {
    min-height: 50vh;
    padding: 0.75rem;
  }

  #quran-page-img {
    max-height: 70vh;
  }

  .donate-btn {
    font-size: 1.1rem;
    padding: 1rem 2.5rem;
  }
}

/* ============================================================
   Responsive — Mobile (≤480px)
   ============================================================ */
@media (max-width: 480px) {
  .hamburger-btn {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(4, 4, 7, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    gap: 0;
  }

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

  .nav-links li {
    text-align: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
  }

  .nav-links a {
    font-size: 1.05rem;
  }

  .container {
    padding: 0 1rem;
  }

  #hero {
    padding-top: 5rem;
  }

  .hero-frame {
    width: 140px;
    height: 140px;
  }

  .hero-name {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-dua {
    font-size: 1.1rem;
  }

  .bismillah {
    font-size: 1.3rem;
  }

  .quran-text {
    font-size: 1.2rem;
    line-height: 2;
  }

  .fatiha-text {
    font-size: 1.2rem;
    line-height: 2.2;
  }

  .counter-display {
    font-size: 3rem;
  }

  .istighfar-btn {
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
  }

  .section-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  .glass-card {
    padding: 1.5rem 1rem;
    border-radius: var(--border-radius);
  }

  section {
    padding: 3rem 0;
  }

  .reader-controls {
    gap: 0.5rem;
  }

  .reader-controls .btn {
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
  }

  .book-container {
    min-height: 40vh;
    padding: 0.5rem;
  }

  #quran-page-img {
    max-height: 65vh;
  }

  .dua-card {
    padding: 1.5rem 1rem;
  }

  .dua-text {
    font-size: 1rem;
    line-height: 2;
  }

  .donate-btn {
    font-size: 1rem;
    padding: 0.9rem 2rem;
    width: 100%;
  }

  .donate-options {
    flex-direction: column;
    align-items: stretch;
  }

  .khatma-stats {
    font-size: 0.95rem;
  }

  .footer-dua {
    font-size: 1.1rem;
  }
}
