/* ===== ANIMATIONS ===== */

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translateY(0);
  }
  40%, 43% {
    transform: translateY(-10px);
  }
  70% {
    transform: translateY(-5px);
  }
  90% {
    transform: translateY(-2px);
  }
}

@keyframes orbit1 {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(120px) translateY(0px) rotate(0deg);
  }
  25% {
    transform: translate(-50%, -50%) rotate(90deg) translateX(120px) translateY(-20px) rotate(-90deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg) translateX(120px) translateY(0px) rotate(-180deg);
  }
  75% {
    transform: translate(-50%, -50%) rotate(270deg) translateX(120px) translateY(20px) rotate(-270deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(120px) translateY(0px) rotate(-360deg);
  }
}

@keyframes orbit2 {
  0% {
    transform: translate(-50%, -50%) rotate(90deg) translateX(150px) translateY(0px) rotate(-90deg);
  }
  25% {
    transform: translate(-50%, -50%) rotate(180deg) translateX(150px) translateY(-25px) rotate(-180deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(270deg) translateX(150px) translateY(0px) rotate(-270deg);
  }
  75% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(150px) translateY(25px) rotate(-360deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(450deg) translateX(150px) translateY(0px) rotate(-450deg);
  }
}

@keyframes orbit3 {
  0% {
    transform: translate(-50%, -50%) rotate(180deg) translateX(180px) translateY(0px) rotate(-180deg);
  }
  25% {
    transform: translate(-50%, -50%) rotate(270deg) translateX(180px) translateY(-30px) rotate(-270deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(180px) translateY(0px) rotate(-360deg);
  }
  75% {
    transform: translate(-50%, -50%) rotate(450deg) translateX(180px) translateY(30px) rotate(-450deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(540deg) translateX(180px) translateY(0px) rotate(-540deg);
  }
}

@keyframes orbit4 {
  0% {
    transform: translate(-50%, -50%) rotate(270deg) translateX(210px) translateY(0px) rotate(-270deg);
  }
  25% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(210px) translateY(-35px) rotate(-360deg);
  }
  50% {
    transform: translate(-50%, -50%) rotate(450deg) translateX(210px) translateY(0px) rotate(-450deg);
  }
  75% {
    transform: translate(-50%, -50%) rotate(540deg) translateX(210px) translateY(35px) rotate(-540deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(630deg) translateX(210px) translateY(0px) rotate(-630deg);
  }
}

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

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(47, 123, 79, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(47, 123, 79, 0.4);
  }
}

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

@keyframes flow-along-path {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

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

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}


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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out forwards;
}

.animate-slide-in-down {
  animation: slideInDown 0.6s ease-out forwards;
}

.animate-slide-in-up {
  animation: slideInUp 0.6s ease-out forwards;
}

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

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-bounce {
  animation: bounce 1s;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

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

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* Delayed Animations */
.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

.animate-delay-700 {
  animation-delay: 0.7s;
}

.animate-delay-1000 {
  animation-delay: 1s;
}

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

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

/* Hover Animations */
.hover-lift {
  transition: all var(--transition);
}

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

.hover-scale {
  transition: transform var(--transition);
}

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

.hover-rotate {
  transition: transform var(--transition);
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-brightness {
  transition: filter var(--transition);
}

.hover-brightness:hover {
  filter: brightness(1.1);
}

/* Loading Animations */
.loading-dots {
  display: inline-block;
}

.loading-dots::after {
  content: '';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60%, 100% {
    content: '...';
  }
}

.loading-skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-200) 25%,
    var(--gray-100) 50%,
    var(--gray-200) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Connection Line Animations */
.connection-line {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: draw-line 2s ease-in-out forwards;
}

@keyframes draw-line {
  to {
    stroke-dashoffset: 0;
  }
}

/* Pulsing Dots */
.pulse-dot {
  position: relative;
}

.pulse-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* Text Animations */
.text-gradient {
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--accent-color),
    var(--secondary-color)
  );
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Stagger Animations */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out forwards;
}

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

/* Parallax Effects */
.parallax {
  transform: translateZ(0);
  transition: transform 0.1s ease-out;
}

/* Micro-interactions */
.micro-bounce {
  transition: transform 0.1s ease;
}

.micro-bounce:active {
  transform: scale(0.95);
}

.micro-wiggle {
  animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

/* Success Animation */
.success-checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success-color);
  position: relative;
  margin: 0 auto;
}

.success-checkmark::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 35px;
  border: solid white;
  border-width: 0 4px 4px 0;
  transform: translate(-50%, -60%) rotate(45deg);
  animation: checkmark 0.6s ease-in-out 0.3s forwards;
  opacity: 0;
}

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: translate(-50%, -60%) rotate(45deg) scale(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .floating-element {
    animation: none;
  }
  
  .connection-line {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }
}