/* ===================================
   ANIMATIONS KEYFRAMES
   =================================== */

/* Fade in basique */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(var(--translate-y-small));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in vers le haut */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(var(--translate-y-medium));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade in depuis la gauche */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in depuis la droite */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation glow pulsante */
@keyframes glowPulse {

    0%,
    100% {
        opacity: var(--glow-min-opacity);
        transform: scale(1);
    }

    50% {
        opacity: var(--glow-max-opacity);
        transform: scale(1.1);
    }
}

/* Animation gradient fluide */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Animation navigation */
@keyframes navFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation titre de section */
@keyframes sectionTitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation croix rotative (pour les listes) */
@keyframes rotateCross {
    0% {
        transform: translateY(-50%) rotate(0deg);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-50%) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
        opacity: 0.5;
    }
}

/* Animation slide down */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation slide up */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation zoom in */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation bounce légère */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Animation shimmer (pour les skeleton loaders) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

/* ===================================
   CLASSES D'ANIMATION
   =================================== */

/* Animation au scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animation depuis la gauche */
.animate-on-scroll.from-left {
    transform: translateX(-50px);
}

.animate-on-scroll.from-left.visible {
    transform: translateX(0);
}

/* Animation depuis la droite */
.animate-on-scroll.from-right {
    transform: translateX(50px);
}

.animate-on-scroll.from-right.visible {
    transform: translateX(0);
}

/* Classes de fade prédéfinies */
.fade-in-title {
    animation: fadeIn 1s ease-out forwards;
}

.fade-in-subtitle {
    animation: fadeIn 1s ease-out 0.3s forwards;
    opacity: 0;
}

/* Délais d'animation */
.delay-100 {
    transition-delay: 0.1s;
    animation-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
    animation-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
    animation-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
    animation-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
    animation-delay: 0.5s;
}

.delay-600 {
    transition-delay: 0.6s;
    animation-delay: 0.6s;
}

/* ===================================
   ANIMATIONS SPÉCIFIQUES
   =================================== */

/* Animation des titres mobiles */
.mobile-section-title {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-section-title.animated {
    animation: sectionTitleFadeIn 0.4s ease;
}

/* Animation des cartes métier */
.metier-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metier-card:hover {
    animation: bounce 1s ease infinite;
}

/* Hero content animations */
.hero-content h1 {
    animation: fadeIn 1s ease-out forwards;
}

.hero-content p {
    animation: fadeIn 1s ease-out 0.3s forwards;
    opacity: 0;
}

/* ===================================
   ANIMATIONS DES LISTES
   =================================== */

/* Style et animation des points de liste */
.moyens-text ul li,
.moyens-description ul li,
.competence-item ul li {
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
}

.moyens-text ul li::before,
.moyens-description ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    background:
        linear-gradient(45deg, transparent 40%, var(--primary-green) 40%, var(--primary-green) 60%, transparent 60%),
        linear-gradient(-45deg, transparent 40%, var(--primary-green) 40%, var(--primary-green) 60%, transparent 60%);
    animation: rotateCross 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* Délais en cascade pour les items de liste */
.moyens-text ul li:nth-child(1)::before,
.moyens-description ul li:nth-child(1)::before {
    animation-delay: 0s;
}

.moyens-text ul li:nth-child(2)::before,
.moyens-description ul li:nth-child(2)::before {
    animation-delay: 0.1s;
}

.moyens-text ul li:nth-child(3)::before,
.moyens-description ul li:nth-child(3)::before {
    animation-delay: 0.2s;
}

.moyens-text ul li:nth-child(4)::before,
.moyens-description ul li:nth-child(4)::before {
    animation-delay: 0.3s;
}

.moyens-text ul li:nth-child(5)::before,
.moyens-description ul li:nth-child(5)::before {
    animation-delay: 0.4s;
}

.moyens-text ul li:nth-child(6)::before,
.moyens-description ul li:nth-child(6)::before {
    animation-delay: 0.5s;
}

.moyens-text ul li:nth-child(7)::before,
.moyens-description ul li:nth-child(7)::before {
    animation-delay: 0.6s;
}

.moyens-text ul li:nth-child(8)::before,
.moyens-description ul li:nth-child(8)::before {
    animation-delay: 0.7s;
}

.moyens-text ul li:nth-child(9)::before,
.moyens-description ul li:nth-child(9)::before {
    animation-delay: 0.8s;
}

.moyens-text ul li:nth-child(10)::before,
.moyens-description ul li:nth-child(10)::before {
    animation-delay: 0.9s;
}

/* ===================================
   ANIMATIONS IMAGES & HOVER
   =================================== */

/* Animation hover images spéciales */
.moyen-image,
.controle-image {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.moyen-image:hover,
.controle-image:hover {
    transform: translateY(-10px);
}

/* Overlay gradient au hover */
.moyen-image::before,
.controle-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(149, 193, 31, 0.1),
            rgba(0, 48, 130, 0.1));
    border-radius: 15px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.moyen-image:hover::before,
.controle-image:hover::before {
    opacity: 1;
}

/* ===================================
   ANIMATIONS SECTION CONTACT
   =================================== */

/* Animation des éléments de contact */
.contact-info {
    animation: fadeInLeft 0.8s ease-out;
}

.map-container {
    animation: fadeInRight 0.8s ease-out;
}

.map-links a,
.social-link {
    transition: all 0.3s ease;
}

.map-links a:hover,
.social-link:hover {
    transform: translateX(5px);
}

/* Animation de la carte */
.map-container {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.map-container:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Animation des horaires */
.horaires-list li {
    transition: all 0.3s ease;
}

.horaires-list li:hover {
    border-color: var(--primary-green);
    background: rgba(149, 193, 31, 0.05);
    padding-left: 1rem;
}

/* ===================================
   UTILITAIRES D'ANIMATION
   =================================== */

/* Pause/Play animation */
.animation-paused {
    animation-play-state: paused !important;
}

.animation-running {
    animation-play-state: running !important;
}

/* Effets visuels */
.glass {
    animation: fadeIn 0.5s ease-out;
}

/* Animation des segments */
.segment-detail {
    transition: opacity 0.3s ease;
}

/* Highlight effect */
.highlight {
    animation: highlight 1s ease;
}

@keyframes highlight {

    0%,
    100% {
        background: transparent;
    }

    50% {
        background: rgba(149, 193, 31, 0.1);
    }
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* Utiliser transform et opacity pour de meilleures performances */
.metier-card,
.segment-slide,
.slide,
.button {
    will-change: transform;
}

/* Désactiver will-change après l'animation */
.metier-card:hover,
.segment-slide:hover,
.slide:hover,
.button:hover {
    will-change: auto;
}

/* ===================================
   ACCESSIBILITÉ - REDUCED MOTION
   =================================== */

@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;
    }

    .glow {
        animation: none !important;
    }

    .moyens-text ul li::before,
    .moyens-description ul li::before {
        animation: none !important;
    }
}