/* ============================================
   ROTA BRASILIS — Animations & Transitions
   ============================================ */

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

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

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

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

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

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

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

/* Stagger children animations */
.stagger-children .reveal:nth-child(1) { transition-delay: 0s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.5s; }

/* --- Hero Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.hero-content .label {
  animation: fadeInUp 0.8s ease forwards;
}

.hero-content h1 {
  animation: fadeInUp 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero-content p {
  animation: fadeInUp 0.8s ease 0.4s forwards;
  opacity: 0;
}

.hero-buttons {
  animation: fadeInUp 0.8s ease 0.6s forwards;
  opacity: 0;
}

/* --- Counter Animation --- */
.stat-number {
  transition: all 0.3s ease;
}

/* --- Testimonial Carousel --- */
.testimonial-carousel {
  position: relative;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.testimonial-slide {
  min-width: 100%;
  padding: 0 var(--space-md);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--light-gray);
  transition: all var(--transition-base);
  cursor: pointer;
}

.carousel-dot.active {
  background: var(--gold);
  width: 30px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--pure-white);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  transition: all var(--transition-base);
  z-index: 2;
}

.carousel-arrow:hover {
  background: var(--gold);
  color: var(--primary-blue);
}

.carousel-arrow-prev { left: -24px; }
.carousel-arrow-next { right: -24px; }

/* --- Accordion Animation --- */
.accordion-body {
  transition: max-height 0.4s cubic-bezier(0.25, 0.1, 0.25, 1),
              padding 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Hover Effects --- */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(46, 134, 171, 0.2);
}

/* --- Gold underline animation --- */
.gold-underline {
  position: relative;
  display: inline-block;
}

.gold-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.4s ease;
}

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

/* --- Page Transition --- */
.page-transition {
  animation: fadeIn 0.5s ease;
}

/* --- Loading skeleton --- */
.skeleton {
  background: linear-gradient(90deg, var(--light-gray) 25%, var(--warm-sand) 50%, var(--light-gray) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* --- Parallax subtle effect --- */
.parallax-slow {
  will-change: transform;
}

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

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

  html {
    scroll-behavior: auto;
  }
}
