/* ============================================
   TRICHY AMMU TRAVELS — Animations
   Micro-animations & scroll-triggered effects
   ============================================ */

/* ── Fade In Animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Staggered children */
.stagger-children>* {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.visible>* {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children.visible>*:nth-child(1) {
  transition-delay: 0.05s;
}

.stagger-children.visible>*:nth-child(2) {
  transition-delay: 0.08s;
}

.stagger-children.visible>*:nth-child(3) {
  transition-delay: 0.11s;
}

.stagger-children.visible>*:nth-child(4) {
  transition-delay: 0.14s;
}

.stagger-children.visible>*:nth-child(5) {
  transition-delay: 0.17s;
}

.stagger-children.visible>*:nth-child(6) {
  transition-delay: 0.20s;
}

.stagger-children.visible>*:nth-child(7) {
  transition-delay: 0.23s;
}

.stagger-children.visible>*:nth-child(8) {
  transition-delay: 0.26s;
}

.stagger-children.visible>*:nth-child(n+9) {
  transition-delay: 0.28s;
}

/* ── Counter Animation ── */
.counter-animate {
  display: inline-block;
}

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

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

.hover-scale {
  transition: transform var(--transition-base);
}

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

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

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

/* ── Shimmer Effect ── */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.1) 50%,
      transparent 100%);
  animation: shimmer 2s infinite;
}

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

  100% {
    transform: translateX(100%);
  }
}

/* ── Pulse Animation ── */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

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

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ── Spin Animation ── */
.spin {
  animation: spin 1s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

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

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

/* ── Text Reveal ── */
.text-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.18, 1);
}

.text-reveal.visible {
  clip-path: inset(0 0 0 0);
}

/* ── Image Parallax ── */
.parallax-bg {
  will-change: transform;
}

/* ── Hero Text Animation ── */
.hero-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  animation: word-reveal 0.6s ease forwards;
}

.hero-title .word:nth-child(1) {
  animation-delay: 0.1s;
}

.hero-title .word:nth-child(2) {
  animation-delay: 0.2s;
}

.hero-title .word:nth-child(3) {
  animation-delay: 0.3s;
}

.hero-title .word:nth-child(4) {
  animation-delay: 0.4s;
}

.hero-title .word:nth-child(5) {
  animation-delay: 0.5s;
}

.hero-title .word:nth-child(6) {
  animation-delay: 0.6s;
}

@keyframes word-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Number Count Up ── */
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Page Transition ── */
.page-transition-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* ── Typewriter Effect ── */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary-saffron);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes blink-caret {

  from,
  to {
    border-color: transparent;
  }

  50% {
    border-color: var(--primary-saffron);
  }
}

/* ── Marquee (Special Offers) ── */
.marquee {
  overflow: hidden;
  white-space: nowrap;
}

.marquee-content {
  display: inline-flex;
  animation: marquee 30s linear infinite;
}

.marquee-content:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

/* ── Ripple Effect (Buttons) ── */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.5s;
}

.ripple:active::after {
  transform: scale(0);
  opacity: 1;
  transition: 0s;
}

/* ── Fluid Scroll & Collapsing Header (Feature 21) ── */
.header.header-compact {
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  transition: all 0.25s ease-in-out !important;
}

.header.header-compact .header-logo img {
  height: 38px !important;
  width: 38px !important;
  transition: all 0.25s ease !important;
}

/* ── Micro-Interaction: Input Error Shake (Feature 19) ── */
@keyframes inputShake {

  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-6px);
  }

  40%,
  80% {
    transform: translateX(6px);
  }
}

.shake-error {
  animation: inputShake 0.4s ease-in-out !important;
  border-color: #dc2626 !important;
}

/* ── Micro-Interaction: Card Press Tactile Feedback (Feature 19) ── */
/* .card:active, .btn:active, .route-card:active {
  transform: scale(0.97) !important;
  transition: transform 0.1s ease !important;
} */

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in,
  .fade-in-left,
  .fade-in-right,
  .fade-in-up,
  .scale-in {
    opacity: 1;
    transform: none;
  }
}