/* =====================================================================
   WASATE CLOUD — Animations fluides & délicates
   ===================================================================== */

/* ----- Fade in au chargement */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Slide in du haut */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Slide in de la gauche */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ----- Slide in de la droite */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ----- Scale up subtle */
@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- Pulse gentle */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* ----- Bounce légère */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* ----- Gradient shift (pour les cards) */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* ----- Shimmer (loading) */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* ----- Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(46, 92, 138, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(46, 92, 138, 0.6);
    }
}

/* =====================================================================
   Appliquer les animations aux éléments
   ===================================================================== */

/* ----- Hero sections */
.hero, .hero-section, .page-hero {
    animation: slideInDown 0.8s ease-out;
}

.hero h1, .page-title {
    animation: slideInLeft 0.8s ease-out 0.1s both;
}

.hero p, .hero-subtitle {
    animation: slideInRight 0.8s ease-out 0.2s both;
}

/* ----- Boutons au chargement */
.btn {
    animation: scaleUp 0.6s ease-out;
}

.btn:nth-child(2) {
    animation-delay: 0.1s;
}

.btn:nth-child(3) {
    animation-delay: 0.2s;
}

/* ----- Cards */
.card {
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* ----- Pricing cards featured */
.pricing-card.featured {
    animation: glow 3s ease-in-out infinite;
}

/* ----- Listes */
li {
    animation: slideInLeft 0.6s ease-out;
    animation-fill-mode: both;
}

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; }

/* =====================================================================
   Hover animations
   ===================================================================== */

/* ----- Cards hover bounce */
.card {
    position: relative;
    transition: all var(--transition-fast);
}

.card:hover {
    animation: bounce 0.6s ease-in-out infinite;
}

/* ----- Button hover pulse */
.btn-primary:hover {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ----- Feature items */
.feature-item, .feature-card, .service-box {
    animation: fadeIn 0.6s ease-out;
    animation-fill-mode: both;
}

.feature-item:nth-child(odd) { animation-delay: 0.2s; }
.feature-item:nth-child(even) { animation-delay: 0.4s; }

/* ----- FAQ items */
.faq-item, .accordion-item {
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.faq-item:nth-child(1) { animation-delay: 0.1s; }
.faq-item:nth-child(2) { animation-delay: 0.2s; }
.faq-item:nth-child(3) { animation-delay: 0.3s; }
.faq-item:nth-child(4) { animation-delay: 0.4s; }
.faq-item:nth-child(5) { animation-delay: 0.5s; }

/* ----- Testimonials */
.testimonial, .quote, .review {
    animation: scaleUp 0.6s ease-out;
    animation-fill-mode: both;
}

.testimonial:nth-child(1) { animation-delay: 0.2s; }
.testimonial:nth-child(2) { animation-delay: 0.4s; }
.testimonial:nth-child(3) { animation-delay: 0.6s; }

/* =====================================================================
   Loading states
   ===================================================================== */

.skeleton, .loading-placeholder {
    background: linear-gradient(
        90deg,
        var(--color-border) 25%,
        var(--color-surface-2) 50%,
        var(--color-border) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ----- Spinner */
.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* =====================================================================
   Page transitions (au chargement)
   ===================================================================== */

body {
    animation: fadeIn 0.4s ease-out;
}

header {
    animation: slideInDown 0.5s ease-out;
}

footer {
    animation: slideInUp 0.5s ease-out;
}

/* ----- Stagger containers */
.grid, [class*="grid"], [class*="row"] {
    display: grid;
}

.grid > *, [class*="grid"] > *, [class*="row"] > * {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.grid > :nth-child(1), [class*="grid"] > :nth-child(1), [class*="row"] > :nth-child(1) { animation-delay: 0.05s; }
.grid > :nth-child(2), [class*="grid"] > :nth-child(2), [class*="row"] > :nth-child(2) { animation-delay: 0.1s; }
.grid > :nth-child(3), [class*="grid"] > :nth-child(3), [class*="row"] > :nth-child(3) { animation-delay: 0.15s; }
.grid > :nth-child(4), [class*="grid"] > :nth-child(4), [class*="row"] > :nth-child(4) { animation-delay: 0.2s; }
.grid > :nth-child(5), [class*="grid"] > :nth-child(5), [class*="row"] > :nth-child(5) { animation-delay: 0.25s; }
.grid > :nth-child(6), [class*="grid"] > :nth-child(6), [class*="row"] > :nth-child(6) { animation-delay: 0.3s; }

/* =====================================================================
   Focus animations (keyboard navigation)
   ===================================================================== */

:focus-visible {
    animation: glow 0.4s ease-out forwards;
}

/* ----- Disable animations si prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =====================================================================
   Micro-interactions
   ===================================================================== */

/* ----- Link underline animation */
a {
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition-fast);
}

a:hover::after {
    width: 100%;
}

/* ----- Form field validation animations */
.input:valid {
    animation: scaleUp 0.3s ease-out;
    border-color: var(--color-success);
}

.input:invalid:not(:placeholder-shown) {
    animation: pulse 0.3s ease-out;
    border-color: var(--color-danger);
}

/* =====================================================================
   Staggered grid animations
   ===================================================================== */

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }
.stagger-9 { animation-delay: 0.9s; }
.stagger-10 { animation-delay: 1s; }
