/* ===================================
   PAGE ANIMATIONS - Smooth Transitions
   =================================== */

/* Animation d'entrée fluide pour toutes les pages */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation pour le conteneur principal */
body {
    animation: fadeIn 0.4s ease-out;
}

/* Sections principales */
main,
.page-container,
.content-wrapper,
.contact-content {
    animation: fadeInUp 0.6s ease-out;
}

/* Headers/Titres */
h1,
h2,
h3,
h4,
h5,
h6 {
    animation: fadeInUp 0.7s ease-out backwards;
}

h1 { animation-delay: 0.1s; }
h2 { animation-delay: 0.15s; }
h3 { animation-delay: 0.2s; }
h4 { animation-delay: 0.25s; }

/* Paragraphes */
p {
    animation: fadeInUp 0.8s ease-out backwards;
}

/* Sections avec stagger effect */
.section,
.container,
.card,
.item,
.bateau-item,
.service-card,
.contact-info,
.contact-form-section,
.modal,
.hero-section {
    animation: fadeInUp 0.7s ease-out backwards;
}

/* Stagger effect pour les enfants */
.section > *:nth-child(1) { animation-delay: 0.1s; }
.section > *:nth-child(2) { animation-delay: 0.2s; }
.section > *:nth-child(3) { animation-delay: 0.3s; }
.section > *:nth-child(4) { animation-delay: 0.4s; }
.section > *:nth-child(5) { animation-delay: 0.5s; }

/* Grid items avec animation */
.grid,
.fleet-grid,
.carousel,
.bateau-grid {
    animation: fadeInUp 0.6s ease-out;
}

.grid > *,
.fleet-grid > *,
.carousel > *,
.bateau-grid > *,
.carousel-item,
.bateau-card {
    animation: scaleIn 0.5s ease-out backwards;
}

.grid > *:nth-child(1),
.fleet-grid > *:nth-child(1),
.carousel > *:nth-child(1),
.bateau-grid > *:nth-child(1) { animation-delay: 0.1s; }

.grid > *:nth-child(2),
.fleet-grid > *:nth-child(2),
.carousel > *:nth-child(2),
.bateau-grid > *:nth-child(2) { animation-delay: 0.2s; }

.grid > *:nth-child(3),
.fleet-grid > *:nth-child(3),
.carousel > *:nth-child(3),
.bateau-grid > *:nth-child(3) { animation-delay: 0.3s; }

.grid > *:nth-child(4),
.fleet-grid > *:nth-child(4),
.carousel > *:nth-child(4),
.bateau-grid > *:nth-child(4) { animation-delay: 0.4s; }

/* Boutons */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-contact,
.btn-reserve,
[role="button"] {
    animation: fadeInUp 0.8s ease-out backwards;
}

/* Images */
img {
    animation: fadeIn 0.8s ease-out;
}

/* Formulaires */
form {
    animation: fadeInUp 0.7s ease-out;
}

.form-group {
    animation: fadeInUp 0.6s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }
.form-group:nth-child(6) { animation-delay: 0.6s; }

/* Listes */
ul,
ol,
li {
    animation: fadeInUp 0.7s ease-out backwards;
}

li:nth-child(1) { animation-delay: 0.1s; }
li:nth-child(2) { animation-delay: 0.2s; }
li:nth-child(3) { animation-delay: 0.3s; }
li:nth-child(4) { animation-delay: 0.4s; }
li:nth-child(5) { animation-delay: 0.5s; }

/* Tables */
table {
    animation: fadeInUp 0.7s ease-out;
}

tr {
    animation: fadeInUp 0.6s ease-out backwards;
}

tr:nth-child(1) { animation-delay: 0.1s; }
tr:nth-child(2) { animation-delay: 0.2s; }
tr:nth-child(3) { animation-delay: 0.3s; }
tr:nth-child(4) { animation-delay: 0.4s; }
tr:nth-child(5) { animation-delay: 0.5s; }

/* Headers - animation plus rapide */
header,
.header,
.navbar,
nav {
    animation: fadeInDown 0.4s ease-out;
}

/* Footers */
footer,
.footer {
    animation: fadeInUp 0.6s ease-out;
}

/* Modals - animation spéciale */
.modal,
.modal-content,
[role="dialog"] {
    animation: scaleIn 0.3s ease-out;
}

/* Éléments avec classe animate */
.animate {
    animation: fadeInUp 0.7s ease-out backwards;
}

.animate.stagger-1 { animation-delay: 0.1s; }
.animate.stagger-2 { animation-delay: 0.2s; }
.animate.stagger-3 { animation-delay: 0.3s; }
.animate.stagger-4 { animation-delay: 0.4s; }
.animate.stagger-5 { animation-delay: 0.5s; }

/* Animation au défilement - Fade in au scroll */
@keyframes fadeInOnScroll {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Classes pour animations au scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Désactiver les animations sur les appareils mobiles lents */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Animations plus fluides sur desktop */
@media (min-width: 768px) {
    body {
        animation: fadeIn 0.5s ease-out;
    }

    main,
    .page-container {
        animation: fadeInUp 0.7s ease-out;
    }

    h1 { animation-delay: 0.15s; }
    h2 { animation-delay: 0.2s; }
    h3 { animation-delay: 0.25s; }
}
