/* ============================================
   Design System - CSS Custom Properties
   ============================================ */

:root {
  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border radius - only 3 levels */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Colors */
  --color-primary: #2563eb;
  --color-primary-dark: #1e40af;
  --color-accent: #22c55e;
  --color-bg: #f8fafc;
  --color-card: #ffffff;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);

  /* Icon container */
  --icon-size: 40px;
  --icon-radius: 8px;
}

/* ============================================
   Custom Utilities
   ============================================ */

.container-custom {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container-custom {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-custom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.section-padding {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

/* ============================================
   Animations System
   ============================================ */

/* Scroll reveal - elements animate when entering viewport */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children animation */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }

/* Hero text animation */
.hero-text-reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 0.8s ease forwards;
}
.hero-text-reveal-delay {
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 0.8s ease 0.2s forwards;
}
.hero-text-reveal-delay2 {
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 0.8s ease 0.4s forwards;
}
.hero-cta-reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: heroReveal 0.8s ease 0.6s forwards;
}
@keyframes heroReveal {
  to { opacity: 1; transform: translateY(0); }
}

/* Button effects */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}
.btn-ripple:active::after {
  width: 200px;
  height: 200px;
  opacity: 1;
  transition: 0s;
}

/* Card glow on hover */
.card-glow {
  transition: all 0.3s ease;
}
.card-glow:hover {
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.15), 0 10px 30px rgba(0,0,0,0.08);
}

/* Counter animation helper */
.counter-animated {
  display: inline-block;
}

/* Modal animations */
.modal-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.modal-overlay .modal-content,
.modal-overlay .modal-box {
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.25s ease;
}
.modal-overlay.show .modal-content,
.modal-overlay.show .modal-box {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Navbar scroll effect */
.navbar-scrolled {
  background: rgba(255, 255, 255, 0.98) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.08);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Input focus animation */
.input-animated {
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.input-animated:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

/* Icon hover bounce */
.icon-bounce:hover {
  animation: iconBounce 0.4s ease;
}
@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Skeleton loading shimmer */
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 0.375rem;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale,
  .stagger-children > *,
  .hero-text-reveal, .hero-text-reveal-delay, .hero-text-reveal-delay2, .hero-cta-reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}
