/* ============================================================
   MK DÉPANNAGE AUTO — animations.css
   Shared animation utilities + keyframes
   ============================================================ */

/* ── Reveal on scroll (base states) ── */
.reveal {
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.js-ready .reveal { opacity: 0; transform: translateY(50px); }
.reveal.in-view { opacity: 1 !important; transform: translateY(0) !important; }

.reveal-left { transition: opacity 0.7s ease, transform 0.7s ease; }
.js-ready .reveal-left { opacity: 0; transform: translateX(-50px); }
.reveal-left.in-view { opacity: 1 !important; transform: translateX(0) !important; }

.reveal-right { transition: opacity 0.7s ease, transform 0.7s ease; }
.js-ready .reveal-right { opacity: 0; transform: translateX(50px); }
.reveal-right.in-view { opacity: 1 !important; transform: translateX(0) !important; }

.reveal-scale { transition: opacity 0.6s ease, transform 0.6s ease; }
.js-ready .reveal-scale { opacity: 0; transform: scale(0.85); }
.reveal-scale.in-view { opacity: 1 !important; transform: scale(1) !important; }

/* ── Stagger delays ── */
.stagger-1  { transition-delay: 0.05s; }
.stagger-2  { transition-delay: 0.10s; }
.stagger-3  { transition-delay: 0.15s; }
.stagger-4  { transition-delay: 0.20s; }
.stagger-5  { transition-delay: 0.25s; }
.stagger-6  { transition-delay: 0.30s; }

/* ── Floating entrance ── */
@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.float-up { animation: floatUp 0.7s cubic-bezier(0.4,0,0.2,1) both; }

/* ── Magnetic button effect (JS handles mouse tracking, CSS defines base) ── */
.magnetic {
  display: inline-flex;
  will-change: transform;
}

/* ── Ripple on click ── */
.ripple-wrap { position: relative; overflow: hidden; }
.ripple-wave {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0); pointer-events: none;
  animation: rippleAnim 0.6s linear forwards;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ── Glow pulse ── */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255,215,0,0.2); }
  50%       { box-shadow: 0 0 40px rgba(255,215,0,0.5); }
}
.glow-pulse { animation: glowPulse 2.5s ease-in-out infinite; }

/* ── Text shimmer ── */
@keyframes textShimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
.text-shimmer {
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--yellow));
  background-size: 200% auto;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 3s linear infinite;
}

/* ── Siren pulse (depannage) ── */
@keyframes sirenPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(230,48,48,0.5); color: var(--red); }
  50%       { text-shadow: 0 0 40px rgba(230,48,48,1);   color: #ff6b6b; }
}
.siren-pulse { animation: sirenPulse 0.8s ease-in-out infinite; }

/* ── Spin slow ── */
@keyframes spinSlow { to { transform: rotate(360deg); } }
.spin-slow { animation: spinSlow 8s linear infinite; }

/* ── Bounce dot ── */
@keyframes bounceDot {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}

/* ── Gradient shift background ── */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

/* ── Draw underline ── */
@keyframes drawLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ── Card hover glow ── */
.card-glow {
  transition: box-shadow 0.4s ease, transform 0.3s ease;
}
.card-glow:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,215,0,0.15);
  transform: translateY(-6px);
}

/* ── Number count-up base ── */
.count-up { font-variant-numeric: tabular-nums; }

/* ── Flip in (for cards) ── */
@keyframes flipIn {
  from { opacity: 0; transform: perspective(600px) rotateX(20deg) translateY(30px); }
  to   { opacity: 1; transform: perspective(600px) rotateX(0) translateY(0); }
}
.flip-in { animation: flipIn 0.6s ease both; }

/* ── Slide in from right ── */
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-in-right { animation: slideInRight 0.5s cubic-bezier(0.4,0,0.2,1) both; }

/* ── Slide in from left ── */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-in-left { animation: slideInLeft 0.5s cubic-bezier(0.4,0,0.2,1) both; }

/* ── Fade in ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.fade-in { animation: fadeIn 0.5s ease both; }

/* ── Scale pop ── */
@keyframes scalePop {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}
.scale-pop { animation: scalePop 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }

/* ── Shake (error) ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-10px); }
  40%       { transform: translateX(10px); }
  60%       { transform: translateX(-8px); }
  80%       { transform: translateX(8px); }
}
.shake { animation: shake 0.5s cubic-bezier(0.36,0.07,0.19,0.97) both; }

/* ── Loading spinner ── */
@keyframes spinnerRotate { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: var(--yellow);
  animation: spinnerRotate 0.7s linear infinite;
  display: inline-block;
}

/* ── Typing cursor ── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
.typing-cursor::after {
  content: '|'; color: var(--yellow);
  animation: blink 1s step-end infinite;
}

/* ── Particles (particles.js override) ── */
#particles-js canvas, #particles-dep canvas, #particles-counters canvas {
  position: absolute !important;
  inset: 0 !important;
}
