/* =============================================
   ANIMATIONS.CSS — v1.0.0
   ServiHogar - Micro-animations & Transitions
   ============================================= */

/* ── Keyframes ─────────────────────────────── */

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.05); }
}

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

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(4); opacity: 0;   }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(108, 99, 255, 0.3); }
  50%       { box-shadow: 0 0 40px rgba(108, 99, 255, 0.7); }
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%;   }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%;   }
}

@keyframes bounceIn {
  0%   { transform: scale(0.3);  opacity: 0; }
  50%  { transform: scale(1.05); opacity: 1; }
  70%  { transform: scale(0.9);              }
  100% { transform: scale(1);                }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(0);    opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

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

/* ── Utility Animation Classes ─────────────── */

.animate-fadeInUp     { animation: fadeInUp 0.7s ease forwards; }
.animate-fadeInDown   { animation: fadeInDown 0.6s ease forwards; }
.animate-fadeIn       { animation: fadeIn 0.5s ease forwards; }
.animate-slideInLeft  { animation: slideInLeft 0.7s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.7s ease forwards; }
.animate-scaleIn      { animation: scaleIn 0.5s ease forwards; }
.animate-float        { animation: float 3s ease-in-out infinite; }
.animate-pulse        { animation: pulse 2s ease-in-out infinite; }
.animate-glow         { animation: glowPulse 2s ease-in-out infinite; }

/* ── Scroll-Reveal (hidden until visible) ──── */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ── Delay helpers ──────────────────────────── */
.delay-100 { transition-delay: 0.1s; animation-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; animation-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; animation-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; animation-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; animation-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; animation-delay: 0.6s; }
.delay-700 { transition-delay: 0.7s; animation-delay: 0.7s; }
.delay-800 { transition-delay: 0.8s; animation-delay: 0.8s; }

/* ── Hero particles / orbs ──────────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}
.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(108,99,255,0.35) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation-duration: 7s;
}
.orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(255,101,132,0.25) 0%, transparent 70%);
  bottom: -80px; right: -80px;
  animation-duration: 9s;
  animation-delay: -3s;
}
.orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(79,195,247,0.2) 0%, transparent 70%);
  top: 50%; left: 60%;
  animation-duration: 11s;
  animation-delay: -5s;
}

/* ── Ripple on buttons ─────────────────────── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  width: 10px; height: 10px;
  margin-top: -5px; margin-left: -5px;
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ── Typewriter cursor ─────────────────────── */
.typewriter::after {
  content: '|';
  animation: pulse 1s step-end infinite;
  color: var(--color-primary);
}

/* ── Shimmer loading ───────────────────────── */
.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ── Gradient animated background ─────────── */
.gradient-animated {
  background: linear-gradient(270deg, #6C63FF, #FF6584, #4fc3f7, #6C63FF);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
}

/* ── Toast notification ────────────────────── */
.toast {
  animation: slideUp 0.4s ease forwards;
}
.toast.hiding {
  animation: slideDown 0.4s ease forwards;
}

/* ── Number counter ────────────────────────── */
.stat-number.counting {
  animation: countUp 0.5s ease forwards;
}
