/* ============================================================
   JAMMU LOGISTICS — ANIMATIONS CSS
   Scroll animations, hover effects, micro-interactions
   ============================================================ */

/* ---- Scroll-triggered animations (base hidden state) ---- */
[data-animate] {
  opacity: 0;
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

[data-animate="fade-up"] {
  transform: translateY(40px);
}

[data-animate="fade-down"] {
  transform: translateY(-40px);
}

[data-animate="fade-left"] {
  transform: translateX(-40px);
}

[data-animate="fade-right"] {
  transform: translateX(40px);
}

[data-animate="scale-up"] {
  transform: scale(0.88);
}

[data-animate="fade"] {
  transform: none;
}

/* Visible state */
[data-animate].is-visible {
  opacity: 1;
  transform: none !important;
}

/* Staggered children */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

[data-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms;   opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(2) { transition-delay: 80ms;  opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(3) { transition-delay: 160ms; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(4) { transition-delay: 240ms; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(5) { transition-delay: 320ms; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(6) { transition-delay: 400ms; opacity: 1; transform: none; }
[data-stagger].is-visible > *:nth-child(n+7) { transition-delay: 480ms; opacity: 1; transform: none; }

/* ---- Hero entrance animation ---- */
.hero-headline {
  animation: heroIn 0.8s var(--ease-out) 0.1s both;
}

.hero-subtext {
  animation: heroIn 0.8s var(--ease-out) 0.25s both;
}

.hero-ctas {
  animation: heroIn 0.8s var(--ease-out) 0.4s both;
}

.hero-trust-chips {
  animation: heroIn 0.8s var(--ease-out) 0.55s both;
}

.hero-visual {
  animation: heroVisual 1s var(--ease-out) 0.2s both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}

@keyframes heroVisual {
  from { opacity: 0; transform: translateX(32px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* ---- Pulse for CTA button ---- */
@keyframes pulseCta {
  0%   { box-shadow: 0 0 0 0 hsla(24, 95%, 52%, 0.5); }
  70%  { box-shadow: 0 0 0 14px hsla(24, 95%, 52%, 0); }
  100% { box-shadow: 0 0 0 0 hsla(24, 95%, 52%, 0); }
}

.btn--pulse {
  animation: pulseCta 2s ease-in-out infinite;
}

/* ---- Spin animation (for loader icon) ---- */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Shimmer (skeleton loading) ---- */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.shimmer {
  background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-alt) 50%, var(--color-surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ---- Counter number animation ---- */
.stat-counter {
  transition: none;
}

/* ---- Card hover lift (enhanced) ---- */
.service-card,
.feature-card,
.testimonial-card {
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}

.service-card:hover,
.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

/* ---- Icon bounce on hover ---- */
.icon-bounce {
  transition: transform var(--duration-base) var(--ease-out);
}

.card:hover .icon-bounce,
a:hover .icon-bounce {
  transform: translateY(-4px) scale(1.08);
}

/* ---- Arrow slide on hover ---- */
.arrow-slide {
  transition: transform var(--duration-fast) var(--ease-out);
  display: inline-block;
}

a:hover .arrow-slide,
button:hover .arrow-slide {
  transform: translateX(5px);
}

/* ---- Progress bar animation ---- */
@keyframes progressBar {
  from { width: 0; }
}

/* ---- Accordion transition ---- */
.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-slow) var(--ease-out),
              padding var(--duration-slow) var(--ease-out),
              opacity var(--duration-slow) var(--ease-out);
  opacity: 0;
}

.faq-item.is-open .faq-answer {
  max-height: 500px;
  opacity: 1;
}

/* ---- Mobile menu slide ---- */
.mobile-menu {
  transform: translateX(-100%);
  transition: transform var(--duration-slow) var(--ease-out);
}

.mobile-menu.is-open {
  transform: translateX(0);
}

/* ---- Overlay fade ---- */
.overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-out);
}

.overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

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

  [data-animate],
  [data-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
