/* ======================================================
   ضياء — بطاقات الأذكار  |  Athkar Cards Website
   Design System & Styles
   Mobile-first  •  RTL  •  Premium Dark Navy Theme
   ====================================================== */

/* =====================
   0. CUSTOM PROPERTIES
   ===================== */
:root {
  /* Backgrounds — deep navy from the original design */
  --bg-page: #141825;
  --bg-page-gradient: linear-gradient(
    170deg,
    #141825 0%,
    #171c2e 40%,
    #131722 70%,
    #101420 100%
  );
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(20, 24, 37, 0.75);

  /* Card theme — teal/emerald from the actual morning pass backgroundColor */
  --card-bg: linear-gradient(175deg, #1a3d35 0%, #2a5a50 40%, #1e4a40 70%, #153530 100%);

  /* Accents */
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.15);
  --gold-glow: rgba(212, 175, 55, 0.08);
  --teal: #7ecdb8;
  --teal-soft: rgba(126, 205, 184, 0.15);
  --teal-glow: rgba(126, 205, 184, 0.06);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted: rgba(255, 255, 255, 0.35);

  /* Typography */
  --font-display: 'Amiri', serif;
  --font-body: 'Noto Naskh Arabic', serif;
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-out);
  --transition-normal: 0.4s var(--ease-out);
  --transition-slow: 0.7s var(--ease-out);
}

/* =====================
   0b. FONT LOADING
   ===================== */
@font-face {
  font-family: 'MushafAlMadinah';
  src: url('UthmanicHafs.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* =====================
   1. RESET & BASE
   ===================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg-page);
  background-image: var(--bg-page-gradient);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

/* =====================
   2. BACKGROUND PATTERN
   ===================== */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='0.5' opacity='0.12'%3E%3Cpolygon points='40,10 46.18,26.18 33.82,26.18'/%3E%3Cpolygon points='40,70 46.18,53.82 33.82,53.82'/%3E%3Cpolygon points='10,40 26.18,33.82 26.18,46.18'/%3E%3Cpolygon points='70,40 53.82,33.82 53.82,46.18'/%3E%3Cline x1='33.82' y1='26.18' x2='26.18' y2='33.82'/%3E%3Cline x1='46.18' y1='26.18' x2='53.82' y2='33.82'/%3E%3Cline x1='33.82' y1='53.82' x2='26.18' y2='46.18'/%3E%3Cline x1='46.18' y1='53.82' x2='53.82' y2='46.18'/%3E%3Cpolygon points='33.82,26.18 46.18,26.18 53.82,33.82 53.82,46.18 46.18,53.82 33.82,53.82 26.18,46.18 26.18,33.82'/%3E%3Cline x1='40' y1='0' x2='40' y2='10'/%3E%3Cline x1='40' y1='70' x2='40' y2='80'/%3E%3Cline x1='0' y1='40' x2='10' y2='40'/%3E%3Cline x1='70' y1='40' x2='80' y2='40'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 80px 80px;
}

/* Ambient glow overlays */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-glow::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.bg-glow::after {
  content: '';
  position: absolute;
  bottom: 10%;
  left: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(160, 200, 170, 0.04) 0%, transparent 70%);
  border-radius: 50%;
}

/* =====================
   3. LAYOUT CONTAINER
   ===================== */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* =====================
   4. HERO SECTION
   ===================== */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
}

.hero-ornament {
  font-size: 18px;
  color: var(--gold);
  opacity: 0.5;
  margin-bottom: var(--space-lg);
  letter-spacing: 12px;
  animation: fadeInDown 1s var(--ease-out) 0.2s both;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 60px rgba(212, 175, 55, 0.2);
  animation: fadeInUp 1s var(--ease-out) 0.3s both;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  animation: fadeInUp 1s var(--ease-out) 0.45s both;
}

.hero-ayahs {
  font-family: 'KFGQPC HAFS Uthmanic Script', 'MushafAlMadinah', var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: rgba(212, 175, 55, 0.95);
  line-height: 1.85;
  /* Helps browsers apply the font's joining/diacritics behavior more consistently */
  font-variant-ligatures: contextual;
  font-feature-settings: "liga" 1, "calt" 1, "rlig" 1;
  margin-top: var(--space-xs);
  margin-bottom: var(--space-sm);
  text-shadow: 0 0 25px rgba(212, 175, 55, 0.12);
  padding: 0 var(--space-md);
  direction: rtl;
  text-align: center;
  animation: fadeInUp 1s var(--ease-out) 0.4s both;
}

.hero-ayah {
  margin: 0 auto;
  max-width: 38rem;
}

.hero-tagline {
  font-family: var(--font-system);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  margin-bottom: var(--space-lg);
  direction: ltr;
  animation: fadeInUp 1s var(--ease-out) 0.55s both;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  max-width: 340px;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 1s var(--ease-out) 0.6s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 16px 40px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  transition: all var(--transition-fast);
  animation: fadeInUp 1s var(--ease-out) 0.7s both;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(212, 175, 55, 0.08);
}

.hero-cta:active {
  transform: scale(0.96);
}

.hero-cta:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 4px 40px rgba(212, 175, 55, 0.15);
}

