/* ===================================
   2FI - ANIMATIONS DYNAMIQUES
   Ajoutez ce fichier après styles.css
   =================================== */

/* ===================================
   1. ANIMATIONS AU SCROLL
   =================================== */

/* Animation fade-in depuis le bas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation fade-in depuis la gauche */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Animation fade-in depuis la droite */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* Classes d'animation */
.animate-on-scroll {
    opacity: 0;
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
}

.fade-in-up {
    animation-name: fadeInUp;
}

.fade-in-left {
    animation-name: fadeInLeft;
}

.fade-in-right {
    animation-name: fadeInRight;
}

.zoom-in {
    animation-name: zoomIn;
}

/* Délais pour effet cascade */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ===================================
   2. SERVICE CARDS AVEC IMAGES
   =================================== */

.service-card {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Image de couverture des services */
.service-card__image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    position: relative;
    background: linear-gradient(135deg, #1F5B9E 0%, #174570 100%);
}

.service-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-card__image img {
    transform: scale(1.15);
}

/* Overlay gradient sur l'image */
.service-card__image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 0, 0, 0.3) 70%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 1;
    transition: opacity 0.3s ease;
}

.service-card:hover .service-card__image::after {
    opacity: 0.7;
}

/* Badge sur l'image */
.service-card__badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #C9444D;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(201, 68, 77, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
   3. HERO SECTION DYNAMIQUE
   =================================== */

.hero {
    position: relative;
    overflow: hidden;
}

/* Hero background avec parallax */
.hero__background {
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    bottom: -50px;
    z-index: -2;
    overflow: hidden;
}

.hero__bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    animation: slowZoom 20s ease-in-out infinite alternate;
}

@keyframes slowZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

/* Particules animées */
.hero__particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* ===================================
   4. STATS AVEC COMPTEUR ANIMÉ
   =================================== */

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

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(31, 91, 158, 0.2);
}

.stat-card__number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, #1F5B9E 0%, #C9444D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ===================================
   5. IMAGES AVEC EFFETS HOVER
   =================================== */

/* Conteneur d'image avec zoom */
.image-zoom-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.image-zoom-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom-container:hover img {
    transform: scale(1.1);
}

/* Overlay avec texte */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.6) 60%,
        transparent 100%
    );
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-zoom-container:hover .image-overlay {
    transform: translateY(0);
}

/* ===================================
   6. BOUTONS ANIMÉS
   =================================== */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::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:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(-1px);
}

/* ===================================
   7. CARDS TÉMOIGNAGES ANIMÉS
   =================================== */

.testimonial-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.testimonial-card:hover {
    transform: translateY(-5px) rotate(1deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 80px;
    color: #1F5B9E;
    opacity: 0.1;
    font-family: Georgia, serif;
}

/* ===================================
   8. SMOOTH SCROLL REVEAL
   =================================== */

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    transform: translateX(-50px);
}

.reveal-right {
    transform: translateX(50px);
}

.reveal-scale {
    transform: scale(0.8);
}

/* ===================================
   9. LOADER / SKELETON
   =================================== */

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   10. PROGRESS BAR ANIMÉE
   =================================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #1F5B9E 0%, #C9444D 100%);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-bar__fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===================================
   11. PARALLAX SECTIONS
   =================================== */

.parallax-section {
    position: relative;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 500px;
}

/* ===================================
   12. RIPPLE EFFECT
   =================================== */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200px;
    height: 200px;
}

/* ===================================
   13. RESPONSIVE ADJUSTMENTS
   =================================== */

@media (max-width: 768px) {
    .service-card__image {
        height: 200px;
    }
    
    .hero__bg-image {
        animation: none; /* Désactiver zoom sur mobile */
    }
    
    .parallax-section {
        background-attachment: scroll;
    }
}

/* ===================================
   FIN DES ANIMATIONS
   =================================== */
