/* Animations et transitions modernes pour Advance Web - 2025 */

/* Variables CSS pour la cohérence */
:root {
  --primary-color: #2c5aa0;
  --secondary-color: #00a3cc;
  --accent-color: #ff6b35;
  --text-color: #333;
  --bg-color: #ffffff;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations d'entrée */
@keyframes fadeInUp {
  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 slideInUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Classes d'animation */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

/* Transitions fluides */
* {
  transition: var(--transition);
}

a, button, input[type="submit"], .superbutton {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover, button:hover, input[type="submit"]:hover, .superbutton:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Effets de survol améliorés */
.superbutton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

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

.superbutton:hover::before {
  left: 100%;
}

/* Animations pour les services */
.service-item {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
}

.service-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: var(--primary-color);
}

.service-item .icon {
  transition: transform 0.3s ease;
}

.service-item:hover .icon {
  transform: scale(1.1) rotate(5deg);
}

/* Animations pour le slider */
.nivoSlider img {
  animation: fadeInUp 0.8s ease-out;
}

/* Effets pour les formulaires */
input[type="text"], input[type="email"], textarea, select {
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus, input[type="email"]:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

/* Animations de chargement */
.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Animations au scroll */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

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

/* Effets de hover pour les images */
img:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* Animations pour les témoignages */
.testimonial {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  border-radius: 12px;
  padding: 25px;
  margin: 15px 0;
  position: relative;
  box-shadow: var(--shadow);
}

.testimonial::before {
  content: '"';
  font-size: 60px;
  color: var(--primary-color);
  position: absolute;
  top: 10px;
  left: 20px;
  opacity: 0.3;
}

.testimonial:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Effets pour la navigation */
.menu li a {
  position: relative;
  overflow: hidden;
}

.menu li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
  transition: left 0.3s ease;
}

.menu li a:hover::after {
  left: 0;
}

/* Responsive animations */
@media (max-width: 768px) {
  .service-item:hover {
    transform: none;
  }

  .animate-fade-in-up,
  .animate-fade-in-left,
  .animate-fade-in-right {
    animation-duration: 0.4s;
  }
}

/* Animations d'entrée séquentielles */
.stagger-animation > * {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }

/* Effets de particules en arrière-plan (optionnel) */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  background: var(--primary-color);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
  animation-duration: 8s;
  animation-delay: -2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  50% { transform: translateY(-20px) rotate(180deg); opacity: 1; }
}

/* Mode sombre support (futur) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --shadow: 0 2px 10px rgba(255,255,255,0.1);
  }
}