.hero-cta svg {
  width: 20px;
  height: 20px;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-system);
  animation: fadeInUp 1s var(--ease-out) 1s both;
}

.scroll-hint .arrow {
  width: 20px;
  height: 20px;
  border-left: 1.5px solid rgba(212, 175, 55, 0.4);
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.4);
  transform: rotate(-45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(-45deg) translateY(0); }
  50% { transform: rotate(-45deg) translateY(6px); }
}

/* =====================
   5. SECTION SHARED
   ===================== */
.section {
  padding: var(--space-2xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-ornament {
  color: var(--gold);
  opacity: 0.4;
  font-size: 14px;
  letter-spacing: 8px;
  margin-bottom: var(--space-md);
  display: block;
}

.section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.8;
}

/* =====================
   6. DOWNLOAD CARD
   ===================== */
.download-section {
  padding-top: var(--space-xl);
}

.download-card {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 80px rgba(212, 175, 55, 0.03);
}

.download-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

/* Card Preview (Wallet-like) — keeps teal to match actual wallet card */
.download-card-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgb(42, 90, 80);
  background-image: url('preview-card.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  aspect-ratio: 750 / 568;
}

.download-card-bg, .download-card-preview .islamic-pattern, .download-card-preview .card-frame {
  display: none;
}

.download-card-content {
  display: none;
}

.card-brand-text {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: rgba(242, 245, 243, 0.95);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.card-category-badge {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 5px 20px 6px;
  border-radius: 20px;
  border: 1px solid rgba(242, 245, 243, 0.2);
  background: rgba(242, 245, 243, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: rgba(242, 245, 243, 0.95);
}

.card-count-badge {
  font-family: var(--font-system);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 14px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.25);
  color: var(--gold);
  margin-top: var(--space-xs);
}

/* Card body */
.download-card-body {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: var(--space-lg) var(--space-lg) var(--space-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.download-card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: var(--space-sm);
}

.download-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-md);
}

.download-card-quote {
  font-family: var(--font-display);
  font-size: 17px;
  color: rgba(212, 175, 55, 0.95); /* prominent gold */
  text-align: center;
  margin-bottom: var(--space-xl);
  line-height: 1.8;
  padding: 0 var(--space-md);
}

/* Download Button — gold to match website identity */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  transition: all var(--transition-fast);
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
  color: var(--gold);
  cursor: pointer;
  text-decoration: none;
}

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

.download-btn:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 4px 30px rgba(212, 175, 55, 0.12);
}

.download-btn .wallet-icon {
  width: 22px;
  height: 22px;
}

.download-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-family: var(--font-system);
}

/* =====================
   7. HOW-TO SECTION
   ===================== */
.howto-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.howto-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.howto-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.howto-step:nth-child(2).visible { transition-delay: 0.1s; }
.howto-step:nth-child(3).visible { transition-delay: 0.2s; }

/* Screenshot area */
.step-image-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: var(--space-lg) var(--space-lg) 0;
}

.step-phone-frame {
  position: relative;
  width: 180px;
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.step-screenshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.step-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: var(--space-sm);
}

.step-placeholder-icon {
  font-size: 28px;
  opacity: 0.5;
}

.step-placeholder-text {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
}

/* Text area below screenshot */
.step-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  width: 100%;
}

.step-number {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-system);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  border: 1.5px solid rgba(212, 175, 55, 0.3);
  background: var(--gold-glow);
}

.step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.step-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Secondary CTA */
.secondary-cta {
  margin-top: var(--space-xl);
  opacity: 0;
  transform: translateY(20px);
}

.secondary-cta.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.download-btn-secondary {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.08));
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--gold);
}

.download-btn-secondary:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: 0 4px 30px rgba(212, 175, 55, 0.12);
}

/* =====================
   10. FOOTER
   ===================== */
.site-footer {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg) var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.6;
  margin-bottom: var(--space-sm);
}

.footer-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.footer-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  color: rgba(212, 175, 55, 0.3);
  font-size: 10px;
}

.footer-divider::before,
.footer-divider::after {
  content: '';
  width: 40px;
  height: 0.5px;
  background: rgba(212, 175, 55, 0.2);
}

.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-system);
  direction: ltr;
}

/* =====================
   11. ANIMATIONS
   ===================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================
   12. RESPONSIVE
   ===================== */

/* Tablets */
@media (min-width: 768px) {
  .container {
    max-width: 600px;
  }

  .hero-brand {
    font-size: 96px;
  }

  .hero-subtitle {
    font-size: 26px;
  }

  .hero-ayahs {
    font-size: 18px;
  }

  .hero-desc {
    font-size: 16px;
    max-width: 400px;
  }

  .section-title {
    font-size: 38px;
  }

  .download-card {
    max-width: 420px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .container {
    max-width: 800px;
  }

  .howto-steps {
    flex-direction: row;
    gap: var(--space-lg);
  }

  .howto-step {
    flex: 1;
  }

  .step-info {
    flex-direction: column;
    text-align: center;
  }
}

/* Safe area (iPhone notch) */
@supports (padding-top: env(safe-area-inset-top)) {
  .hero {
    padding-top: calc(var(--space-2xl) + env(safe-area-inset-top));
  }

  .site-footer {
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom));
  }
}
