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

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

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

@keyframes slideInLeft {
  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 bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -5px, 0);
  }
  70% {
    transform: translate3d(0, -3px, 0);
  }
  90% {
    transform: translate3d(0, -1px, 0);
  }
}

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

@keyframes progressLoad {
  from {
    width: 0%;
  }
  to {
    width: var(--width);
  }
}

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

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

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

@keyframes wiggle {
  0%, 7% {
    transform: rotateZ(0);
  }
  15% {
    transform: rotateZ(-15deg);
  }
  20% {
    transform: rotateZ(10deg);
  }
  25% {
    transform: rotateZ(-10deg);
  }
  30% {
    transform: rotateZ(6deg);
  }
  35% {
    transform: rotateZ(-4deg);
  }
  40%, 100% {
    transform: rotateZ(0);
  }
}

/* ===== COMPONENT-SPECIFIC ANIMATIONS ===== */

/* Hero Image Float Animation */
.hero-image {
  animation: float 6s ease-in-out infinite;
}

/* Value Cards Hover Animations */
.value-card {
  transition: all var(--transition-base);
}

.value-card:hover .value-icon {
  animation: bounce 0.6s ease;
  transform: scale(1.1);
}

/* Product Card Animations */
.product-card {
  transition: all var(--transition-base);
}

.product-card:hover {
  transform: translateY(-5px);
}

.product-card:hover .product-image img {
  transform: scale(1.05);
  transition: transform var(--transition-base);
}

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

.btn::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.6s;
}

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

.btn:active {
  transform: translateY(1px);
}

/* Navigation Link Animations */
.nav-link {
  position: relative;
}

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

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

/* Comparison Bar Loading Animation */
.comparison-fill {
  animation: progressLoad 1.5s ease-out 0.5s forwards;
  width: 0;
}

.progress-fill {
  animation: progressLoad 1.5s ease-out 0.8s forwards;
  width: 0;
}

/* Counter Animation */
.counter-number {
  animation: countUp 0.8s ease-out;
}

/* Tab Button Active Animation */
.tab-btn.active {
  position: relative;
}

.tab-btn.active::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  animation: slideInRight 0.3s ease;
}

/* Testimonial Slide Animation */
.testimonial-slide.active .testimonial-card {
  animation: slideInRight 0.6s ease;
}

/* Form Input Focus Animation */
.form-group input:focus,
.form-group select:focus {
  animation: glowPulse 2s infinite;
}

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

/* Scroll-triggered animations */
.scroll-fade {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-fade.in-view {
  opacity: 1;
  transform: translateY(0);
}

.scroll-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease;
}

.scroll-slide-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s ease;
}

.scroll-slide-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scroll-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease;
}

.scroll-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero-glow {
    animation: none;
  }
  
  .hero-image {
    animation: none;
  }
  
  [data-aos] {
    transition: none !important;
  }
}

/* GPU Acceleration for better performance */
.hero-image,
.value-card,
.product-card,
.btn,
.carousel-btn,
.testimonial-card {
  will-change: transform;
}

/* Force hardware acceleration on hover elements */
.value-card:hover,
.product-card:hover,
.btn:hover {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* ===== UTILITY ANIMATION CLASSES ===== */
.animate-pulse {
  animation: pulse 2s infinite;
}

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

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

.animate-wiggle {
  animation: wiggle 0.8s ease-in-out;
}

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

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

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

/* Delayed Animation Classes */
.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;
}

/* ===== INTERACTIVE ELEMENT ANIMATIONS ===== */

/* Carousel Animations */
.carousel-track {
  transition: transform var(--transition-slow);
}

.carousel-btn {
  transition: all var(--transition-base);
}

.carousel-btn:hover {
  animation: bounce 0.6s ease;
}

.dot {
  transition: all var(--transition-base);
}

.dot:hover {
  animation: wiggle 0.5s ease;
}

/* Tab Animations */
.tab-panel {
  animation: slideInRight 0.4s ease;
}

/* Form Animations */
.form-group label {
  transition: all var(--transition-base);
}

.form-group input:invalid {
  animation: wiggle 0.5s ease;
}

/* Success/Error States */
.success-state {
  animation: bounce 0.6s ease;
  color: var(--success-color);
}

.error-state {
  animation: wiggle 0.5s ease;
  color: var(--warning-color);
}

/* ===== MICRO-INTERACTIONS ===== */

/* Icon Hover Effects */
.icon {
  transition: all var(--transition-base);
}

.icon:hover {
  transform: scale(1.1);
}

/* Link Underline Animation */
.animated-link {
  position: relative;
  overflow: hidden;
}

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

.animated-link:hover::after {
  width: 100%;
}

/* Card Stack Effect */
.card-stack {
  position: relative;
}

.card-stack::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  z-index: -1;
  transition: all var(--transition-base);
}

.card-stack:hover::before {
  top: 8px;
  left: 8px;
}

/* Gradient Text Animation */
.gradient-text-animated {
  background: linear-gradient(
    -45deg,
    var(--primary-color),
    var(--accent-color),
    var(--primary-color),
    var(--accent-color)
  );
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}