/* ═══════════════════════════════════════════════════════════════
   Dube Auto Detail — Premium Animation System
   GPU-accelerated, cinematic, luxury automotive feel
═══════════════════════════════════════════════════════════════ */

/* ─── KEYFRAMES ────────────────────────────────────────────── */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeLeft {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeRight {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes blurIn {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}
@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
@keyframes sweepRight {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes borderGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(217, 43, 43, 0);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(217, 43, 43, 0.2);
  }
}

/* ─── BASE REVEAL SYSTEM ───────────────────────────────────── */
/* Elements with data-anim start invisible and animate in via JS observer */

[data-anim] {
  opacity: 1; /* Default to visible for progressive enhancement */
  will-change: transform, opacity;
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}
[data-anim].is-visible {
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-duration: 0.8s;
}

/* Directional variants */
[data-anim="fade-up"].is-visible {
  animation-name: fadeUp;
}
[data-anim="fade-down"].is-visible {
  animation-name: fadeDown;
}
[data-anim="fade-left"].is-visible {
  animation-name: fadeLeft;
}
[data-anim="fade-right"].is-visible {
  animation-name: fadeRight;
}
[data-anim="scale-in"].is-visible {
  animation-name: scaleIn;
}
[data-anim="blur-in"].is-visible {
  animation-name: blurIn;
}

/* Stagger delays — apply to children  */
[data-anim].delay-1 {
  animation-delay: 0.05s;
}
[data-anim].delay-2 {
  animation-delay: 0.12s;
}
[data-anim].delay-3 {
  animation-delay: 0.2s;
}
[data-anim].delay-4 {
  animation-delay: 0.3s;
}
[data-anim].delay-5 {
  animation-delay: 0.42s;
}
[data-anim].delay-6 {
  animation-delay: 0.55s;
}
[data-anim].delay-7 {
  animation-delay: 0.7s;
}

/* Stagger speed variants */
[data-anim].anim-fast {
  animation-duration: 0.5s;
}
[data-anim].anim-slow {
  animation-duration: 1.1s;
}

/* ─── SECTION HEADERS ──────────────────────────────────────── */
.section-eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}

/* ─── BUTTON EFFECTS ───────────────────────────────────────── */
.btn--red,
.nav-cta {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.3s ease;
}
.btn--red::after,
.nav-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}
.btn--red:hover::after,
.nav-cta:hover::after {
  transform: translateX(100%);
}
.btn--red:hover,
.nav-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(217, 43, 43, 0.45);
}
.btn--red:active {
  transform: translateY(-1px);
}

/* ─── HOVER UTILITY CLASSES ───────────────────────────────── */
.hover-lift {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.hover-glow {
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
}
.hover-glow:hover {
  box-shadow:
    0 0 0 2px var(--red),
    0 12px 40px rgba(217, 43, 43, 0.2);
  transform: translateY(-3px);
}

.hover-shine {
  position: relative;
  overflow: hidden;
}
.hover-shine::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.25) 100%
  );
  transform: skewX(-25deg);
  transition: left 0.55s ease;
  z-index: 1;
  pointer-events: none;
}
.hover-shine:hover::before {
  left: 125%;
}

.hover-zoom-img img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.hover-zoom-img:hover img {
  transform: scale(1.06);
}

/* ─── CARD EFFECTS ─────────────────────────────────────────── */
.card-animate {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  border: 1px solid transparent;
}
.card-animate:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  border-color: rgba(217, 43, 43, 0.25);
}

/* Dark card variant */
.card-animate-dark {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.card-animate-dark:hover {
  transform: translateY(-8px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(217, 43, 43, 0.3);
  border-color: rgba(217, 43, 43, 0.3);
}

/* ─── IMAGE REVEAL OVERLAY ─────────────────────────────────── */
.img-reveal {
  position: relative;
  overflow: hidden;
}
.img-reveal::after {
  display: none; /* Disabled to avoid blocking visibility */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--black);
  transform-origin: left;
  transform: scaleX(1);
  transition: transform 0.85s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 1;
}
.img-reveal.is-visible::after {
  transform: scaleX(0);
  transform-origin: right;
}

/* ─── NAV LINK ANIMATIONS ──────────────────────────────────── */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* ─── FLOATING ACCENT ───────────────────────────────────────── */
.float-anim {
  animation: float 4s ease-in-out infinite;
}

/* ─── HERO LAYERED ENTRANCE ─────────────────────────────────── */
.hero__eyebrow {
  animation: slideDown 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

/* ─── GALLERY GRID ITEMS ────────────────────────────────────── */
.gallery-item,
.insta-item {
  overflow: hidden;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
}
.gallery-item img,
.insta-item img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-item:hover,
.insta-item:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}
.gallery-item:hover img,
.insta-item:hover img {
  transform: scale(1.08);
}

/* ─── COUNTER ANIMATION ─────────────────────────────────────── */
.stat-number {
  display: inline-block;
  transition: color 0.3s ease;
}

/* ─── TESTIMONIAL CARDS ─────────────────────────────────────── */
.testimonial-card {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

/* ─── PRICING CARD ──────────────────────────────────────────── */
.pricing-card {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}
.pricing-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.15);
}

/* ─── FAQ ACCORDION ─────────────────────────────────────────── */
.faq-item {
  transition: border-color 0.25s ease;
}
.faq-item:hover {
  border-color: var(--red);
}

/* ─── FORM INPUT FOCUS ──────────────────────────────────────── */
.input-field {
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}
.input-field:focus {
  transform: translateY(-1px);
}

/* ─── SCROLL PROGRESS BAR ───────────────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--red);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ─── PREFERS REDUCED MOTION ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-anim],
  .hover-lift,
  .hover-glow,
  .hover-shine,
  .hover-zoom-img,
  .card-animate,
  .card-animate-dark,
  .img-reveal::after,
  .float-anim,
  .gallery-item,
  .insta-item,
  .btn--red,
  .nav-cta {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  [data-anim] {
    opacity: 1;
  }
  .img-reveal::after {
    display: none;
  }
}

/* ─── MOBILE ADJUSTMENTS ────────────────────────────────────── */
@media (max-width: 768px) {
  [data-anim].is-visible {
    animation-duration: 0.6s;
  }
  .hover-lift:hover,
  .hover-glow:hover,
  .card-animate:hover,
  .card-animate-dark:hover {
    transform: none;
  }
  .btn--red:hover {
    transform: none;
    box-shadow: none;
  }
}
