/**
 * Yme Jibu - Animations CSS
 * Animations modernes et micro-interactions
 */

/* ========================================
   WATER EFFECT ANIMATIONS
======================================== */
@keyframes wave {
    0%, 100% {
        transform: translateX(0) translateY(0);
    }
    25% {
        transform: translateX(-5px) translateY(5px);
    }
    50% {
        transform: translateX(0) translateY(10px);
    }
    75% {
        transform: translateX(5px) translateY(5px);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes droplet {
    0% {
        transform: translateY(-100%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(100%) scale(0.5);
        opacity: 0;
    }
}

/* Water Ripple Button Effect */
.ymejibu-btn {
    position: relative;
    overflow: hidden;
}

.ymejibu-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.ymejibu-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   SCROLL REVEAL ANIMATIONS
======================================== */
.ymejibu-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.ymejibu-reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

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

.ymejibu-reveal--left.ymejibu-reveal--visible {
    transform: translateX(0);
}

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

.ymejibu-reveal--right.ymejibu-reveal--visible {
    transform: translateX(0);
}

.ymejibu-reveal--scale {
    transform: scale(0.9);
}

.ymejibu-reveal--scale.ymejibu-reveal--visible {
    transform: scale(1);
}

/* Staggered reveal for children */
.ymejibu-reveal-group > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.ymejibu-reveal-group.ymejibu-reveal--visible > *:nth-child(1) { transition-delay: 0.1s; }
.ymejibu-reveal-group.ymejibu-reveal--visible > *:nth-child(2) { transition-delay: 0.2s; }
.ymejibu-reveal-group.ymejibu-reveal--visible > *:nth-child(3) { transition-delay: 0.3s; }
.ymejibu-reveal-group.ymejibu-reveal--visible > *:nth-child(4) { transition-delay: 0.4s; }
.ymejibu-reveal-group.ymejibu-reveal--visible > *:nth-child(5) { transition-delay: 0.5s; }
.ymejibu-reveal-group.ymejibu-reveal--visible > *:nth-child(6) { transition-delay: 0.6s; }

.ymejibu-reveal-group.ymejibu-reveal--visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   COUNTER ANIMATION
======================================== */
.ymejibu-counter {
    display: inline-block;
}

.ymejibu-counter--animated {
    animation: countPulse 0.3s ease;
}

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

/* ========================================
   LOADING ANIMATIONS
======================================== */
.ymejibu-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.ymejibu-loader__dot {
    width: 12px;
    height: 12px;
    background: var(--ymejibu-primary);
    border-radius: 50%;
    animation: loaderBounce 1.4s infinite ease-in-out both;
}

.ymejibu-loader__dot:nth-child(1) { animation-delay: -0.32s; }
.ymejibu-loader__dot:nth-child(2) { animation-delay: -0.16s; }
.ymejibu-loader__dot:nth-child(3) { animation-delay: 0s; }

@keyframes loaderBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Water drop loader */
.ymejibu-loader--water {
    position: relative;
    width: 60px;
    height: 60px;
}

.ymejibu-loader--water::before,
.ymejibu-loader--water::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ymejibu-primary);
    transform: translate(-50%, -50%);
    animation: waterPulse 2s infinite ease-in-out;
}

.ymejibu-loader--water::after {
    animation-delay: 0.5s;
    background: var(--ymejibu-secondary);
}

@keyframes waterPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
}

/* ========================================
   HOVER EFFECTS
======================================== */
/* Lift effect */
.ymejibu-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ymejibu-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Glow effect */
.ymejibu-glow {
    transition: box-shadow 0.3s ease;
}

.ymejibu-glow:hover {
    box-shadow: 0 0 30px rgba(71, 186, 229, 0.4);
}

/* Shine effect */
.ymejibu-shine {
    position: relative;
    overflow: hidden;
}

.ymejibu-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.ymejibu-shine:hover::before {
    left: 100%;
}

/* Scale on hover */
.ymejibu-scale-hover {
    transition: transform 0.3s ease;
}

.ymejibu-scale-hover:hover {
    transform: scale(1.05);
}

/* Rotate on hover */
.ymejibu-rotate-hover {
    transition: transform 0.3s ease;
}

.ymejibu-rotate-hover:hover {
    transform: rotate(5deg);
}

/* ========================================
   ICON ANIMATIONS
======================================== */
.ymejibu-icon-pulse {
    animation: iconPulse 2s infinite;
}

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

.ymejibu-icon-bounce {
    animation: iconBounce 2s infinite;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-7px);
    }
}

.ymejibu-icon-spin {
    animation: iconSpin 3s linear infinite;
}

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

/* ========================================
   PARALLAX EFFECTS
======================================== */
.ymejibu-parallax {
    will-change: transform;
}

/* ========================================
   TEXT ANIMATIONS
======================================== */
.ymejibu-text-gradient {
    background: linear-gradient(135deg, var(--ymejibu-primary), var(--ymejibu-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ymejibu-text-shine {
    background: linear-gradient(
        90deg,
        var(--ymejibu-navy),
        var(--ymejibu-primary),
        var(--ymejibu-navy)
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textShine 3s linear infinite;
}

@keyframes textShine {
    to {
        background-position: 200% center;
    }
}

/* Typewriter effect */
.ymejibu-typewriter {
    overflow: hidden;
    border-right: 3px solid var(--ymejibu-primary);
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--ymejibu-primary); }
}

/* ========================================
   BACKGROUND ANIMATIONS
======================================== */
.ymejibu-bg-gradient-animate {
    background: linear-gradient(-45deg, var(--ymejibu-navy), var(--ymejibu-primary), var(--ymejibu-secondary), var(--ymejibu-navy-light));
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

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

/* Floating particles */
.ymejibu-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.ymejibu-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: particleFloat 20s infinite linear;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   CARD FLIP EFFECT
======================================== */
.ymejibu-flip-card {
    perspective: 1000px;
}

.ymejibu-flip-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.ymejibu-flip-card:hover .ymejibu-flip-card__inner {
    transform: rotateY(180deg);
}

.ymejibu-flip-card__front,
.ymejibu-flip-card__back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
}

.ymejibu-flip-card__back {
    transform: rotateY(180deg);
}

/* ========================================
   PROGRESS BAR ANIMATION
======================================== */
.ymejibu-progress {
    height: 8px;
    background: var(--ymejibu-gray-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.ymejibu-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--ymejibu-primary), var(--ymejibu-secondary));
    border-radius: var(--radius-full);
    width: 0;
    transition: width 1.5s ease;
}

.ymejibu-progress__bar--animated {
    animation: progressShine 2s infinite;
}

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

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