/* 
 * Animations CSS for Finest At Sea website
 * Adds animation effects to elements with the animate-on-scroll class
 */

/* Base animation styles */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: relative;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations for multiple elements */
.feature-box.animate-on-scroll:nth-child(1),
.product-card.animate-on-scroll:nth-child(1),
.fleet-item.animate-on-scroll:nth-child(1),
.timeline-item.animate-on-scroll:nth-child(1) {
  transition-delay: 0.1s;
}

.feature-box.animate-on-scroll:nth-child(2),
.product-card.animate-on-scroll:nth-child(2),
.fleet-item.animate-on-scroll:nth-child(2),
.timeline-item.animate-on-scroll:nth-child(2) {
  transition-delay: 0.2s;
}

.feature-box.animate-on-scroll:nth-child(3),
.product-card.animate-on-scroll:nth-child(3),
.fleet-item.animate-on-scroll:nth-child(3),
.timeline-item.animate-on-scroll:nth-child(3) {
  transition-delay: 0.3s;
}

.feature-box.animate-on-scroll:nth-child(4),
.product-card.animate-on-scroll:nth-child(4),
.fleet-item.animate-on-scroll:nth-child(4),
.timeline-item.animate-on-scroll:nth-child(4) {
  transition-delay: 0.4s;
}

/* Fade in animation */
.fade-in {
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide in animations */
.slide-in-left {
  animation: slideInLeft 1s ease forwards;
}

.slide-in-right {
  animation: slideInRight 1s ease forwards;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Hover animations */
.feature-box:hover,
.product-card:hover,
.fleet-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-color 0.3s ease;
}

/* Timeline animations */
.timeline-item {
  position: relative;
}

.timeline-marker {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.timeline-item:hover .timeline-marker {
  transform: scale(1.1);
  background-color: var(--bright-teal);
}

/* Responsive adjustments for animations */
@media screen and (max-width: 768px) {
  .animate-on-scroll {
    transform: translateY(20px);
  }
}

@media screen and (max-width: 576px) {
  .feature-box.animate-on-scroll,
  .product-card.animate-on-scroll,
  .fleet-item.animate-on-scroll,
  .timeline-item.animate-on-scroll {
    transition-delay: 0.1s;
  }
}
