/* ============================================================
   YOUSSIF DESIGN SYSTEM — animations.css
   Keyframes · Animation Classes · Motion Utilities
   ============================================================ */

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

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

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

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes scale-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}

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

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

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slide-out-right {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

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

@keyframes pulse-brand {
  0%, 100% { box-shadow: 0 0 0 0   rgba(90, 45, 140, 0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(90, 45, 140, 0); }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0   rgba(200, 146, 42, 0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(200, 146, 42, 0); }
}

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

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

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

@keyframes stagger-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in {
  animation: fade-in var(--duration-base) var(--ease-out) both;
}

.animate-fade-out {
  animation: fade-out var(--duration-fast) var(--ease-in) both;
}

.animate-scale-in {
  animation: scale-in var(--duration-base) var(--ease-spring) both;
}

.animate-slide-up {
  animation: slide-up var(--duration-slow) var(--ease-out) both;
}

.animate-slide-down {
  animation: slide-down var(--duration-base) var(--ease-out) both;
}

.animate-slide-in-right {
  animation: slide-in-right var(--duration-slow) var(--ease-out) both;
}

.animate-spin {
  animation: spin var(--duration-slower) linear infinite;
}

.animate-pulse-brand {
  animation: pulse-brand 2s ease-in-out infinite;
}

.animate-pulse-gold {
  animation: pulse-gold 2s ease-in-out infinite;
}

.animate-shimmer {
  animation: shimmer 1.5s linear infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* ── Stagger Delays (for list items) ─────────────────────── */
/* استخدام: أضف .stagger-item على كل عنصر في القائمة */
.stagger-item { animation: stagger-in var(--duration-base) var(--ease-out) both; }
.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 50ms; }
.stagger-item:nth-child(3) { animation-delay: 100ms; }
.stagger-item:nth-child(4) { animation-delay: 150ms; }
.stagger-item:nth-child(5) { animation-delay: 200ms; }

/* ── Transition Utilities ────────────────────────────────── */
.transition-base {
  transition: all var(--duration-base) var(--ease-smooth);
}

.transition-fast {
  transition: all var(--duration-fast) var(--ease-smooth);
}

.transition-slow {
  transition: all var(--duration-slow) var(--ease-smooth);
}

.transition-spring {
  transition: all var(--duration-base) var(--ease-spring);
}

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

.hover-lift-lg:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.hover-scale:hover {
  transform: scale(1.02);
}

.hover-glow:hover {
  box-shadow: var(--shadow-brand);
}

.hover-glow-gold:hover {
  box-shadow: var(--shadow-gold);
}

/* ── Reduced Motion Override ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [class*="animate-"],
  [class*="transition-"],
  [class*="hover-"],
  .stagger-item {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
