/* Premium Animations and Micro-interactions */

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

/* Loading Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(144, 194, 59, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(144, 194, 59, 0.6);
  }
}

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

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.slide-in-left {
  animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out forwards;
}

.scale-in {
  animation: scaleIn 0.6s ease-out forwards;
}

/* Intersection Observer Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-on-scroll-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.animate-on-scroll-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease-out;
}

.animate-on-scroll-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered Animations */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

/* Hover Animations */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(144, 194, 59, 0.4);
}

.hover-scale {
  transition: transform 0.3s ease;
}

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

/* Button Animations */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-shine:hover::before {
  left: 100%;
}

/* Card Animations */
.card-entrance {
  animation: scaleIn 0.6s ease-out forwards;
}

.card-hover {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card-hover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(144, 194, 59, 0.1) 0%,
    transparent 50%,
    rgba(144, 194, 59, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-hover:hover::before {
  opacity: 1;
}

.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Text Animations */
.text-gradient-animate {
  background: linear-gradient(
    90deg,
    #90c23b,
    #759b30,
    #85b237,
    #90c23b
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

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

/* Progress Animations */
.progress-fill {
  background: var(--gradient-primary);
  height: 100%;
  border-radius: var(--radius-full);
  animation: progressGrow 1s ease-out forwards;
}

@keyframes progressGrow {
  from {
    width: 0%;
  }
}

/* Pulse Animations */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

.pulse-dot {
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Floating Animations */
.float {
  animation: float 6s ease-in-out infinite;
}

.float-delay-1 {
  animation: float 6s ease-in-out infinite;
  animation-delay: 1s;
}

.float-delay-2 {
  animation: float 6s ease-in-out infinite;
  animation-delay: 2s;
}

.float-delay-3 {
  animation: float 6s ease-in-out infinite;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Rotation Animations */
.rotate-slow {
  animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Bounce Animations */
.bounce {
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* Typewriter Animation */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-green);
  white-space: nowrap;
  animation: typewriter 3s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-green);
  }
}

/* Modal Animations */
.modal-overlay {
  transition: all 0.3s ease;
}

.modal-content {
  transition: all 0.3s ease;
}

.modal-overlay.active .modal-content {
  animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(50px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Navigation Animations */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-green);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Scroll Indicator */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-primary);
  transform-origin: left;
  transform: scaleX(0);
  z-index: var(--z-fixed);
  transition: transform 0.3s ease;
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Performance Optimizations */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* Custom Easing Functions */
.ease-out-cubic {
  transition-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1);
}

.ease-in-out-cubic {
  transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1);
}

.ease-out-expo {
  transition-timing-function: cubic-bezier(0.190, 1.000, 0.220, 1.000);
}

/* Staggered Grid Animation */
.staggered-grid {
  display: grid;
  gap: var(--spacing-lg);
}

.staggered-grid > * {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.staggered-grid.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.staggered-grid.visible > *:nth-child(1) { transition-delay: 0.05s; }
.staggered-grid.visible > *:nth-child(2) { transition-delay: 0.1s; }
.staggered-grid.visible > *:nth-child(3) { transition-delay: 0.15s; }
.staggered-grid.visible > *:nth-child(4) { transition-delay: 0.2s; }
.staggered-grid.visible > *:nth-child(5) { transition-delay: 0.25s; }
.staggered-grid.visible > *:nth-child(6) { transition-delay: 0.3s; }
.staggered-grid.visible > *:nth-child(7) { transition-delay: 0.35s; }
.staggered-grid.visible > *:nth-child(8) { transition-delay: 0.4s; }
.staggered-grid.visible > *:nth-child(9) { transition-delay: 0.45s; }
.staggered-grid.visible > *:nth-child(10) { transition-delay: 0.5s; }
