/* FINOLOGI ANIMATIONS LIBRARY - MODERN & ELEGANT */

/* ===== ENTRANCE ANIMATIONS ===== */

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -40px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-down {
    animation: fadeInDown 0.6s ease-out;
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate3d(-40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-left {
    animation: fadeInLeft 0.6s ease-out;
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate3d(40px, 0, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.fade-in-right {
    animation: fadeInRight 0.6s ease-out;
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale3d(0.8, 0.8, 0.8);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Slide In With Blur */
@keyframes slideInBlur {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
        filter: blur(0);
    }
}

.slide-in-blur {
    animation: slideInBlur 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== HOVER ANIMATIONS ===== */

/* Lift Animation */
@keyframes liftUp {
    to {
        transform: translate3d(0, -8px, 0);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
}

.lift-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lift-hover:hover {
    animation: liftUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

.pulse-once {
    animation: pulse 0.5s ease-in-out;
}

/* Bounce In */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }
    40% {
        transform: scale3d(0.9, 0.9, 0.9);
    }
    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }
    80% {
        transform: scale3d(0.97, 0.97, 0.97);
    }
    100% {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.bounce-in {
    animation: bounceIn 0.8s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Shake Animation */
@keyframes shake {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate3d(-4px, 0, 0);
    }
    20%, 40%, 60%, 80% {
        transform: translate3d(4px, 0, 0);
    }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* ===== BACKGROUND ANIMATIONS ===== */

/* Gradient Shift */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.gradient-animate {
    background: linear-gradient(-45deg, #10b981, #3b82f6, #8b5cf6, #06b6d4);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

/* Floating Animation */
@keyframes floating {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -10px, 0);
    }
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

.floating-slow {
    animation: floating 6s ease-in-out infinite;
}

.floating-fast {
    animation: floating 2s ease-in-out infinite;
}

/* ===== TEXT ANIMATIONS ===== */

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blinkCaret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #10b981;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 3px solid #10b981;
    white-space: nowrap;
    margin: 0 auto;
    animation: 
        typewriter 3.5s steps(40, end),
        blinkCaret 0.75s step-end infinite;
}

/* Text Gradient Animation */
@keyframes textGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.text-gradient-animate {
    background: linear-gradient(135deg, #10b981, #3b82f6, #8b5cf6);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 4s ease infinite;
}

/* ===== ICON ANIMATIONS ===== */

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 2s linear infinite;
}

.spin-slow {
    animation: spin 4s linear infinite;
}

.spin-fast {
    animation: spin 1s linear infinite;
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -15px, 0);
    }
    70% {
        transform: translate3d(0, -7px, 0);
    }
    90% {
        transform: translate3d(0, -3px, 0);
    }
}

.bounce {
    animation: bounce 1s ease infinite;
}

/* Wobble Animation */
@keyframes wobble {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    15% {
        transform: translate3d(-10%, 0, 0) rotate3d(0, 0, 1, -5deg);
    }
    30% {
        transform: translate3d(8%, 0, 0) rotate3d(0, 0, 1, 3deg);
    }
    45% {
        transform: translate3d(-6%, 0, 0) rotate3d(0, 0, 1, -3deg);
    }
    60% {
        transform: translate3d(4%, 0, 0) rotate3d(0, 0, 1, 2deg);
    }
    75% {
        transform: translate3d(-2%, 0, 0) rotate3d(0, 0, 1, -1deg);
    }
}

.wobble {
    animation: wobble 1s ease;
}

.wobble:hover {
    animation: wobble 1s ease;
}

/* ===== BUTTON ANIMATIONS ===== */

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    opacity: 0;
}

.btn-ripple:active::after {
    animation: ripple 0.6s ease-out;
}

/* Button Fill Animation */
@keyframes buttonFill {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.btn-fill-animate {
    background: linear-gradient(90deg, #10b981, #3b82f6, #10b981);
    background-size: 200% 100%;
    transition: all 0.3s ease;
}

.btn-fill-animate:hover {
    background-position: 100% 50%;
    animation: buttonFill 0.5s ease;
}

/* ===== LOADING ANIMATIONS ===== */

/* Dot Pulse */
@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.dot-pulse {
    display: flex;
    gap: 4px;
}

.dot-pulse div {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.dot-pulse div:nth-child(1) { animation-delay: -0.32s; }
.dot-pulse div:nth-child(2) { animation-delay: -0.16s; }

/* Spinner */
@keyframes spinner {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

/* ===== SCROLL ANIMATIONS ===== */

/* Fade In On Scroll */
.fade-in-scroll {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-scroll.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Staggered Children Animation */
.stagger-children > * {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.visible > * {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.6s; }

/* ===== SPECIAL EFFECTS ===== */

/* Glow Animation */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
    }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

/* Morphing Background */
@keyframes morph {
    0% {
        border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40%/50% 60% 30% 60%;
    }
    100% {
        border-radius: 60% 40% 30% 70%/60% 30% 70% 40%;
    }
}

.morph {
    animation: morph 8s ease-in-out infinite;
}

/* ===== UTILITY CLASSES ===== */

/* Animation Delays */
.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; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* Animation Durations */
.duration-fast { animation-duration: 0.3s; }
.duration-normal { animation-duration: 0.6s; }
.duration-slow { animation-duration: 1s; }
.duration-slower { animation-duration: 2s; }

/* Animation Fill Modes */
.animate-forwards { animation-fill-mode: forwards; }
.animate-backwards { animation-fill-mode: backwards; }
.animate-both { animation-fill-mode: both; }

/* Prevent Animation */
.no-animation { 
    animation: none !important; 
}

/* 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;
    }
}

/* ===== PAGE TRANSITIONS ===== */

/* Page Load Animation */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.page-load {
    animation: pageLoad 0.8s ease-out;
}

/* Staggered Page Load */
.stagger-load > * {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.stagger-load > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-load > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-load > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-load > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-load > *:nth-child(5) { animation-delay: 0.5s; }