/* ==========================================
   IVANOVA SOLUTIONS - ANIMATIONS CSS
   Animations, keyframes et effets visuels
   ========================================== */

/* ==========================================
   1. KEYFRAMES - ANIMATIONS DE BASE
   ========================================== */

/* Fade In */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Down */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In Right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide Up */
@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Slide Down */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Scale In */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scale Out */
@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Rotate In */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

/* Bounce */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Pulse */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Shake */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Slide In Blur */
@keyframes slideInBlur {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateX(0);
  }
}

/* Glow Pulse */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 170, 0.8);
  }
}

/* Gradient Shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Float */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Ripple */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Spin */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Progress Bar */
@keyframes progressBar {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Shimmer */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ==========================================
   2. CLASSES D'ANIMATION UTILITAIRES
   ========================================== */

/* Animations de base */
.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

.animate-fadeInUp {
  animation: fadeInUp 0.8s ease-out;
}

.animate-fadeInDown {
  animation: fadeInDown 0.8s ease-out;
}

.animate-fadeInLeft {
  animation: fadeInLeft 0.8s ease-out;
}

.animate-fadeInRight {
  animation: fadeInRight 0.8s ease-out;
}

.animate-slideUp {
  animation: slideUp 0.5s ease-out;
}

.animate-slideDown {
  animation: slideDown 0.5s ease-out;
}

.animate-scaleIn {
  animation: scaleIn 0.5s ease-out;
}

.animate-rotateIn {
  animation: rotateIn 0.8s ease-out;
}

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

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

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Délais d'animation */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ==========================================
   3. ANIMATIONS AU SCROLL
   ========================================== */

/* Elements cachés avant animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Variantes de scroll reveal */
.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-scale {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================
   4. ANIMATIONS HOVER SPÉCIALES
   ========================================== */

/* Shine effect on hover */
.hover-shine {
  position: relative;
  overflow: hidden;
}

.hover-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.hover-shine:hover::before {
  left: 100%;
}

/* Lift effect */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(13, 27, 42, 0.25);
}

/* Glow effect */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.6);
}

/* Tilt effect */
.hover-tilt {
  transition: transform 0.3s ease;
}

.hover-tilt:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(5deg);
}

/* Expand effect */
.hover-expand {
  transition: transform 0.3s ease;
}

.hover-expand:hover {
  transform: scale(1.05);
}

/* ==========================================
   5. ANIMATIONS DE CHARGEMENT
   ========================================== */

/* Spinner de chargement */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 168, 232, 0.2);
  border-top-color: #00A8E8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border-width: 6px;
}

/* Dots loader */
.dots-loader {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.dots-loader span {
  width: 12px;
  height: 12px;
  background-color: #00A8E8;
  border-radius: 50%;
  animation: dotsBounce 1.4s ease-in-out infinite;
}

.dots-loader span:nth-child(1) {
  animation-delay: -0.32s;
}

.dots-loader span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes dotsBounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Progress bar animée */
.progress-bar {
  height: 4px;
  background-color: rgba(0, 168, 232, 0.2);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00A8E8, #00D4AA);
  border-radius: 2px;
  transform-origin: left;
  animation: progressBar 2s ease-out forwards;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(
    90deg,
    #F8FAFC 0%,
    #E2E8F0 50%,
    #F8FAFC 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-text {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

/* ==========================================
   6. ANIMATIONS POUR SLIDER/CAROUSEL
   ========================================== */

/* Slide transitions */
.slide-enter {
  animation: slideInRight 0.6s ease-out;
}

.slide-exit {
  animation: slideOutLeft 0.6s ease-out;
}

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

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

/* Fade transitions pour slider */
.fade-enter {
  animation: fadeIn 0.6s ease-out;
}

.fade-exit {
  animation: fadeOut 0.6s ease-out;
}

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

/* Zoom transitions */
.zoom-enter {
  animation: zoomIn 0.6s ease-out;
}

.zoom-exit {
  animation: zoomOut 0.6s ease-out;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes zoomOut {
  from {
    transform: scale(1);
    opacity: 1;
  }
  to {
    transform: scale(0.8);
    opacity: 0;
  }
}

/* ==========================================
   7. ANIMATIONS POUR MODALES
   ========================================== */

/* Modal backdrop */
.modal-backdrop-enter {
  animation: fadeIn 0.3s ease-out;
}

.modal-backdrop-exit {
  animation: fadeOut 0.3s ease-out;
}

/* Modal content */
.modal-enter {
  animation: modalSlideUp 0.4s ease-out;
}

.modal-exit {
  animation: modalSlideDown 0.3s ease-out;
}

@keyframes modalSlideUp {
  from {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes modalSlideDown {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
}

/* ==========================================
   8. ANIMATIONS POUR NOTIFICATIONS
   ========================================== */

.notification-enter {
  animation: slideInNotification 0.4s ease-out;
}

.notification-exit {
  animation: slideOutNotification 0.3s ease-out;
}

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

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

/* ==========================================
   9. ANIMATIONS DE TEXTE
   ========================================== */

/* Typing effect */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid #00A8E8;
  white-space: nowrap;
  animation: typing 3s steps(40) 1s forwards, blink 0.7s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* Gradient text animation */
.gradient-text-animated {
  background: linear-gradient(
    90deg,
    #1E3A5F,
    #00A8E8,
    #00D4AA,
    #00A8E8,
    #1E3A5F
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s linear infinite;
}

/* ==========================================
   10. EFFETS PARALLAX
   ========================================== */

.parallax-slow {
  transform: translateY(var(--parallax-offset, 0));
  transition: transform 0.1s linear;
}

.parallax-medium {
  transform: translateY(calc(var(--parallax-offset, 0) * 1.5));
  transition: transform 0.1s linear;
}

.parallax-fast {
  transform: translateY(calc(var(--parallax-offset, 0) * 2));
  transition: transform 0.1s linear;
}

/* ==========================================
   11. PERFORMANCES
   ========================================== */

/* Optimisation pour les animations */
.will-animate {
  will-change: transform, opacity;
}

/* Désactivation des animations si l'utilisateur préfère */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right,
  .scroll-reveal-scale {
    opacity: 1;
    transform: none;
  }
}
