/* ============================================
   ZEHE SCAPES - Animations Stylesheet
   Smooth animations and transitions
   ============================================ */

/* ============================================
   Keyframe Animations
   ============================================ */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Pulse */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Float */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Spin */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* ============================================
   Animation Classes
   ============================================ */
.animate {
  opacity: 0;
}

.animate.animated {
  animation-duration: 0.6s;
  animation-fill-mode: both;
  animation-timing-function: ease-out;
}

.animate.fade-in-up.animated {
  animation-name: fadeInUp;
}

.animate.fade-in-down.animated {
  animation-name: fadeInDown;
}

.animate.fade-in-left.animated {
  animation-name: fadeInLeft;
}

.animate.fade-in-right.animated {
  animation-name: fadeInRight;
}

.animate.fade-in.animated {
  animation-name: fadeIn;
}

.animate.scale-in.animated {
  animation-name: scaleIn;
}

/* Animation Delays */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ============================================
   Hover Animations
   ============================================ */

/* Lift on hover */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Scale on hover */
.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* Glow on hover */
.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(45, 90, 39, 0.3);
}

/* Underline on hover */
.hover-underline {
  position: relative;
}

.hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-base);
}

.hover-underline:hover::after {
  width: 100%;
}

/* ============================================
   Loading States
   ============================================ */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn.loading {
  color: transparent;
}

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-gray-100) 25%,
    var(--color-gray-200) 50%,
    var(--color-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ============================================
   Page Transitions
   ============================================ */
.page-transition-enter {
  opacity: 0;
}

.page-transition-enter-active {
  opacity: 1;
  transition: opacity 300ms ease-in;
}

.page-transition-exit {
  opacity: 1;
}

.page-transition-exit-active {
  opacity: 0;
  transition: opacity 300ms ease-out;
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-content > * {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content > *:nth-child(3) { animation-delay: 0.6s; }
.hero-content > *:nth-child(4) { animation-delay: 0.8s; }

/* ============================================
   Scroll Progress Bar
   ============================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-green);
  z-index: 1001;
  transition: width 100ms ease-out;
}

/* ============================================
   Image Lazy Load
   ============================================ */
.lazy-image {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.lazy-image.loaded {
  opacity: 1;
}

/* ============================================
   Success/Error States
   ============================================ */
.success-animation {
  animation: scaleIn 0.5s ease-out;
}

.error-shake {
  animation: shake 0.5s ease-out;
}

/* ============================================
   Counter Animation
   ============================================ */
.counter {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

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

/* ============================================
   Stagger Animation for Lists
   ============================================ */
.stagger-list > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-list.animated > *:nth-child(1) { animation: fadeInUp 0.5s ease-out 0.1s forwards; }
.stagger-list.animated > *:nth-child(2) { animation: fadeInUp 0.5s ease-out 0.2s forwards; }
.stagger-list.animated > *:nth-child(3) { animation: fadeInUp 0.5s ease-out 0.3s forwards; }
.stagger-list.animated > *:nth-child(4) { animation: fadeInUp 0.5s ease-out 0.4s forwards; }
.stagger-list.animated > *:nth-child(5) { animation: fadeInUp 0.5s ease-out 0.5s forwards; }
.stagger-list.animated > *:nth-child(6) { animation: fadeInUp 0.5s ease-out 0.6s forwards; }
.stagger-list.animated > *:nth-child(7) { animation: fadeInUp 0.5s ease-out 0.7s forwards; }
.stagger-list.animated > *:nth-child(8) { animation: fadeInUp 0.5s ease-out 0.8s forwards; }
.stagger-list.animated > *:nth-child(9) { animation: fadeInUp 0.5s ease-out 0.9s forwards; }

/* ============================================
   Focus States (Accessibility)
   ============================================ */
.btn:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   Smooth Scroll Behavior
   ============================================ */
html {
  scroll-behavior: smooth;
}

/* Offset for fixed header */
:target {
  scroll-margin-top: 100px;
}
