/* ========================================
   ANIMATIONS AVANCÉES - Jupiter Analytica
   ======================================== */

/* Animations d'entrée pour les éléments */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

/* Animation de rotation pour les icônes */
@keyframes rotate360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Animation de pulsation */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

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

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

/* Animation de gradient */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* Animation de typing effect */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

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

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

/* Animation de glow */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.8), 0 0 30px rgba(37, 99, 235, 0.6);
  }
}

/* Animation de slide reveal */
@keyframes slideReveal {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Animation de flip */
@keyframes flipIn {
  from {
    transform: perspective(400px) rotateY(90deg);
    opacity: 0;
  }
  to {
    transform: perspective(400px) rotateY(0deg);
    opacity: 1;
  }
}

/* Animation de zoom in */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation de slide up */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.8s ease both;
}

.animate-fade-in-down {
  animation: fadeInDown 0.8s ease both;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.8s ease both;
}

.animate-fade-in-right {
  animation: fadeInRight 0.8s ease both;
}

.animate-scale-in {
  animation: scaleIn 0.6s ease both;
}

.animate-rotate {
  animation: rotate360 2s linear infinite;
}

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

.animate-bounce {
  animation: bounce 2s infinite;
}

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

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

.animate-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s 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; }

/* Durées d'animation */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 1.5s; }

/* ========================================
   ANIMATIONS SPÉCIFIQUES AU SITE
   ======================================== */

/* Animation du logo au hover */
.logo-img-pro {
  transition: all 0.3s ease;
}

.logo-img-pro:hover {
  transform: scale(1.05) rotate(2deg);
  filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.3));
}

/* Animation des cartes de service */
.service-card-pro {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card-pro:hover {
  transform: translateY(-8px) scale(1.02);
}

.service-card-pro:hover .service-icon-pro {
  animation: pulse 1s ease-in-out;
}

/* Animation des boutons */
.btn-hero-primary,
.btn-hero-secondary,
.btn-nav-primary,
.btn-primary-pro {
  position: relative;
  overflow: hidden;
}

.btn-hero-primary::before,
.btn-hero-secondary::before,
.btn-nav-primary::before,
.btn-primary-pro::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-hero-primary:hover::before,
.btn-hero-secondary:hover::before,
.btn-nav-primary:hover::before,
.btn-primary-pro:hover::before {
  width: 300px;
  height: 300px;
}

/* Animation des badges technologiques */
.tech-badge {
  position: relative;
  overflow: hidden;
}

.tech-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
}

.tech-badge:hover::after {
  left: 100%;
}

/* Animation des étoiles de notation */
.testimonial-rating i {
  display: inline-block;
  animation: scaleIn 0.3s ease both;
}

.testimonial-rating i:nth-child(1) { animation-delay: 0.1s; }
.testimonial-rating i:nth-child(2) { animation-delay: 0.2s; }
.testimonial-rating i:nth-child(3) { animation-delay: 0.3s; }
.testimonial-rating i:nth-child(4) { animation-delay: 0.4s; }
.testimonial-rating i:nth-child(5) { animation-delay: 0.5s; }

/* Animation du scroll indicator */
.hero-scroll {
  animation: bounce 2s infinite;
}

/* Animation des statistiques */
.stat-card {
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-8px) rotate(2deg);
}

.stat-card i {
  transition: all 0.3s ease;
}

.stat-card:hover i {
  transform: scale(1.2) rotate(360deg);
}

/* Animation du background du hero */
.hero-bg-animation {
  animation: gradientShift 15s ease infinite;
  background-size: 200% 200%;
}

/* Animation des liens du footer */
.footer-col ul li a {
  position: relative;
  display: inline-block;
}

.footer-col ul li a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary, #2563eb);
  transition: width 0.3s ease;
}

.footer-col ul li a:hover::after {
  width: 100%;
}

/* Animation des icônes sociales */
.social-links-pro a {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-links-pro a:hover {
  transform: translateY(-5px) rotate(360deg);
}

/* Animation du menu mobile */
.mobile-toggle span {
  transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}

.mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Animation des filtres portfolio */
.filter-btn {
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.filter-btn:hover::before {
  width: 200px;
  height: 200px;
}

/* Animation des items portfolio */
.portfolio-item {
  transition: all 0.3s ease;
}

.portfolio-item:hover .portfolio-image {
  transform: scale(1.05);
}

.portfolio-image {
  transition: transform 0.3s ease;
  overflow: hidden;
}

/* Animation de chargement */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

/* Animation de succès */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.success-checkmark {
  animation: checkmark 0.5s ease-in-out;
}

/* Effet de parallaxe pour les sections */
.parallax-section {
  transform: translateZ(0);
  will-change: transform;
}

/* Animation de typing pour les titres */
.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--primary, #2563eb);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink 0.75s step-end infinite;
}

/* Effet de reveal progressif */
.reveal-text {
  position: relative;
  overflow: hidden;
}

.reveal-text::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  animation: slideReveal 1s ease forwards;
}

/* ========================================
   MEDIA QUERIES POUR ANIMATIONS
   ======================================== */

/* Réduire les animations sur mobile pour la performance */
@media (max-width: 768px) {
  .animate-fade-in-up,
  .animate-fade-in-down,
  .animate-fade-in-left,
  .animate-fade-in-right {
    animation-duration: 0.5s;
  }
  
  .hero-bg-animation {
    animation: none;
  }
}

/* Désactiver les 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;
  }
}

/* ========================================
   ANIMATIONS GPU-ACCELERATED
   ======================================== */

/* Forcer l'accélération GPU pour de meilleures performances */
.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

.service-card-pro,
.portfolio-item,
.testimonial-card,
.stat-card,
.tech-badge {
  transform: translateZ(0);
  backface-visibility: hidden;
}
