/* ══════════════════════════════════════════════════════
   Zmart Learning — main.css
   Custom styles layered on top of Tailwind CDN
   ══════════════════════════════════════════════════════ */

/* ── CSS CUSTOM PROPERTIES ─────────────────────────── */
:root {
  --navy:       #183053;
  --navy-dark:  #003153;
  --orange:     #F75A1A;
  --orange-lt:  #FF7A42;
  --surface:    #F8FAFC;
  --border:     #F1F5F9;
  --muted:      #64748B;
  --green:      #16A34A;
}

/* ── GLOBAL RESET ADDITIONS ────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body { overflow-x: hidden; }

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

/* iOS zoom fix — inputs below 16px trigger auto-zoom on Safari/iOS */
input, select, textarea, button {
  font-size: 16px;
}

/* ── UTILITY: SCREEN READER ONLY ───────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── TYPOGRAPHY ────────────────────────────────────── */
.section-heading {
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}

.section-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 640px;
  margin: 12px auto 0;
  line-height: 1.7;
}

/* ── STICKY NAV SHADOW ─────────────────────────────── */
#navbar[data-scrolled="true"] {
  box-shadow: 0 2px 12px rgba(24, 48, 83, 0.08);
}

/* ── HERO SECTION ──────────────────────────────────── */
#hero h2 {
  font-size: clamp(36px, 5vw, 60px);
}

/* ── CARDS ─────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ── PROGRAMS CARD HOVER STATE ─────────────────────── */
.card.group { position: relative; }

/* Orange top-border that sweeps in on hover */
.card.group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--orange);
  border-radius: 16px 16px 0 0;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.card.group:hover::before { transform: scaleX(1); }
.card.group:hover { border-color: #FDBA74; }

/* ── BUTTONS ───────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary:hover {
  background: #D94A0D;
  transform: translateY(-1px);
}

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

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  background: transparent;
  color: var(--navy);
  font-weight: 600;
  font-size: 16px;
  border-radius: 12px;
  border: 2px solid var(--navy);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  line-height: 1;
}

.btn-outline:hover {
  background: var(--navy);
  color: #fff;
}

/* ── IMPACT SECTION — dot grid overlay ────────────── */
#impact { position: relative; }

#impact::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

#impact > div { position: relative; z-index: 1; }

/* ── IMPACT COUNTER ────────────────────────────────── */
.impact-counter {
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 800;
  line-height: 1;
}

/* ── GALLERY ───────────────────────────────────────── */
#gallery .group img {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#gallery .group:hover img {
  transform: scale(1.06);
}

/* ── FAQ ACCORDION ─────────────────────────────────── */
#faq [x-show] {
  overflow: hidden;
}

/* ── DEMO FORM ─────────────────────────────────────── */
#demo-form input:focus,
#demo-form select:focus,
#demo-form textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(247, 90, 26, 0.1);
  outline: none;
}

/* ── FOOTER ────────────────────────────────────────── */
footer a:hover {
  color: #fff;
}

/* ── HERO gradient background ──────────────────────── */
#hero {
  background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 55%, #FFF7ED 100%) !important;
}

/* ── WHATSAPP FLOATING BTN ─────────────────────────── */
@keyframes wa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
  60%       { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}

#wa-btn {
  animation: wa-pulse 2.5s infinite;
  transition: transform 0.2s, background 0.2s;
}

#wa-btn:hover {
  transform: scale(1.08);
}

/* ── GSAP ANIMATION BASE STATES ────────────────────── */
.gsap-fade {
  opacity: 0;
  transform: translateY(32px);
}

.gsap-stagger {
  opacity: 0;
  transform: translateY(24px);
}

/* ── RESPONSIVE ADJUSTMENTS ────────────────────────── */
@media (max-width: 640px) {
  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
  }

  #hero h2 {
    font-size: 30px;
    line-height: 1.25;
  }

  .section-heading {
    font-size: 26px;
  }

  /* Prevent tables and wide content from overflowing */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Stack hero stats vertically on mobile */
  #hero .grid.grid-cols-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .section-heading { font-size: 28px; }

  /* Testimonials: show stacked on mobile */
  #testimonials .grid { grid-template-columns: 1fr; }
}

/* Tap target: all interactive elements ≥ 44px tall */
a, button, [role="button"], input[type="submit"] {
  min-height: 44px;
}
input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], select, textarea {
  min-height: 48px;
  font-size: 16px !important; /* iOS zoom prevention */
}

/* ── LINE CLAMP UTILITY ────────────────────────────── */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── SELECTION ─────────────────────────────────────── */
::selection {
  background: rgba(247, 90, 26, 0.15);
  color: var(--navy);
}
