/* Animation Styles */

/* Base animation classes - elements start hidden */
.animate-fade-in,
.animate-slide-up,
.animate-slide-down,
.animate-slide-left,
.animate-slide-right,
.animate-scale {
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Slide animations - initial states */
.animate-slide-up {
  transform: translateY(50px);
}

.animate-slide-down {
  transform: translateY(-50px);
}

.animate-slide-left {
  transform: translateX(40px);
}

.animate-slide-right {
  transform: translateX(-40px);
}

.animate-scale {
  transform: scale(0.9);
}

/* Visible state - triggered by Intersection Observer */
.animate-fade-in.animate-visible,
.animate-slide-up.animate-visible,
.animate-slide-down.animate-visible,
.animate-slide-left.animate-visible,
.animate-slide-right.animate-visible,
.animate-scale.animate-visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delay for groups */
.animate-stagger > * {
  transition-delay: 0s;
}

/* Page load animation */
body {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

body.page-loaded {
  opacity: 1;
}

/* Smooth transitions for interactive elements */
a, button {
  transition: all 0.3s ease;
}

/* Hover effects */
.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.15);
}

/* Card glow effect */
.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(94, 51, 191, 0.1) 0%, transparent 70%);
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

/* Button hover animations */
.btn-hover {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-hover::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-hover:hover::before {
  width: 300px;
  height: 300px;
}

/* Loading screen */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.page-loader::after {
  content: '';
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #18181b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Parallax effect */
.parallax-hero {
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* Navigation menu animations */
nav a, nav button {
  position: relative;
}

nav a::after, nav button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}

nav a:hover::after, nav button:hover::after,
nav a.active::after, nav button.active::after {
  width: 100%;
}

/* Image zoom on hover */
.img-zoom {
  overflow: hidden;
}

.img-zoom img {
  transition: transform 0.5s ease;
}

.img-zoom:hover img {
  transform: scale(1.1);
}

/* Counter animation */
.counter {
  font-variant-numeric: tabular-nums;
}

/* Gradient text animation */
.gradient-text {
  background: linear-gradient(90deg, #18181b, #5e33bf, #18181b);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 3s ease infinite;
}

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

/* Pulse animation for CTA buttons */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

/* Fade-in variants with different speeds */
.animate-fast {
  transition-duration: 0.4s;
}

.animate-slow {
  transition-duration: 1.2s;
}

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

@media (max-width: 768px) {
  .animate-slide-up,
  .animate-slide-down {
    transform: translateY(20px);
  }

  .animate-slide-left,
  .animate-slide-right {
    transform: translateX(20px);
  }
}
