/* Mobile Animation Enhancements for Dr. Babaei Website */

/* Intersection Observer based animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

/* Staggered animations for cards */
.hero-box {
  animation-delay: calc(var(--index, 0) * 0.1s);
}

.services-slider-contents {
  animation-delay: calc(var(--index, 0) * 0.15s);
}

/* Loading animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Smooth hover animations for mobile */
@media (hover: hover) {
  .hero-box:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(6, 21, 35, 0.15);
  }
  
  .secondary-button:hover {
    transform: translateY(-3px) scale(1.02);
  }
  
  .nav-link:hover {
    background: linear-gradient(135deg, rgba(0, 115, 255, 0.1), rgba(0, 168, 255, 0.05));
  }
}

/* Touch-specific animations */
@media (hover: none) {
  .hero-box:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .secondary-button:active {
    transform: scale(0.95);
  }
  
  .nav-link:active {
    background: rgba(0, 115, 255, 0.15);
  }
}

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

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

/* Pulse animation for important elements */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 115, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 115, 255, 0);
  }
}

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

/* Smooth transitions for all interactive elements */
.nav-link,
.secondary-button,
.hero-box,
.services-slider-contents,
.compare-component,
.review-desp {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 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;
    scroll-behavior: auto !important;
  }
  
  .floating-element,
  .pulse-animation {
    animation: none;
  }
}

/* Performance optimizations */
.hero-images img,
.services-slider-image,
.compare-before-media,
.compare-after-media {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
  to {
    left: 100%;
  }
}

/* Micro-interactions */
.button-texts {
  position: relative;
  overflow: hidden;
}

.button-text {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.secondary-button:hover .button-text._01 {
  transform: translateY(-100%);
}

.secondary-button:hover .button-text._02 {
  transform: translateY(-100%);
}