/* ============================================
   PIXEL PRODUCTION — Animations & Transitions
   ============================================ */

/* ─── Page Transitions ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(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 pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50%      { box-shadow: 0 0 16px 4px rgba(139, 92, 246, 0.15); }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}

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

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

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

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

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

/* ─── Animation Utility Classes ─── */
.animate-fadeIn     { animation: fadeIn var(--transition-base) ease-out; }
.animate-fadeInUp   { animation: fadeInUp var(--transition-slow) ease-out; }
.animate-scaleIn    { animation: scaleIn var(--transition-base) ease-out; }
.animate-slideRight { animation: slideInRight var(--transition-slow) ease-out; }
.animate-slideDown  { animation: slideInDown var(--transition-base) ease-out; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-spin       { animation: spin 1s linear infinite; }
.animate-bounce     { animation: bounce 0.5s ease; }
.animate-shake      { animation: shake 0.4s ease; }

/* ─── Staggered Children ─── */
.stagger-children > * {
  animation: fadeInUp 0.4s ease-out both;
}
.stagger-children > *:nth-child(1)  { animation-delay: 0.02s; }
.stagger-children > *:nth-child(2)  { animation-delay: 0.04s; }
.stagger-children > *:nth-child(3)  { animation-delay: 0.06s; }
.stagger-children > *:nth-child(4)  { animation-delay: 0.08s; }
.stagger-children > *:nth-child(5)  { animation-delay: 0.10s; }
.stagger-children > *:nth-child(6)  { animation-delay: 0.12s; }
.stagger-children > *:nth-child(7)  { animation-delay: 0.14s; }
.stagger-children > *:nth-child(8)  { animation-delay: 0.16s; }
.stagger-children > *:nth-child(9)  { animation-delay: 0.18s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(11) { animation-delay: 0.22s; }
.stagger-children > *:nth-child(12) { animation-delay: 0.24s; }

/* ─── Hover Lift ─── */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ─── Glassmorphism Mixin ─── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* ─── Gradient Border ─── */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--primary-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition-base);
}
.gradient-border:hover::before {
  opacity: 1;
}

/* ─── Loading Skeleton ─── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ─── Tooltip ─── */
.tooltip {
  position: relative;
}
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  padding: 6px 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}
.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ─── Drag & Drop Visual States ─── */
.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  transition: all var(--transition-fast);
}

.drag-over {
  border: 2px dashed var(--primary) !important;
  background: var(--primary-subtle) !important;
  transform: scale(1.02);
  transition: all var(--transition-fast);
}

.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.9;
  transform: rotate(2deg);
  box-shadow: var(--shadow-xl);
}

/* ─── Notification Toast ─── */
.toast-enter {
  animation: notificationSlide 0.3s ease-out;
}
.toast-exit {
  animation: fadeOut 0.2s ease-out forwards;
}
