/* 
 * Animations - Page d'accueil
 * Projet : Cartes cadeaux Séance Photo
 * Date : 22 mai 2025
 */

/* Animation d'apparition au défilement */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animation d'apparition par la gauche */
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Animation d'apparition par la droite */
.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Rotation des éléments texte dans le hero */
@keyframes textRotate {
  0% { 
    opacity: 0;
    transform: translateY(20px);
  }
  5% {
    opacity: 1;
    transform: translateY(0);
  }
  45% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Animation de pulse pour les CTA */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(170, 123, 76, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(170, 123, 76, 0.5);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(170, 123, 76, 0.3);
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Animation du menu header lors du scroll */
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.site-header.hidden {
  transform: translateY(-100%);
}

/* Animation pour le menu mobile */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
  z-index: 999;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

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

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

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

.mobile-menu ul {
  display: flex;
  flex-direction: column;
  gap: 30px;
  text-align: center;
}

.mobile-menu a {
  font-size: 1.5rem;
  font-weight: 500;
}

/* Animation de la lightbox du portfolio */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90vh;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  opacity: 1;
  transform: scale(1);
  transition-delay: 0.1s;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.lightbox-close:hover {
  opacity: 1;
}

/* Animation de retournement de la carte */
@keyframes cardFlip {
  0% { transform: rotateY(0); }
  100% { transform: rotateY(180deg); }
}

@keyframes cardUnflip {
  0% { transform: rotateY(180deg); }
  100% { transform: rotateY(0); }
}

.card-flip {
  animation: cardFlip 0.6s forwards;
}

.card-unflip {
  animation: cardUnflip 0.6s forwards;
}

/* Animation pour les notifications */
.notification {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--primary);
  color: white;
  padding: 15px 30px;
  border-radius: 50px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  transition: bottom 0.5s ease;
  text-align: center;
  font-weight: 500;
}

.notification.show {
  bottom: 30px;
}

/* Animation pour le badge nouveauté */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.badge-new {
  display: inline-block;
  background-color: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  margin-left: 8px;
  animation: bounce 1s infinite;
}