/* ============================================================
   GLOBAL STYLES — Abdullah's Quran & Arabic Academy
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=Amiri:wght@400;700&display=swap');

/* ── CSS Variables ── */
:root {
  --primary: #1B4332;
  --primary-light: #2D6A4F;
  --primary-dark: #0D2818;
  --gold: #C9A84C;
  --gold-light: #F0D080;
  --gold-dark: #A07830;
  --navy: #0D1B2A;
  --navy-light: #1A2E42;
  --white: #FFFFFF;
  --cream: #F8F5EE;
  --cream-dark: #EDE8DC;
  --text-dark: #1A1A2E;
  --text-body: #374151;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: rgba(201, 168, 76, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.16);
  --shadow-gold: 0 8px 32px rgba(201, 168, 76, 0.25);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Lato', sans-serif;
  --font-arabic: 'Amiri', serif;
  --section-pad: 100px 0;
  --container: 1280px;
}

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

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

body {
  font-family: var(--font-main);
  color: var(--text-body);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--font-main);
  border: none;
  background: none;
}

input,
select,
textarea {
  font-family: var(--font-main);
}

/* ── Container ── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Section Base ── */
.section {
  padding: var(--section-pad);
  overflow-x: hidden;
}

.section-white {
  background: var(--white);
}

.section-cream {
  background: var(--cream);
}

.section-dark {
  background: var(--navy);
  color: var(--white);
}

.section-green {
  background: var(--primary);
  color: var(--white);
}

/* ── Section Headings ── */
.section-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 16px;
}

.section-title span {
  color: var(--primary-light);
}

.section-title .gold {
  color: var(--gold);
}

.section-dark .section-title {
  color: var(--white);
}

.section-green .section-title {
  color: var(--white);
}

.section-dark .section-label {
  color: var(--gold-light);
}

.section-green .section-label {
  color: var(--gold-light);
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.8;
}

.section-dark .section-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.section-green .section-subtitle {
  color: rgba(255, 255, 255, 0.8);
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header .section-subtitle {
  margin: 0 auto;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  opacity: 0;
  transition: var(--transition);
}

.btn:hover::after {
  opacity: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(27, 67, 50, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.4);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-outline-white:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--white);
}

.btn-white {
  background: var(--white);
  color: var(--primary);
}

.btn-sm {
  padding: 10px 22px;
  font-size: 0.87rem;
}

.btn-lg {
  padding: 18px 44px;
  font-size: 1.05rem;
}

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.badge-green {
  background: rgba(45, 106, 79, 0.12);
  color: var(--primary-light);
}

.badge-gold {
  background: rgba(201, 168, 76, 0.15);
  color: var(--gold-dark);
}

.badge-navy {
  background: rgba(13, 27, 42, 0.1);
  color: var(--navy);
}

/* ── Divider ── */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  margin: 16px auto 0;
}

.divider-left {
  margin-left: 0;
}

/* ── Arabic Decorative Text ── */
.arabic-deco {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--gold);
  opacity: 0.7;
  letter-spacing: 2px;
}

/* ── Star Rating ── */
.stars {
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 2px;
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-group label span.req {
  color: #E53E3E;
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 13px 18px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(45, 106, 79, 0.1);
}

.form-control.error {
  border-color: #E53E3E;
}

.form-error {
  font-size: 0.8rem;
  color: #E53E3E;
  margin-top: 5px;
  display: none;
}

.form-control.error+.form-error {
  display: block;
}

select.form-control {
  appearance: none;
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ── Utility ── */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-gold {
  color: var(--gold);
}

.text-green {
  color: var(--primary-light);
}

.text-white {
  color: var(--white);
}

.text-muted {
  color: var(--text-muted);
}

.fw-700 {
  font-weight: 700;
}

.fw-900 {
  font-weight: 900;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.mt-24 {
  margin-top: 24px;
}

.mt-32 {
  margin-top: 32px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mb-32 {
  margin-bottom: 32px;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.gap-16 {
  gap: 16px;
}

.gap-24 {
  gap: 24px;
}

.w-100 {
  width: 100%;
}

/* ── Grid ── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ── Islamic Pattern Overlay ── */
.pattern-overlay {
  position: absolute;
  inset: 0;
  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='%23C9A84C' fill-opacity='0.06'%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");
  pointer-events: none;
}

/* ── Page Hero Banner ── */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--navy) 100%);
  padding: 140px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23C9A84C' fill-opacity='0.05'%3E%3Cpath d='M40 0L50 30H80L57 48L67 78L40 60L13 78L23 48L0 30H30Z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.page-hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 16px;
}

.page-hero-title span {
  color: var(--gold);
}

.page-hero-sub {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 auto 24px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb a {
  color: var(--gold);
}

.breadcrumb a:hover {
  color: var(--gold-light);
}

.breadcrumb .sep {
  color: rgba(255, 255, 255, 0.3);
}

/* ── Loading Screen ── */
#loader {
  position: fixed;
  inset: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  font-family: var(--font-arabic);
  font-size: 2.5rem;
  color: var(--gold);
  margin-bottom: 24px;
  animation: pulse 1.5s ease-in-out infinite;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(201, 168, 76, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ── WhatsApp Float ── */
.whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1000;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  transition: var(--transition);
  animation: waPulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(37, 211, 102, 0.5);
}

.whatsapp-float i,
.whatsapp-float svg {
  font-size: 1.5rem;
  color: white;
  width: 28px;
  height: 28px;
}

@keyframes waPulse {

  0%,
  100% {
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
  }

  50% {
    box-shadow: 0 8px 40px rgba(37, 211, 102, 0.7);
  }
}

/* ── Scroll To Top ── */
#scrollTop {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 999;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

#scrollTop.visible {
  opacity: 1;
  visibility: visible;
}

#scrollTop:hover {
  background: var(--primary-light);
  transform: translateY(-3px);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 560px;
  width: 100%;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-dark);
  transform: rotate(90deg);
}

/* ── Accordion ── */
.accordion-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.accordion-item.open {
  border-color: var(--primary-light);
}

.accordion-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  gap: 12px;
}

.accordion-header:hover {
  background: var(--cream);
  color: var(--primary);
}

.accordion-item.open .accordion-header {
  background: var(--primary);
  color: white;
}

.accordion-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}

.accordion-item.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-body-inner {
  padding: 20px 24px;
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.8;
  border-top: 1px solid var(--border);
}

/* ── Scroll Reveal Base ── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Transition Delays ── */
.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
}

.delay-5 {
  transition-delay: 0.5s;
}

.delay-6 {
  transition-delay: 0.6s;
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --section-pad: 70px 0;
  }

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

  .stack-mobile {
    flex-direction: column !important;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .btn-lg {
    padding: 15px 32px;
    font-size: 1rem;
  }

  .container {
    padding: 0 18px;
  }

  .modal-box {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  :root {
    --section-pad: 56px 0;
  }

  .page-hero {
    padding: 120px 0 60px;
  }
}