/* ============================================
   GÎTE PAILLE & FOIN - ANIMATIONS
   ============================================ */

/* ----- Fade In Animations ----- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease forwards;
}

.fade-in.delay-1 { animation-delay: 0.1s; }
.fade-in.delay-2 { animation-delay: 0.2s; }
.fade-in.delay-3 { animation-delay: 0.3s; }
.fade-in.delay-4 { animation-delay: 0.4s; }
.fade-in.delay-5 { animation-delay: 0.5s; }
.fade-in.delay-6 { animation-delay: 0.6s; }

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Reveal Animations ----- */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* ----- Stagger Animation Delays ----- */
.reveal:nth-child(1) { transition-delay: 0.1s; }
.reveal:nth-child(2) { transition-delay: 0.2s; }
.reveal:nth-child(3) { transition-delay: 0.3s; }
.reveal:nth-child(4) { transition-delay: 0.4s; }
.reveal:nth-child(5) { transition-delay: 0.5s; }
.reveal:nth-child(6) { transition-delay: 0.6s; }
.reveal:nth-child(7) { transition-delay: 0.7s; }
.reveal:nth-child(8) { transition-delay: 0.8s; }

/* ----- Floating Animation ----- */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ----- Pulse Animation ----- */
.pulse {
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ----- Shimmer Effect ----- */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ----- Particles Animation ----- */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-float 10s linear infinite;
}

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ----- Glow Effect ----- */
.glow {
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(139, 105, 20, 0.3),
                    0 0 20px rgba(139, 105, 20, 0.2),
                    0 0 30px rgba(139, 105, 20, 0.1);
    }
    to {
        box-shadow: 0 0 20px rgba(139, 105, 20, 0.5),
                    0 0 40px rgba(139, 105, 20, 0.3),
                    0 0 60px rgba(139, 105, 20, 0.2);
    }
}

/* ----- Slide Up Animation ----- */
.slide-up {
    animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Scale In Animation ----- */
.scale-in {
    animation: scaleIn 0.5s ease forwards;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- Rotate Animation ----- */
.rotate {
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ----- Bounce Animation ----- */
.bounce {
    animation: bounceIn 0.6s ease forwards;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.1);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ----- Typewriter Effect ----- */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* ----- Shake Animation ----- */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ----- Parallax Layers ----- */
.parallax-layer {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* ----- Text Reveal Animation ----- */
.text-reveal {
    position: relative;
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.6s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

/* ----- Image Zoom on Scroll ----- */
.zoom-scroll {
    transform: scale(1.1);
    transition: transform 1s ease;
}

.zoom-scroll.active {
    transform: scale(1);
}

/* ----- Counter Animation ----- */
.counter {
    transition: all 0.3s ease;
}

/* ----- Card Hover Effects ----- */
.card-hover {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* ----- Image Reveal Effect ----- */
.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    transform: translateX(-101%);
    animation: imageReveal 1s ease forwards;
}

.image-reveal img {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards 0.5s;
}

@keyframes imageReveal {
    0% { transform: translateX(-101%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(101%); }
}

/* ----- Underline Animation ----- */
.underline-hover {
    position: relative;
}

.underline-hover::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.underline-hover:hover::after {
    width: 100%;
}

/* ----- Smooth Accordion ----- */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.accordion-content.active {
    max-height: 1000px;
}

/* ----- Loading Skeleton ----- */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--cream-dark) 25%,
        var(--cream) 50%,
        var(--cream-dark) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ----- Magnetic Button Effect ----- */
.magnetic-btn {
    transition: transform 0.3s ease;
}

/* ----- Morph Animation ----- */
.morph {
    animation: morph 8s ease-in-out infinite;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ----- Gradient Shift ----- */
.gradient-shift {
    background: linear-gradient(
        -45deg,
        var(--primary),
        var(--secondary),
        var(--primary-light),
        var(--secondary-light)
    );
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ----- Ripple Effect ----- */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    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.5s ease, height 0.5s ease;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ----- Mobile Optimizations ----- */
@media (max-width: 576px) {
    .fade-in {
        transform: translateY(15px);
    }
    
    .reveal {
        transform: translateY(20px);
    }
    
    .reveal-left,
    .reveal-right {
        transform: translateX(0);
        transform: translateY(20px);
    }
    
    /* Désactiver les animations qui causent un débordement */
    .float,
    .pulse,
    .shake {
        animation: none;
    }
}
