/**
 * L'Échappée Bleue - Animations & Effects CSS
 */

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

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

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

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

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

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

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

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

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

.card:hover {
    transform: translateY(-8px);
    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
   =========================================== */
.btn, .btn-primary, .btn-outline {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.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: translateY(-2px);
    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%;
}

/* Ripple effect */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===========================================
   IMAGES HOVER
   =========================================== */
.card-image, .split-image {
    overflow: hidden;
}

.card-image img, .split-image img {
    transition: transform 0.6s ease;
}

.card:hover .card-image img,
.split-content:hover .split-image img {
    transform: scale(1.08);
}

/* ===========================================
   NAVBAR AMÉLIORÉE
   =========================================== */
.navbar {
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

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

/* ===========================================
   LIENS AVEC UNDERLINE ANIMÉ
   =========================================== */
.navbar-menu a {
    position: relative;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.3s ease, left 0.3s ease;
}

.navbar-menu a:hover::after {
    width: 100%;
    left: 0;
}

/* ===========================================
   ICÔNES ANIMÉES
   =========================================== */
.info-item i, .feature-icon, .step-number {
    transition: transform 0.3s ease, color 0.3s ease;
}

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

/* ===========================================
   HERO AMÉLIORÉ
   =========================================== */
.hero-page, .hero {
    transition: background-position 0.1s ease-out;
}

.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: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================================
   VAGUES ANIMÉES EN BAS DE PAGE
   =========================================== */
.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;
}

.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: translateX(0); }
    100% { transform: translateX(-50%); }
}

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

/* ===========================================
   CURSOR TRAIL EFFECT
   =========================================== */
.cursor-trail-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
}

.cursor-trail {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--bleu-ocean), var(--sable));
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

@media (max-width: 768px) {
    .cursor-trail-container {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cursor-trail-container,
    .waves-container {
        display: none;
    }
}
