/* ==========================================================================
   Finologi Landing Page Animations
   Smooth, Professional, Modern Animations
   ========================================================================== */

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */

/* Float Animation for Cards */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Pulse Animation for Hero Shape */
@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.2;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.3;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide In Bottom */
@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Rotate In */
@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: rotate(0);
    }
}

/* Gradient Shift Animation */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Swing */
@keyframes swing {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(5deg);
    }
    75% {
        transform: rotate(-5deg);
    }
}

/* Glow Pulse */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(26, 115, 232, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(26, 115, 232, 0.6);
    }
}

/* Border Draw */
@keyframes borderDraw {
    0% {
        stroke-dashoffset: 1000;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

/* Number Counter (for stats) */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Page Load Animations
   ========================================================================== */

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-visual {
    animation: fadeInLeft 1s ease-out 0.3s both;
}

.language-badge {
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stat-number {
    animation: countUp 0.6s ease-out both;
}

.stat-item:nth-child(1) .stat-number {
    animation-delay: 0.5s;
}

.stat-item:nth-child(2) .stat-number {
    animation-delay: 0.7s;
}

.stat-item:nth-child(3) .stat-number {
    animation-delay: 0.9s;
}

/* ==========================================================================
   Scroll-triggered Animations (AOS - Animate On Scroll)
   ========================================================================== */

/* Fade animations */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-down"] {
    opacity: 0;
    transform: translateY(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="fade-down"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-left"] {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="fade-left"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

[data-aos="fade-right"] {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="fade-right"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

[data-aos="fade-in"] {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

[data-aos="fade-in"].aos-animate {
    opacity: 1;
}

/* Zoom animations */
[data-aos="zoom-in"] {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="zoom-in"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

[data-aos="zoom-out"] {
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-aos="zoom-out"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================================================
   Hover Animations & Micro-interactions
   ========================================================================== */

/* Card Lift Effect */
.service-card,
.tool-card-modern,
.insight-card,
.visual-item {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover,
.tool-card-modern:hover,
.insight-card:hover,
.visual-item:hover {
    transform: translateY(-8px);
}

/* Button Animations */
.btn-gradient,
.btn-ghost,
.btn-outline-modern,
.btn-gradient-large,
.btn-ghost-large {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-gradient::before,
.btn-gradient-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-gradient:hover::before,
.btn-gradient-large:hover::before {
    left: 100%;
}

/* Icon Rotate on Hover */
.service-icon svg,
.tool-icon-modern svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .service-icon svg,
.tool-card-modern:hover .tool-icon-modern svg {
    transform: rotate(5deg) scale(1.1);
}

/* Link Arrow Animation */
.service-link,
.insight-link,
.tool-btn {
    position: relative;
}

.service-link svg,
.insight-link svg,
.tool-btn svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-link:hover svg,
.insight-link:hover svg,
.tool-btn:hover svg {
    transform: translateX(4px);
}

/* Gradient Text Animation */
.gradient-text {
    background-size: 200% auto;
    animation: gradientShift 4s ease infinite;
}

/* Feature Item Slide */
.feature-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover {
    transform: translateX(8px);
}

/* Floating Card Continuous Animation */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-1 {
    animation-delay: 0s;
}

.floating-card.card-2 {
    animation-delay: 2s;
}

.floating-card.card-3 {
    animation-delay: 4s;
}

/* Hero Shape Pulse */
.hero-shape {
    animation: pulse 4s ease-in-out infinite;
}

/* ==========================================================================
   Loading States & Skeleton Screens
   ========================================================================== */

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(26, 115, 232, 0.2);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==========================================================================
   Entrance Animations for Dynamic Content
   ========================================================================== */

.animate-in {
    animation: fadeInUp 0.6s ease-out both;
}

.animate-in-delay-1 {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.animate-in-delay-2 {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.animate-in-delay-3 {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.animate-in-delay-4 {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* ==========================================================================
   Progressive Reveal Animation
   ========================================================================== */

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Text Animations
   ========================================================================== */

/* Gradient Text Shine Effect */
.text-shine {
    background: linear-gradient(90deg, 
        var(--primary-blue) 0%, 
        var(--primary-teal) 50%, 
        var(--primary-green) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s linear infinite;
}

/* Typewriter Effect */
@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--primary-blue);
    white-space: nowrap;
    animation: typewriter 3s steps(40) 1s both,
               blink 0.75s step-end infinite;
}

/* ==========================================================================
   Page Transition Animations
   ========================================================================== */

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-transition {
    animation: pageSlideIn 0.4s ease-out;
}

/* ==========================================================================
   Scroll Progress Indicator
   ========================================================================== */

@keyframes progressBar {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform-origin: left;
    z-index: 9999;
    transition: transform 0.2s ease-out;
}

/* ==========================================================================
   Badge & Tag Animations
   ========================================================================== */

.badge-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.05);
    }
}

.badge-bounce {
    animation: badgeBounce 2s ease-in-out infinite;
}

/* ==========================================================================
   Staggered Animations for Lists
   ========================================================================== */

.stagger-children > * {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out 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; }

/* ==========================================================================
   Parallax Effect (Optional - use with JS)
   ========================================================================== */

.parallax-element {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* ==========================================================================
   Responsive Animation Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    /* Reduce animation intensity on mobile */
    .floating-card {
        animation: float 8s ease-in-out infinite;
    }
    
    .hero-shape {
        animation: pulse 6s ease-in-out infinite;
    }
    
    /* Simplify hover effects on touch devices */
    @media (hover: none) {
        .service-card:hover,
        .tool-card-modern:hover,
        .insight-card:hover,
        .visual-item:hover {
            transform: none;
        }
    }
}

/* ==========================================================================
   Accessibility - Respect User Preferences
   ========================================================================== */

@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;
    }
    
    .floating-card,
    .hero-shape,
    .gradient-text,
    .text-shine {
        animation: none !important;
    }
    
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   Performance Optimizations
   ========================================================================== */

/* Use GPU acceleration for animations */
.hero-visual,
.floating-card,
.hero-shape,
.service-card,
.tool-card-modern,
.insight-card,
.btn-gradient,
.btn-ghost {
    will-change: transform;
}

/* Remove will-change after animation completes */
.animation-complete {
    will-change: auto;
}

/* ==========================================================================
   Easter Egg Animations (Optional)
   ========================================================================== */

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

.konami-code-active {
    animation: rainbow 2s linear infinite;
}

/* ==========================================================================
   Print - Disable Animations
   ========================================================================== */

@media print {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}