/* ============================================================
   NexveraQR — Design System A: "Command"
   Panel Animations (Keyframes & Utility Classes)
   ============================================================ */

/* ── Keyframes ── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(24px); }
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95) translateY(20px); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1) translateY(0); }
}

@keyframes progressBar {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── Utility Classes ── */

.animate-fade-in {
  animation: fadeIn 300ms ease-out both;
}

.animate-fade-out {
  animation: fadeOut 200ms ease-in both;
}

.animate-slide-up {
  animation: slideUp 300ms ease-out both;
}

.animate-slide-down {
  animation: slideDown 300ms ease-out both;
}

.animate-slide-right {
  animation: slideRight 300ms ease-out both;
}

.animate-slide-left {
  animation: slideLeft 300ms ease-out both;
}

.animate-scale-in {
  animation: scaleIn 200ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.animate-spin {
  animation: spin 0.6s linear infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.animate-bounce {
  animation: bounce 0.4s ease both;
}

/* ── Stagger delays (for lists) ── */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }
.stagger-7 { animation-delay: 350ms; }
.stagger-8 { animation-delay: 400ms; }

/* ── Transition utilities ── */
.transition-all {
  transition: all var(--cp-transition);
}

.transition-colors {
  transition: color var(--cp-transition),
              background-color var(--cp-transition),
              border-color var(--cp-transition);
}

.transition-transform {
  transition: transform var(--cp-transition);
}

.transition-opacity {
  transition: opacity var(--cp-transition);
}

/* ── Loading spinner ── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--cp-border);
  border-top-color: var(--cp-gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

/* ── Page loading bar ── */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cp-gold), var(--cp-gold-light));
  z-index: 9999;
  animation: progressBar 2s ease-in-out;
  border-radius: 0 2px 2px 0;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .skeleton {
    animation: none;
  }

  .spinner {
    animation: none;
    border-top-color: var(--cp-gold);
    opacity: 0.7;
  }
}
