/* ==========================================
   UTILITIES — Animations & Helpers
   ========================================== */

/* Fade-in animations */
.animate-fade-in-up {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-fade-in-down {
  opacity: 0;
  transform: translateY(-16px);
  animation: fadeInDown 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-slide-in-left {
  opacity: 0;
  transform: translateX(-16px);
  animation: slideInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-slide-in-right {
  opacity: 0;
  transform: translateX(16px);
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.animate-scale-in {
  opacity: 0;
  transform: scale(0.95);
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes slideInLeft {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  to { opacity: 1; transform: scale(1); }
}

/* Stagger animations for card grids */
.animate-fade-in-up:nth-child(1) { animation-delay: 0.05s; }
.animate-fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.animate-fade-in-up:nth-child(3) { animation-delay: 0.15s; }
.animate-fade-in-up:nth-child(4) { animation-delay: 0.2s; }
.animate-fade-in-up:nth-child(5) { animation-delay: 0.25s; }
.animate-fade-in-up:nth-child(6) { animation-delay: 0.3s; }
.animate-fade-in-up:nth-child(7) { animation-delay: 0.35s; }
.animate-fade-in-up:nth-child(8) { animation-delay: 0.4s; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--imo-gray-100) 25%, var(--imo-gray-200) 50%, var(--imo-gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--imo-radius);
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--imo-gray-200);
  border-top-color: var(--imo-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Hover lift */
.hover-lift { transition: var(--imo-transition); }
.hover-lift:hover { transform: translateY(-3px); box-shadow: var(--imo-shadow-md); }

/* Text truncation */
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Shadows */
.shadow-sm { box-shadow: var(--imo-shadow-sm); }
.shadow-soft { box-shadow: var(--imo-shadow); }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Gradients */
.text-gradient {
  background: linear-gradient(135deg, var(--imo-primary) 0%, var(--imo-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--imo-primary) 0%, var(--imo-primary-light) 100%);
}
.bg-gradient-dark {
  background: linear-gradient(135deg, var(--imo-primary) 0%, #0f0f1e 100%);
}

/* Glassmorphism helper */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Print */
@media print { .navbar,footer,.site-footer,.btn,.no-print { display: none; } body { background: #fff; color: #000; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
