/* ============================================
   QURANIC SEEKERS — Design System v1.0
   Premium Online Quran Academy
   Mobile-First | 60-30-10 Color Rule
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  /* ---- Colors: 60-30-10 Rule ---- */
  /* 60% — Backgrounds */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8FAFB;
  --color-bg-dark: #003B46;
  --color-bg-darker: #002A32;

  /* 30% — Primary */
  --color-primary: #003B46;
  --color-primary-hover: #07575B;
  --color-primary-light: rgba(0, 59, 70, 0.08);
  --color-primary-lighter: rgba(0, 59, 70, 0.04);

  /* 10% — Accent (Gold) */
  --color-accent: #C8971F;
  --color-accent-hover: #B5881B;
  --color-accent-light: rgba(200, 151, 31, 0.1);
  --color-accent-lighter: rgba(200, 151, 31, 0.05);

  /* Supporting */
  --color-soft-blue: #66A5AD;
  --color-soft-blue-light: rgba(102, 165, 173, 0.1);

  /* Text */
  --color-heading: #0F172A;
  --color-paragraph: #475569;
  --color-text-light: #94A3B8;
  --color-text-muted: #CBD5E1;
  --color-text-white: #FFFFFF;

  /* UI */
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;
  --color-success: #22C55E;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;

  /* Overlays */
  --overlay-light: rgba(0, 15, 20, 0.25);
  --overlay-dark: rgba(0, 15, 20, 0.35);
  --overlay-darker: rgba(0, 15, 20, 0.55);

  /* ---- Typography ---- */
  --font-family: 'Figtree', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.625rem;
  --text-5xl: 3.5rem;

  /* ---- Spacing ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* ---- Border Radius ---- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* ---- Shadows ---- */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-gold: 0 4px 20px rgba(200, 151, 31, 0.25);

  /* ---- Transitions ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-fast: 150ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
  --transition-slower: 700ms var(--ease-out);

  /* ---- Z-Index Scale ---- */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-overlay: 400;
  --z-modal: 500;
  --z-toast: 600;

  /* ---- Layout ---- */
  --container-max: 1280px;
  --container-padding: 1.25rem;
  --header-height: 88px;
  --announcement-height: 40px;
  --section-padding-y: 4rem;
}

/* Responsive overrides */
@media (min-width: 768px) {
  :root {
    --container-padding: 2rem;
    --header-height: 104px;
    --section-padding-y: 6rem;
  }
}
@media (min-width: 1024px) {
  :root {
    --section-padding-y: 7.5rem;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-paragraph);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, video, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-base);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul, ol { list-style: none; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button { cursor: pointer; }

table {
  border-collapse: collapse;
  width: 100%;
}

::selection {
  background: var(--color-primary);
  color: var(--color-text-white);
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1, .h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}
h2, .h2 {
  font-size: var(--text-2xl);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h3, .h3 {
  font-size: var(--text-xl);
  line-height: 1.3;
}
h4, .h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.4;
}
h5, .h5 {
  font-size: var(--text-base);
  font-weight: 600;
}

/* Desktop typography */
@media (min-width: 768px) {
  h1, .h1 { font-size: var(--text-4xl); }
  h2, .h2 { font-size: var(--text-3xl); }
  h3, .h3 { font-size: var(--text-2xl); }
  h4, .h4 { font-size: var(--text-xl); }
  body { font-size: var(--text-lg); line-height: 1.8; }
}
@media (min-width: 1024px) {
  h1, .h1 { font-size: var(--text-5xl); }
  h2, .h2 { font-size: var(--text-4xl); }
  h3, .h3 { font-size: var(--text-3xl); }
  h4, .h4 { font-size: var(--text-2xl); }
}

p {
  margin-bottom: var(--space-4);
  color: var(--color-paragraph);
}
p:last-child { margin-bottom: 0; }

.lead {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--color-paragraph);
}
@media (min-width: 768px) {
  .lead { font-size: var(--text-xl); }
}

strong { font-weight: 600; color: var(--color-heading); }

/* ============================================
   Container & Section Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-sm {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-lg {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section {
  padding: var(--section-padding-y) 0;
  position: relative;
}

.section-alt {
  background-color: var(--color-bg-alt);
}

.section-dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-white);
}
.section-dark h1, .section-dark h2,
.section-dark h3, .section-dark h4 {
  color: var(--color-text-white);
}
.section-dark p {
  color: rgba(255, 255, 255, 0.8);
}

/* Section Header (centered title block) */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto var(--space-12);
}
@media (min-width: 768px) {
  .section-header {
    margin-bottom: var(--space-16);
  }
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-base);
  color: var(--color-paragraph);
  max-width: 580px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .section-header p {
    font-size: var(--text-lg);
  }
}

/* ============================================
   Grid System (mobile-first)
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: var(--space-8); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays */
.scroll-reveal[data-delay="100"] { transition-delay: 100ms; }
.scroll-reveal[data-delay="200"] { transition-delay: 200ms; }
.scroll-reveal[data-delay="300"] { transition-delay: 300ms; }
.scroll-reveal[data-delay="400"] { transition-delay: 400ms; }
.scroll-reveal[data-delay="500"] { transition-delay: 500ms; }
.scroll-reveal[data-delay="600"] { transition-delay: 600ms; }

/* Slide from left */
.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from right */
.scroll-reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up */
.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   Islamic Geometric Pattern
   ============================================ */
.pattern-overlay {
  position: relative;
}
.pattern-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
  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%3Cpath d='M40 0L53.3 26.7L80 40L53.3 53.3L40 80L26.7 53.3L0 40L26.7 26.7Z' fill='none' stroke='%23003B46' stroke-width='0.4'/%3E%3Cpath d='M40 12L49.6 30.4L68 40L49.6 49.6L40 68L30.4 49.6L12 40L30.4 30.4Z' fill='none' stroke='%23003B46' stroke-width='0.3'/%3E%3C/svg%3E");
  background-size: 80px 80px;
}

.pattern-overlay-light::before {
  opacity: 0.015;
}

.pattern-overlay-gold::before {
  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%3Cpath d='M40 0L53.3 26.7L80 40L53.3 53.3L40 80L26.7 53.3L0 40L26.7 26.7Z' fill='none' stroke='%23C8971F' stroke-width='0.4'/%3E%3Cpath d='M40 12L49.6 30.4L68 40L49.6 49.6L40 68L30.4 49.6L12 40L30.4 30.4Z' fill='none' stroke='%23C8971F' stroke-width='0.3'/%3E%3C/svg%3E");
  opacity: 0.04;
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-gold { color: var(--color-accent) !important; }
.text-primary { color: var(--color-primary) !important; }
.text-white { color: var(--color-text-white) !important; }
.text-light { color: var(--color-text-light) !important; }
.text-muted { color: var(--color-text-muted) !important; }

.bg-white { background-color: var(--color-bg); }
.bg-alt { background-color: var(--color-bg-alt); }
.bg-dark { background-color: var(--color-bg-dark); }
.bg-primary { background-color: var(--color-primary); }

.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.mx-auto { margin-left: auto; margin-right: auto; }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.w-full { width: 100%; }
.max-w-sm { max-width: 480px; }
.max-w-md { max-width: 640px; }
.max-w-lg { max-width: 800px; }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.relative { position: relative; }

/* Visually hidden for screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   Prefers Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
