/* Animations for JJD Website */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide up animation */
@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide in from left animation */
@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Slide in from right animation */
@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Scale up animation */
@keyframes scaleUp {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Apply animations to elements */

/* Header animations */
.site-header {
  animation: fadeIn 0.8s ease-out forwards;
}

.logo {
  animation: slideInLeft 0.8s ease-out 0.2s both;
}

.nav-links {
  animation: fadeIn 1s ease-out 0.4s both;
}

.header-contact {
  animation: slideInRight 0.8s ease-out 0.2s both;
}

/* Hero section animations */
.main-heading {
  animation: slideUp 1s ease-out 0.6s both;
}

.subtitle {
  animation: slideUp 1s ease-out 0.8s both;
}

.hero-text .button-outline {
  animation: fadeIn 1s ease-out 1s both;
}

/* Image gallery animations */
.gallery-item:nth-child(1) {
  animation: scaleUp 0.8s ease-out 1s both;
}

.gallery-item:nth-child(2) {
  animation: scaleUp 0.8s ease-out 1.2s both;
}

.gallery-item:nth-child(3) {
  animation: scaleUp 0.8s ease-out 1.4s both;
}

.gallery-item:nth-child(4) {
  animation: scaleUp 0.8s ease-out 1.6s both;
}

/* Dark section animations */
.dark-heading {
  animation: slideInLeft 0.8s ease-out both;
  animation-play-state: paused;
}

.dark-subtitle {
  animation: fadeIn 1s ease-out 0.2s both;
  animation-play-state: paused;
}

.card {
  animation: slideUp 0.8s ease-out both;
  animation-play-state: paused;
}

.card:nth-child(1) {
  animation-delay: 0.2s;
}

.card:nth-child(2) {
  animation-delay: 0.4s;
}

.card:nth-child(3) {
  animation-delay: 0.6s;
}

/* Business section animations */
.business-heading {
  animation: slideUp 0.8s ease-out both;
  animation-play-state: paused;
}

.business-text {
  animation: fadeIn 1s ease-out 0.3s both;
  animation-play-state: paused;
}

.business-image {
  animation: scaleUp 1s ease-out 0.5s both;
  animation-play-state: paused;
}

/* Stats animations */
.stat-item {
  animation: slideUp 0.8s ease-out both;
  animation-play-state: paused;
}

.stat-item:nth-child(1) {
  animation-delay: 0.1s;
}

.stat-item:nth-child(2) {
  animation-delay: 0.2s;
}

.stat-item:nth-child(3) {
  animation-delay: 0.3s;
}

.stat-item:nth-child(4) {
  animation-delay: 0.4s;
}

/* Testimonial animations */
.testimonial-item {
  animation: fadeIn 1s ease-out both;
  animation-play-state: paused;
}

/* Intersection Observer to trigger animations when elements are in view */
.animate-on-scroll {
  animation-play-state: paused;
}

.animate-on-scroll.in-view {
  animation-play-state: running;
}
