/* ============================================================
   QueenTM Cleaning Services — Animations System
   ============================================================ */

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */

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

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse-gold {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(201, 168, 76, 0);
  }
}

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

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

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

@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes line-grow {
  from { width: 0; }
  to   { width: 60px; }
}

@keyframes border-flash {
  0%, 100% { border-color: rgba(201,168,76,0.2); }
  50%       { border-color: rgba(201,168,76,0.5); }
}

/* ============================================================
   SCROLL-TRIGGERED ANIMATION CLASSES
   ============================================================ */

/* Initial hidden states */
.anim-fade-up,
.anim-fade-in,
.anim-fade-left,
.anim-fade-right,
.anim-scale-in {
  opacity: 0;
  will-change: opacity, transform;
}

.anim-fade-up    { transform: translateY(28px); }
.anim-fade-left  { transform: translateX(-28px); }
.anim-fade-right { transform: translateX(28px); }
.anim-scale-in   { transform: scale(0.92); }

/* Animated (visible) state */
.anim-fade-up.animated {
  animation: fadeUp var(--duration-lg) var(--ease-out) both;
}
.anim-fade-in.animated {
  animation: fadeIn var(--duration-lg) var(--ease-out) both;
}
.anim-fade-left.animated {
  animation: fadeLeft var(--duration-lg) var(--ease-out) both;
}
.anim-fade-right.animated {
  animation: fadeRight var(--duration-lg) var(--ease-out) both;
}
.anim-scale-in.animated {
  animation: scaleIn var(--duration-lg) var(--ease-out) both;
}

/* Staggered delay utilities */
.delay-1 { animation-delay: 80ms !important; }
.delay-2 { animation-delay: 160ms !important; }
.delay-3 { animation-delay: 240ms !important; }
.delay-4 { animation-delay: 320ms !important; }
.delay-5 { animation-delay: 400ms !important; }
.delay-6 { animation-delay: 480ms !important; }

/* ============================================================
   HERO ENTRANCE ANIMATIONS (Auto-play on load)
   ============================================================ */

.hero-badge {
  animation: fadeUp 0.7s 0.15s var(--ease-out) both;
}

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

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

.hero-actions {
  animation: fadeUp 0.8s 0.50s var(--ease-out) both;
}

.hero-trust-row {
  animation: fadeUp 0.8s 0.62s var(--ease-out) both;
}

/* ============================================================
   FLOATING BADGE ANIMATION
   ============================================================ */
.about-badge-float {
  animation: float 4s ease-in-out infinite;
}

/* ============================================================
   GOLD SHIMMER — For badges & highlights
   ============================================================ */
.shimmer-gold {
  background: linear-gradient(
    90deg,
    var(--color-gold) 0%,
    var(--color-gold-light) 40%,
    var(--color-gold) 60%,
    var(--color-gold-light) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* ============================================================
   GOLD LINE ANIMATION (Section labels)
   ============================================================ */
.gold-line.animated {
  animation: line-grow 0.6s var(--ease-out) both;
}

/* ============================================================
   COUNTER ANIMATION
   ============================================================ */
.counter-animated {
  animation: count-up 0.6s var(--ease-out) both;
}

/* ============================================================
   NAV TRANSITION
   ============================================================ */
.nav {
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

/* ============================================================
   BUTTON RIPPLE EFFECT
   ============================================================ */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(0);
  animation: ripple-expand 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-expand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================================
   CARD HOVER MICRO-ANIMATIONS
   ============================================================ */
.service-card,
.why-card,
.testimonial-card {
  will-change: transform;
}

/* Process step icon pulse on section enter */
.process-step.animated .process-step-icon {
  animation: scaleIn 0.5s var(--ease-spring) both;
}

/* ============================================================
   SCROLL PROGRESS BAR
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-gold);
  z-index: 2000;
  width: 0%;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================================
   PAGE TRANSITION OVERLAY
   ============================================================ */
.page-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-navy);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-overlay.entering {
  opacity: 1;
  pointer-events: all;
}

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

  .about-badge-float {
    animation: none;
  }
}
