/**
 * La Baleine Bosse - Animations optimisées (GPU-accelerated)
 */

/* ===========================================
   ANIMATIONS AU SCROLL (GPU optimisé)
   =========================================== */
.animate-fade-up {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.animate-fade-up.animate-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.animate-fade-left {
    opacity: 0;
    transform: translate3d(-40px, 0, 0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.animate-fade-left.animate-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.animate-fade-right {
    opacity: 0;
    transform: translate3d(40px, 0, 0);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.animate-fade-right.animate-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.animate-scale {
    opacity: 0;
    transform: scale3d(0.9, 0.9, 1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.animate-scale.animate-in {
    opacity: 1;
    transform: scale3d(1, 1, 1);
}

/* ===========================================
   HOVER EFFECTS - CARTES (GPU optimisé)
   =========================================== */
.card {
    transform: translate3d(0, 0, 0);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.4s ease;
    will-change: transform;
}

.card:hover {
    transform: translate3d(0, -8px, 0);
    box-shadow: 0 20px 40px rgba(26, 58, 92, 0.15), 
                0 10px 20px rgba(26, 58, 92, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bleu-ocean), var(--sable));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.card:hover::before {
    transform: scaleX(1);
}

/* ===========================================
   BOUTONS AMÉLIORÉS (GPU optimisé)
   =========================================== */
.btn, .btn-primary, .btn-outline {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translate3d(0, 0, 0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--bleu-ocean) 0%, var(--bleu-marine) 100%);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-primary::after {
    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 ease;
}

.btn-primary:hover::after {
    left: 100%;
}

/* ===========================================
   IMAGES HOVER (GPU optimisé)
   =========================================== */
.card-image, .split-image {
    overflow: hidden;
}

.card-image img, .split-image img {
    transition: transform 0.6s ease;
    transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
    will-change: transform;
}

.card:hover .card-image img,
.split-content:hover .split-image img {
    transform: translate3d(0, 0, 0) scale3d(1.08, 1.08, 1);
}

/* ===========================================
   NAVBAR (GPU optimisé)
   =========================================== */
.navbar {
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar.scrolled .navbar-menu a {
    color: var(--sable);
    text-shadow: none;
}

/* ===========================================
   ICÔNES ANIMÉES (GPU optimisé)
   =========================================== */
.info-item i, .feature-icon, .step-number {
    transition: transform 0.3s ease;
    transform: translate3d(0, 0, 0);
}

.info-item:hover i,
.feature-item:hover .feature-icon {
    transform: scale3d(1.2, 1.2, 1) rotate(5deg);
}

/* ===========================================
   HERO (GPU optimisé)
   =========================================== */
.hero-content h1 {
    animation: slideUp 0.8s ease-out forwards;
}

.hero-content p {
    animation: slideUp 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate3d(0, 30px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* ===========================================
   FOCUS STATES (Accessibilité)
   =========================================== */
.btn:focus-visible,
a:focus-visible {
    outline: 3px solid var(--sable);
    outline-offset: 3px;
}

/* ===========================================
   REDUCED MOTION
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .waves-container,
    .cursor-trail-container {
        display: none !important;
    }
}

/* ===========================================
   VAGUES ANIMÉES (GPU optimisé)
   =========================================== */
.waves-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden;
    pointer-events: none;
    z-index: 9999;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background-repeat: repeat-x;
    transform-origin: center bottom;
    will-change: transform;
}

.wave1 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='%231a3a5c' fill-opacity='0.3'/%3E%3C/svg%3E");
    background-size: 1200px 100%;
    animation: wave 12s linear infinite;
    opacity: 0.8;
}

.wave2 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='%233498db' fill-opacity='0.3'/%3E%3C/svg%3E");
    background-size: 1200px 100%;
    animation: wave 8s linear infinite reverse;
    opacity: 0.6;
    bottom: 5px;
}

.wave3 {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C150,120 350,0 600,60 C850,120 1050,0 1200,60 L1200,120 L0,120 Z' fill='%231a3a5c' fill-opacity='0.5'/%3E%3C/svg%3E");
    background-size: 1200px 100%;
    animation: wave 15s linear infinite;
    opacity: 0.4;
    bottom: 10px;
}

@keyframes wave {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@media (max-width: 768px) {
    .waves-container {
        height: 60px;
    }
}
