/* BOLO - Animations CSS */

/* Base animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

/* Animation classes for JS-controlled elements */
.animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.fadeIn.animated {
  animation-name: fadeIn;
}

.fadeInUp.animated {
  animation-name: fadeInUp;
}

.fadeInDown.animated {
  animation-name: fadeInDown;
}

.fadeInLeft.animated {
  animation-name: fadeInLeft;
}

.fadeInRight.animated {
  animation-name: fadeInRight;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Animation Classes */
.initially-hidden {
  opacity: 0;
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
  animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s ease forwards;
}

.pulse {
  animation: pulse 2s infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

.spin {
  animation: spin 1s linear infinite;
}

/* Staggered animations */
.stagger-fade-in > * {
  opacity: 0;
}

.stagger-fade-in.animated > *:nth-child(1) {
  animation: fadeIn 0.5s ease forwards 0.1s;
}

.stagger-fade-in.animated > *:nth-child(2) {
  animation: fadeIn 0.5s ease forwards 0.2s;
}

.stagger-fade-in.animated > *:nth-child(3) {
  animation: fadeIn 0.5s ease forwards 0.3s;
}

.stagger-fade-in.animated > *:nth-child(4) {
  animation: fadeIn 0.5s ease forwards 0.4s;
}

.stagger-fade-in.animated > *:nth-child(5) {
  animation: fadeIn 0.5s ease forwards 0.5s;
}

.stagger-fade-in.animated > *:nth-child(n+6) {
  animation: fadeIn 0.5s ease forwards 0.6s;
}

/* Hover animations */
.hover-active {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

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

.social-hover {
  transform: translateY(-3px) rotate(5deg);
}

/* Button animations */
.btn-primary:hover {
  animation: pulse 0.5s ease;
}

/* Footer animations */
.footer-animate {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

/* Timeline animations */
.timeline-hidden {
  opacity: 0;
  transform: translateY(30px);
}

.timeline-visible {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s ease;
}

/* Loading animations */
.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(0, 109, 170, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

/* Newsletter form animations */
.footer-newsletter-form.success .footer-newsletter-button {
  background-color: var(--success);
}

.footer-newsletter-form.error .footer-newsletter-input {
  border-color: var(--danger);
}

.newsletter-thank-you {
  background: var(--success);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  animation: fadeIn 0.3s ease;
}

/* Featured carousel animations */
.featured-carousel {
  position: relative;
  overflow: hidden;
}

.featured-slide {
  transition: transform 0.5s ease;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 0.5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: var(--primary);
  transform: scale(1.2);
}

.carousel-prev,
.carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.featured-carousel:hover .carousel-prev,
.featured-carousel:hover .carousel-next {
  opacity: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

/* Page transition */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  z-index: 9999;
  transform: translateX(-100%);
}

.page-transitioning .page-transition {
  animation: pageTransition 1s ease-in-out forwards;
}

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

/* Mobile optimizations */
@media (max-width: 768px) {
  .carousel-prev,
  .carousel-next {
    width: 30px;
    height: 30px;
  }
  
  .loading-spinner {
    width: 25px;
    height: 25px;
  }
}