/* ============================================
   GrowthX - Digital Marketing Agency
   Animations Stylesheet
   ============================================ */

/* ============================================
   1. KEYFRAME ANIMATIONS
   ============================================ */

/* Spin Animation (Preloader) */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

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

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

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

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down Animation */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left Animation */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right Animation */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Shake Animation */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

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

/* Glow Animation */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 107, 53, 0.6);
  }
}

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

/* Slide In From Bottom */
@keyframes slideInBottom {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   2. ANIMATION UTILITY CLASSES
   ============================================ */

/* Fade Animations */
.animate-fadeIn {
  animation: fadeIn 0.6s ease forwards;
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fadeInDown {
  animation: fadeInDown 0.6s ease forwards;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.6s ease forwards;
}

.animate-fadeInRight {
  animation: fadeInRight 0.6s ease forwards;
}

/* Scale Animation */
.animate-scaleIn {
  animation: scaleIn 0.5s ease forwards;
}

/* Bounce Animation */
.animate-bounce {
  animation: bounce 1s ease infinite;
}

/* Float Animation */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* Pulse Animation */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Glow Animation */
.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ============================================
   3. ANIMATION DELAYS
   ============================================ */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

.delay-600 {
  animation-delay: 0.6s;
}

.delay-700 {
  animation-delay: 0.7s;
}

.delay-800 {
  animation-delay: 0.8s;
}

.delay-900 {
  animation-delay: 0.9s;
}

.delay-1000 {
  animation-delay: 1s;
}

/* ============================================
   4. HOVER EFFECTS
   ============================================ */

/* Lift Effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Scale Effect */
.hover-scale {
  transition: transform 0.3s ease;
}

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

/* Rotate Effect */
.hover-rotate {
  transition: transform 0.3s ease;
}

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

/* Shine Effect */
.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.hover-shine:hover::before {
  left: 100%;
}

/* Glow Effect on Hover */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
}

/* Border Glow Effect */
.hover-border-glow {
  position: relative;
  transition: all 0.3s ease;
}

.hover-border-glow::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #ff6b35, #ff4757);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hover-border-glow:hover::after {
  opacity: 1;
}

/* ============================================
   5. SCROLL REVEAL ANIMATIONS
   ============================================ */

/* Elements that will be revealed on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

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

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   6. BUTTON ANIMATIONS
   ============================================ */

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

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

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

/* Button Arrow Animation */
.btn-arrow i {
  transition: transform 0.3s ease;
}

.btn-arrow:hover i {
  transform: translateX(5px);
}

/* ============================================
   7. LOADING ANIMATIONS
   ============================================ */

/* Dots Loading */
.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

/* Spinner Loading */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 107, 53, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ============================================
   8. TEXT ANIMATIONS
   ============================================ */

/* Typing Effect (requires JS) */
.typing-text {
  border-right: 2px solid var(--primary-color);
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* Gradient Text Animation */
.animated-gradient-text {
  background: linear-gradient(
    90deg,
    #ff6b35,
    #ff4757,
    #ff8c42,
    #ff6b35
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

/* ============================================
   9. IMAGE ANIMATIONS
   ============================================ */

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

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

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

/* Image Tilt Effect */
.img-tilt {
  transition: transform 0.3s ease;
}

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

/* ============================================
   10. COUNTER ANIMATION STYLES
   ============================================ */

/* Counter numbers will be animated via JS */
.counter-animated {
  display: inline-block;
  transition: all 0.3s ease;
}

/* ============================================
   11. PRELOADER VARIATIONS
   ============================================ */

/* Preloader Fade Out */
.preloader-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Alternative Preloader - Bars */
.loader-bars {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.loader-bars span {
  width: 4px;
  height: 30px;
  background: var(--primary-color);
  animation: bars 1s ease-in-out infinite;
}

.loader-bars span:nth-child(1) { animation-delay: 0s; }
.loader-bars span:nth-child(2) { animation-delay: 0.1s; }
.loader-bars span:nth-child(3) { animation-delay: 0.2s; }
.loader-bars span:nth-child(4) { animation-delay: 0.3s; }
.loader-bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes bars {
  0%, 100% {
    transform: scaleY(1);
  }
  50% {
    transform: scaleY(2);
  }
}

/* ============================================
   12. REDUCED MOTION SUPPORT
   ============================================ */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .floating-card {
    animation: none;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
