/* =============================================
   Wild Olive - Premium Animations v1.0.0
   Living Design System - Ultra Polished Effects
   ============================================= */

/* =============================================
   1. BASE ANIMATION UTILITIES
   ============================================= */

/* Animation delay utilities */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Animation duration utilities */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.5s; }
.duration-slow { animation-duration: 0.8s; }
.duration-slower { animation-duration: 1.2s; }

/* =============================================
   2. ENTRANCE ANIMATIONS
   ============================================= */

/* Fade In Up - Default reveal */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scale In with Bounce */
@keyframes scaleInBounce {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

/* Flip In */
@keyframes flipInX {
    from {
        opacity: 0;
        transform: perspective(400px) rotateX(90deg);
    }
    to {
        opacity: 1;
        transform: perspective(400px) rotateX(0);
    }
}

/* Classes for entrance animations */
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.animate-scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.animate-scale-bounce {
    animation: scaleInBounce 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* =============================================
   3. LIVING / BREATHING ANIMATIONS
   ============================================= */

/* Gentle Float */
@keyframes gentleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Subtle Pulse */
@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

/* Glow Pulse - for important elements */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(201, 169, 98, 0.3),
                    0 0 10px rgba(201, 169, 98, 0.2),
                    0 0 15px rgba(201, 169, 98, 0.1);
    }
    50% {
        box-shadow: 0 0 10px rgba(201, 169, 98, 0.5),
                    0 0 20px rgba(201, 169, 98, 0.3),
                    0 0 30px rgba(201, 169, 98, 0.2);
    }
}

/* Olive Glow Pulse */
@keyframes oliveGlowPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(61, 90, 61, 0.3);
    }
    50% {
        box-shadow: 0 6px 25px rgba(61, 90, 61, 0.5),
                    0 0 20px rgba(61, 90, 61, 0.2);
    }
}

/* WhatsApp Glow */
@keyframes whatsappGlow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 8px 35px rgba(37, 211, 102, 0.6),
                    0 0 25px rgba(37, 211, 102, 0.3);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Text Shimmer */
@keyframes textShimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Border Glow Animation */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(201, 169, 98, 0.3);
    }
    50% {
        border-color: rgba(201, 169, 98, 0.8);
    }
}

/* Heartbeat - for CTA elements */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.05);
    }
    28% {
        transform: scale(1);
    }
    42% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(1);
    }
}

/* Classes for living animations */
.animate-float {
    animation: gentleFloat 4s ease-in-out infinite;
}

.animate-pulse {
    animation: subtlePulse 3s ease-in-out infinite;
}

.animate-glow {
    animation: glowPulse 3s ease-in-out infinite;
}

.animate-heartbeat {
    animation: heartbeat 2s ease-in-out infinite;
}

/* =============================================
   4. HOVER EFFECT ENHANCEMENTS
   ============================================= */

/* Lift on Hover - for cards */
.hover-lift {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Grow on Hover */
.hover-grow {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* Shine Effect on Hover */
.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

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

/* Border Draw on Hover */
.hover-border-draw {
    position: relative;
}

.hover-border-draw::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gold, #c9a962);
    transition: width 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hover-border-draw:hover::after {
    width: 100%;
}

/* Icon Rotate on Hover */
.hover-icon-rotate:hover i,
.hover-icon-rotate:hover .icon {
    transform: rotate(360deg);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Color Fill on Hover */
.hover-fill {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hover-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--color-olive, #3d5a3d);
    transition: height 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: -1;
}

.hover-fill:hover::before {
    height: 100%;
}

.hover-fill:hover {
    color: white;
}

/* =============================================
   5. SCROLL-TRIGGERED REVEAL ANIMATIONS
   ============================================= */

/* Reveal base class */
.reveal {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal.revealed {
    opacity: 1;
}

/* Reveal variations */
.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-down {
    opacity: 0;
    transform: translateY(-50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-down.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* =============================================
   6. BUTTON ANIMATIONS
   ============================================= */

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 0.5;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

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

/* Button Bounce */
@keyframes buttonBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.btn-bounce:hover {
    animation: buttonBounce 0.5s ease-in-out;
}

/* Button Shake - for attention */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.btn-shake {
    animation: shake 0.8s ease-in-out;
}

/* =============================================
   7. ICON ANIMATIONS
   ============================================= */

/* Icon Bounce */
@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.icon-bounce {
    animation: iconBounce 1.5s ease infinite;
}

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

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

/* Icon Pulse */
@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.icon-pulse {
    animation: iconPulse 1.5s ease-in-out infinite;
}

/* Icon Swing */
@keyframes iconSwing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(15deg);
    }
    75% {
        transform: rotate(-15deg);
    }
}

.icon-swing {
    animation: iconSwing 1s ease-in-out infinite;
    transform-origin: top center;
}

/* =============================================
   8. LOADING ANIMATIONS
   ============================================= */

/* Spinner */
@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(61, 90, 61, 0.2);
    border-top-color: var(--color-olive, #3d5a3d);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

/* Dots Loading */
@keyframes dotsLoading {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.loading-dots {
    display: inline-flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--color-olive, #3d5a3d);
    border-radius: 50%;
    animation: dotsLoading 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

/* Skeleton Loading */
@keyframes skeletonLoading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* =============================================
   9. SPECIAL EFFECTS
   ============================================= */

/* Gradient Flow */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-flow {
    background: linear-gradient(-45deg,
        var(--color-olive, #3d5a3d),
        var(--color-gold, #c9a962),
        var(--color-wine, #6b2d3a),
        var(--color-olive-light, #4d7a4d)
    );
    background-size: 400% 400%;
    animation: gradientFlow 8s ease infinite;
}

/* Parallax Float */
@keyframes parallaxFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-20px) translateX(10px);
    }
    50% {
        transform: translateY(-10px) translateX(-10px);
    }
    75% {
        transform: translateY(-25px) translateX(5px);
    }
}

.parallax-float {
    animation: parallaxFloat 10s ease-in-out infinite;
}

/* Morphing Blob */
@keyframes morphBlob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
    50% {
        border-radius: 50% 60% 40% 60% / 30% 40% 70% 50%;
    }
    75% {
        border-radius: 40% 50% 60% 50% / 60% 50% 40% 60%;
    }
}

.morph-blob {
    animation: morphBlob 8s ease-in-out infinite;
}

/* Text Reveal */
@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    0%, 50% {
        border-color: transparent;
    }
    51%, 100% {
        border-color: var(--color-charcoal, #1a1a1a);
    }
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid;
    animation: typewriter 3s steps(40) 1s forwards,
               blink 0.75s step-end infinite;
}

/* =============================================
   10. INTERACTIVE ELEMENT ANIMATIONS
   ============================================= */

/* Card 3D Tilt Base */
.card-3d {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateZ(10px);
}

/* Image Zoom on Hover */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Link Underline Animation */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* =============================================
   11. STAGGER ANIMATIONS FOR LISTS
   ============================================= */

.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.7s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.8s; }

/* =============================================
   12. REDUCED MOTION SUPPORT
   ============================================= */

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

    .animate-float,
    .animate-pulse,
    .animate-glow,
    .animate-heartbeat,
    .parallax-float,
    .morph-blob {
        animation: none !important;
    }
}
