/* ========================================
   Animations et Transitions
   ======================================== */

/* Animation d'entrée des slides */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Animation de fade */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Animation de zoom */
@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;
    }
}

/* Animation d'apparition des hotspots */
@keyframes hotspotAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.hotspot {
    animation: hotspotAppear 0.5s ease-out;
}

/* Délai d'animation pour les hotspots multiples */
.hotspot:nth-child(1) { animation-delay: 0.1s; }
.hotspot:nth-child(2) { animation-delay: 0.2s; }
.hotspot:nth-child(3) { animation-delay: 0.3s; }
.hotspot:nth-child(4) { animation-delay: 0.4s; }
.hotspot:nth-child(5) { animation-delay: 0.5s; }
.hotspot:nth-child(6) { animation-delay: 0.6s; }
.hotspot:nth-child(7) { animation-delay: 0.7s; }
.hotspot:nth-child(8) { animation-delay: 0.8s; }

/* Animation de shake (pour attirer l'attention) */
@keyframes shake {
    0%, 100% {
        transform: translate(-50%, -50%) translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(-50%, -50%) translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translate(-50%, -50%) translateX(5px);
    }
}

.hotspot.shake {
    animation: shake 0.5s;
}

/* Animation de rotation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Animation de rebond */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Animation pour le loading */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

/* Animation du menu hamburger */
.menu-toggle.active {
    transform: rotate(0deg);
}

/* Transition douce pour tous les éléments interactifs */
button,
a,
input,
select,
textarea {
    transition: all var(--transition-fast);
}

/* Animation de pulsation pour les éléments importants */
@keyframes pulse-highlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
}

.highlight-pulse {
    animation: pulse-highlight 2s infinite;
}

/* Animation de glissement vers le haut */
@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation de glissement vers le bas */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Classes utilitaires pour les animations */
.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-in;
}

.animate-slide-up {
    animation: slideUp var(--transition-normal) ease-out;
}

.animate-slide-down {
    animation: slideDown var(--transition-normal) ease-out;
}

.animate-zoom-in {
    animation: zoomIn var(--transition-normal) ease-out;
}

/* Réduction des animations pour les utilisateurs qui préfèrent moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Animation de progression */
@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Effet de parallaxe subtil pour les slides */
.slide.parallax {
    transition: transform 0.3s ease-out;
}

/* Animation de typing (pour les titres) */
@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typing-effect {
    overflow: hidden;
    border-right: 2px solid var(--color-primary);
    white-space: nowrap;
    animation: typing 2s steps(10, end), blink 0.75s step-end infinite;
}
