/* =========================================================
   ANIMATIONS.CSS — QuanLyGaraga UI/UX PRO MAX
   Tất cả @keyframes và helper animation classes
   ========================================================= */

/* ---- Keyframes ---- */

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

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

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

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

@keyframes slideLeft {
  from {
    opacity: 0.9;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes pulse-dot {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
    opacity: 0.72;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce-in {
  0%   { transform: scale(0.8); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  80%  { transform: scale(0.97); }
  100% { transform: scale(1); }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(32px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(32px) scale(0.94);
    max-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}

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

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(12, 158, 151, 0.2); }
  50%        { box-shadow: 0 0 0 10px rgba(12, 158, 151, 0); }
}

@keyframes ripple {
  from { transform: scale(0); opacity: 0.42; }
  to   { transform: scale(4); opacity: 0; }
}

@keyframes progress-bar {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ---- Skeleton Loading ---- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.64) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-text {
  height: 14px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 22px;
  width: 60%;
  border-radius: 8px;
  margin-bottom: 10px;
}

.skeleton-circle {
  border-radius: 50%;
}

/* ---- Animation Utility Classes ---- */

.animate-fade-up {
  animation: fadeInUp 0.32s cubic-bezier(0.22, 0.68, 0, 1.2) both;
}

.animate-scale-in {
  animation: scaleIn 0.22s cubic-bezier(0.22, 0.68, 0, 1.2) both;
}

.animate-slide-right {
  animation: slideRight 0.26s cubic-bezier(0.22, 0.68, 0, 1.2) both;
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

/* Stagger delays for lists */
.animate-stagger > *:nth-child(1) { animation-delay: 0ms; }
.animate-stagger > *:nth-child(2) { animation-delay: 50ms; }
.animate-stagger > *:nth-child(3) { animation-delay: 100ms; }
.animate-stagger > *:nth-child(4) { animation-delay: 150ms; }
.animate-stagger > *:nth-child(5) { animation-delay: 200ms; }
.animate-stagger > *:nth-child(6) { animation-delay: 250ms; }

/* ---- Transition Presets ---- */

.transition-fast { transition: all 0.14s ease; }
.transition-base { transition: all 0.22s ease; }
.transition-slow { transition: all 0.36s ease; }
.transition-spring { transition: all 0.32s cubic-bezier(0.22, 0.68, 0, 1.2); }

/* ---- Hover Lift ---- */

.hover-lift {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

/* ---- Pulse Badge ---- */

.pulse-badge {
  position: relative;
}

.pulse-badge::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ---- Loading Spinner ---- */

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(12, 158, 151, 0.18);
  border-top-color: #0c9e97;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
}
