/* ========================================
   SALES FINDER - ANIMATIONS CSS
   Modern animations and microinteractions
   ======================================== */

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

/* Floating animation for hero shapes */
@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(5deg);
  }
  50% {
    transform: translateY(-15px) rotate(-3deg);
  }
  75% {
    transform: translateY(-25px) rotate(7deg);
  }
}

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

/* Pulse animation */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Fade in from bottom */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in from left */
@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in from right */
@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translateX(30px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in animation */
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Bounce in animation */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slide in from top */
@keyframes slideInDown {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Rotate and scale */
@keyframes rotateScale {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

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

@keyframes blinkCursor {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent-blue); }
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--accent-blue);
  }
  50% {
    box-shadow: 0 0 20px var(--accent-blue), 0 0 30px var(--light-blue);
  }
}

/* Wave animation */
@keyframes wave {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(10deg);
  }
  75% {
    transform: rotate(-10deg);
  }
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */

/* Basic fade animations */
.fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

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

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

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

.bounce-in {
  animation: bounceIn 0.8s ease-out forwards;
  opacity: 0;
}

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

/* Delayed animations for staggered effects */
.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }
.fade-in-delay-5 { animation-delay: 0.5s; }

/* Continuous animations */
.float {
  animation: float 6s ease-in-out infinite;
}

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

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

.rotate-continuous {
  animation: rotateScale 10s linear infinite;
}

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

/* Button hover effects */
.btn-hover-lift {
  transition: all var(--transition-normal);
}

.btn-hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(51, 102, 204, 0.4);
}

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

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

/* Card hover effects */
.card-hover-float {
  transition: all var(--transition-normal);
}

.card-hover-float:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px var(--shadow-medium);
}

.card-hover-tilt {
  transition: transform var(--transition-normal);
}

.card-hover-tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Icon hover effects */
.icon-hover-bounce {
  transition: transform var(--transition-fast);
}

.icon-hover-bounce:hover {
  animation: bounceIn 0.6s ease-out;
}

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

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

/* Text hover effects */
.text-hover-gradient {
  background: linear-gradient(135deg, var(--accent-blue), var(--light-blue));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: background-position var(--transition-normal);
}

.text-hover-gradient:hover {
  background-position: 100% 100%;
}

.text-hover-underline {
  position: relative;
  text-decoration: none;
}

.text-hover-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, var(--accent-blue), var(--light-blue));
  transition: width var(--transition-normal);
}

.text-hover-underline:hover::after {
  width: 100%;
}

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

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Loading dots */
.loading-dots {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}

.loading-dots div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.loading-dots div:nth-child(1) {
  left: 8px;
  animation: dots1 0.6s infinite;
}

.loading-dots div:nth-child(2) {
  left: 8px;
  animation: dots2 0.6s infinite;
}

.loading-dots div:nth-child(3) {
  left: 32px;
  animation: dots2 0.6s infinite;
}

.loading-dots div:nth-child(4) {
  left: 56px;
  animation: dots3 0.6s infinite;
}

@keyframes dots1 {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes dots3 {
  0% { transform: scale(1); }
  100% { transform: scale(0); }
}

@keyframes dots2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(24px, 0); }
}

/* Progress bar animation */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--accent-blue), var(--light-blue));
  transform: translateX(-100%);
  animation: progressSlide 2s ease-in-out infinite;
}

@keyframes progressSlide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(0%); }
  100% { transform: translateX(100%); }
}

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

/* Elements that animate on scroll */
.scroll-fade-in {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease-out;
}

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

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

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

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

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

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

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

/* ========================================
   TYPEWRITER EFFECT
   ======================================== */

.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--accent-blue);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.1em;
  animation: 
    typing 3.5s steps(40, end),
    blinkCursor 0.75s step-end infinite;
}

/* ========================================
   MORPHING SHAPES
   ======================================== */

.morphing-shape {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--accent-blue), var(--light-blue));
  border-radius: 50%;
  animation: morph 4s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 50%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: rotate(90deg);
  }
  50% {
    border-radius: 20% 80% 20% 80% / 80% 20% 80% 20%;
    transform: rotate(180deg);
  }
  75% {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
    transform: rotate(270deg);
  }
}

/* ========================================
   PARALLAX EFFECT
   ======================================== */

.parallax-element {
  will-change: transform;
  transition: transform 0.1s ease-out;
}

/* ========================================
   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; }

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

/* GPU acceleration for smooth animations */
.gpu-accelerated {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Reduced motion preferences */
@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;
  }
  
  .float,
  .pulse,
  .glow,
  .rotate-continuous,
  .morphing-shape {
    animation: none !important;
  }
  
  .parallax-element {
    transform: none !important;
  }
}

/* ========================================
   DARK MODE ANIMATIONS
   ======================================== */

@media (prefers-color-scheme: dark) {
  .glow {
    animation: none;
  }
  
  .text-hover-gradient {
    background: linear-gradient(135deg, var(--light-blue), var(--lightest-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .loading-spinner {
    border-top-color: var(--light-blue);
  }
  
  .loading-dots div {
    background: var(--light-blue);
  }
}