﻿/* ============================================
   DEVSTARTER KIT — Animations
   ============================================ */

/* --- Keyframes --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

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

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

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .7; transform: scale(0.97); }
}

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

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

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

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

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

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(110%); }
}

@keyframes bounce {
  0%,100% { transform: translateY(0); animation-timing-function: cubic-bezier(.8,0,1,1); }
  50%      { transform: translateY(-20px); animation-timing-function: cubic-bezier(0,0,.2,1); }
}

/* --- Classes utilitaires d'animation --- */
.animate-fade-in       { animation: fadeIn       var(--transition-slow) ease both; }
.animate-fade-in-up    { animation: fadeInUp     var(--transition-slow) ease both; }
.animate-fade-in-down  { animation: fadeInDown   var(--transition-slow) ease both; }
.animate-fade-in-left  { animation: fadeInLeft   var(--transition-slow) ease both; }
.animate-fade-in-right { animation: fadeInRight  var(--transition-slow) ease both; }
.animate-scale-in      { animation: scaleIn      var(--transition-slow) ease both; }
.animate-float         { animation: float 3s ease-in-out infinite; }
.animate-pulse         { animation: pulse 2s ease-in-out infinite; }
.animate-spin          { animation: spin  1s linear infinite; }
.animate-bounce        { animation: bounce 1s ease infinite; }

/* --- Délais --- */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

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

.skeleton-text  { height: 1em;   border-radius: var(--radius-sm); }
.skeleton-title { height: 1.5em; border-radius: var(--radius-sm); }
.skeleton-img   { aspect-ratio: 16/9; border-radius: var(--radius-md); }

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

/* --- Ripple --- */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: ripple .6s linear;
  pointer-events: none;
}

/* --- Page transition --- */
.page-enter {
  animation: fadeInUp .5s ease both;
}

/* --- Intersection observer --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
