/* ============================================
   MWASA Kenya — Design System & Animations
   Mental Wellness & Avoidance of Substance Abuse
   ============================================ */

/* ---- Root Design Tokens ---- */
:root {
  --brand: #83cd4a;
  --brand-glow: rgba(131, 205, 74, 0.35);
  --teal: #176aac;
  --teal-glow: rgba(23, 106, 172, 0.25);
  --surface-0: #020617;
  --surface-1: #0f172a;
  --surface-2: #1e293b;
  --border: rgba(255, 255, 255, 0.06);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --warm-amber: #f59e0b;
  --danger: #ef4444;
}

/* ---- Smooth Scrolling ---- */
html {
  scroll-behavior: smooth;
}

/* ---- Selection ---- */
::selection {
  background: var(--brand);
  color: var(--surface-0);
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface-0);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* ---- Glassmorphism Card ---- */
.glass-card {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--border);
}

/* ---- Ambient Glow Backgrounds ---- */
.ambient-glow {
  position: relative;
}
.ambient-glow::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, var(--brand-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.ambient-teal::before {
  background: radial-gradient(ellipse, var(--teal-glow) 0%, transparent 70%);
}

/* ---- Animated Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, #83cd4a 0%, #b3e4aa 25%, #4788bd 50%, #176aac 75%, #83cd4a 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerGradient 6s ease-in-out infinite;
}

@keyframes shimmerGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ---- Scroll-Triggered Reveals ---- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered delays for child elements */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ---- Floating Pulse Animation ---- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* ---- Pulse Glow ---- */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px var(--brand-glow); }
  50% { box-shadow: 0 0 40px var(--brand-glow), 0 0 80px rgba(131, 205, 74, 0.1); }
}
.animate-glow {
  animation: pulseGlow 3s infinite ease-in-out;
}

/* ---- Crisis Pulse ---- */
@keyframes crisisPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
.crisis-pulse {
  animation: crisisPulse 2s infinite;
}

/* ---- Breathing Dot ---- */
@keyframes breathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}
.breathing-dot {
  animation: breathe 2.5s infinite ease-in-out;
}

/* ---- Hero Particle Background (Pure CSS) ---- */
.hero-bg-pattern {
  background-image:
    radial-gradient(circle at 20% 80%, rgba(131, 205, 74, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(23, 106, 172, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(131, 205, 74, 0.03) 0%, transparent 70%);
}

/* ---- Image Hover Parallax ---- */
.img-hover-zoom {
  overflow: hidden;
}
.img-hover-zoom img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-hover-zoom:hover img {
  transform: scale(1.08);
}

/* ---- Card Hover Lift ---- */
.card-lift {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s ease;
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px -15px rgba(131, 205, 74, 0.15);
}

/* ---- Stat Counter Number ---- */
.stat-number {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---- Input/Range Styling ---- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--surface-2);
  border-radius: 100px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand);
  cursor: pointer;
  box-shadow: 0 0 16px var(--brand-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 24px var(--brand-glow);
}

/* ---- Radio Button Styling ---- */
input[type="radio"] {
  accent-color: var(--brand);
}

/* ---- Focus Visible for Accessibility ---- */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---- Smooth Link Underline ---- */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.3s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* ---- Testimonial Blockquote ---- */
.testimonial-quote {
  position: relative;
  padding-left: 1.5rem;
  border-left: 3px solid var(--brand);
  font-style: italic;
}
.testimonial-quote::before {
  content: '\201C';
  position: absolute;
  top: -0.5rem;
  left: 0.5rem;
  font-size: 3rem;
  color: var(--brand);
  opacity: 0.2;
  line-height: 1;
}

/* ---- Horizontal Divider with Glow ---- */
.divider-glow {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  border: none;
  opacity: 0.3;
}

/* ---- Navigation Active Indicator ---- */
.nav-active {
  color: var(--brand) !important;
  position: relative;
}
.nav-active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--brand);
  border-radius: 100px;
}

/* ---- Responsive Utilities ---- */
@media (max-width: 768px) {
  .reveal, .reveal-left, .reveal-right {
    transform: translateY(20px) !important;
  }
  .reveal.visible, .reveal-left.visible, .reveal-right.visible {
    transform: translateY(0) !important;
  }
}

/* ---- Print Styles ---- */
@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
}

/* ---- High Contrast Mode (Accessibility) ---- */
body.high-contrast {
  background: #000 !important;
}
body.high-contrast * {
  border-color: #fff !important;
}
body.high-contrast p,
body.high-contrast span,
body.high-contrast li,
body.high-contrast a {
  color: #fff !important;
}
body.high-contrast h1,
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5 {
  color: #ffff00 !important;
}
body.high-contrast .gradient-text {
  background: none !important;
  -webkit-text-fill-color: #ffff00 !important;
}
