/* =================================
   ANIMATIONS
   Smooth transitions and effects
   ================================= */

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

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

@keyframes fadeInDown {
  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);
  }
}

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

/* Slide Animations */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Pulse Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.6), 0 0 60px rgba(139, 92, 246, 0.4);
  }
}

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

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

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

/* Utility Classes for Animations */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-down {
  opacity: 0;
  animation: fadeInDown 0.8s ease-out forwards;
}

.fade-in-left {
  opacity: 0;
  animation: fadeInLeft 0.8s ease-out forwards;
}

.fade-in-right {
  opacity: 0;
  animation: fadeInRight 0.8s ease-out forwards;
}

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

/* Staggered Animation Delays */
.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }
.fade-in:nth-child(5) { animation-delay: 0.5s; }
.fade-in:nth-child(6) { animation-delay: 0.6s; }
.fade-in:nth-child(7) { animation-delay: 0.7s; }
.fade-in:nth-child(8) { animation-delay: 0.8s; }
.fade-in:nth-child(9) { animation-delay: 0.9s; }
.fade-in:nth-child(10) { animation-delay: 1.0s; }

/* Hover Effects */
.hover-lift {
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

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

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

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

.hover-glow {
  transition: box-shadow var(--transition-smooth);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4), 0 0 40px rgba(139, 92, 246, 0.2);
}

/* Loading Animations */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-muted) 0%,
    var(--color-border) 50%,
    var(--color-muted) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Scroll Animation Classes */
.scroll-animate {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* Letter Animation for Hero Title */
@keyframes letterFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-title span {
  display: inline-block;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeInUp 1.2s cubic-bezier(0.2, 0.65, 0.3, 0.9) forwards;
}

.hero-title span:nth-child(1) { animation-delay: 0.05s; }
.hero-title span:nth-child(2) { animation-delay: 0.1s; }
.hero-title span:nth-child(3) { animation-delay: 0.15s; }
.hero-title span:nth-child(4) { animation-delay: 0.2s; }
.hero-title span:nth-child(5) { animation-delay: 0.25s; }
.hero-title span:nth-child(6) { animation-delay: 0.3s; }
.hero-title span:nth-child(7) { animation-delay: 0.35s; }
.hero-title span:nth-child(8) { animation-delay: 0.4s; }
.hero-title span:nth-child(9) { animation-delay: 0.45s; }
.hero-title span:nth-child(10) { animation-delay: 0.5s; }
.hero-title span:nth-child(11) { animation-delay: 0.55s; }
.hero-title span:nth-child(12) { animation-delay: 0.6s; }
.hero-title span:nth-child(13) { animation-delay: 0.65s; }

.hero-tagline {
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}

.hero-buttons {
  opacity: 0;
  animation: fadeIn 1s ease-out 1.2s forwards;
}

/* Gradient Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animated-gradient {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* Card Entrance Animations */
.card-entrance {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-entrance.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Ripple Effect */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple-effect:active::after {
  width: 300px;
  height: 300px;
}

/* Typing Animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

.typing-effect {
  overflow: hidden;
  border-right: 0.15em solid var(--color-primary);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.15em;
  animation: typing 3.5s steps(40, end), blink 0.75s step-end infinite;
}

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

/* Glass Morphism Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
  .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

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

/* Performance Optimizations */
.will-change-transform {
  will-change: transform;
}

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

.gpu-accelerate {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
