/**
 * =============================================================================
 * MICRO-INTERACTIONS & DELIGHT ENHANCEMENTS
 * =============================================================================
 *
 * PURPOSE:
 * - Add personality and whimsy to user interactions
 * - Create memorable moments users want to share
 * - Enhance perceived performance through satisfying feedback
 * - Make the interface feel alive and responsive
 *
 * PHILOSOPHY:
 * - Every interaction should feel buttery smooth
 * - Animations should enhance, never distract
 * - Respect user preferences (prefers-reduced-motion)
 * - Performance-first: hardware-accelerated transforms
 *
 * CREATED: 2025-10-11
 * =============================================================================
 */

/* =================================================================== */
/* ACCESSIBILITY FIRST - REDUCED MOTION SUPPORT */
/* =================================================================== */

/**
 * Respect user preferences for reduced motion
 * Provide instant feedback instead of animated transitions
 */
@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;
    }
}

/* =================================================================== */
/* BUTTON MICRO-INTERACTIONS */
/* =================================================================== */

/**
 * DELIGHTFUL BUTTON STATES
 * Buttons should feel tactile and responsive
 * Using scale + shadow for satisfying feedback
 */

.button,
a.button,
button[type="submit"],
.button.is-primary,
.button.is-secondary {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    backface-visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

/* Hover state: Lift and glow */
.button:hover,
a.button:hover,
button[type="submit"]:hover,
.button.is-primary:hover,
.button.is-secondary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15),
                0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Active state: Press down */
.button:active,
a.button:active,
button[type="submit"]:active,
.button.is-primary:active,
.button.is-secondary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition-duration: 0.1s;
}

/* Ripple effect on click */
.button::after,
a.button::after,
button[type="submit"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
    pointer-events: none;
}

.button:active::after,
a.button:active::after,
button[type="submit"]:active::after {
    width: 300px;
    height: 300px;
    opacity: 0;
    transition: 0s;
}

/* =================================================================== */
/* LOGO CAROUSEL HOVER EFFECTS */
/* =================================================================== */

/**
 * PLAYFUL LOGO INTERACTIONS
 * Logos should feel interactive and premium
 * Subtle glow and lift on hover
 */

.logo_logo,
.logo_logo-integrations {
    position: relative;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: grayscale(0.3) brightness(0.95);
    cursor: pointer;
    transform: translateZ(0);
}

/* Hover: Lift, brighten, and glow */
.logo_logo:hover,
.logo_logo-integrations:hover {
    transform: translateY(-4px) scale(1.08);
    filter: grayscale(0) brightness(1.05);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

/* Pause carousel animation on hover for better interaction */
.clients-logos-wrapper .logo_component:hover .logo_list,
.integrations-logos-wrapper .logo_component:hover .logo_list {
    animation-play-state: paused !important;
}

/* Individual logo pulse on hover */
@keyframes logo-pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
    }
    50% {
        box-shadow: 0 12px 32px rgba(59, 130, 246, 0.25);
    }
}

.logo_logo:hover,
.logo_logo-integrations:hover {
    animation: logo-pulse 2s ease-in-out infinite;
}

/* =================================================================== */
/* SECTION SCROLL REVEAL ANIMATIONS */
/* =================================================================== */

/**
 * ELEGANT SCROLL REVEALS
 * Sections fade and slide in as user scrolls
 * Creates sense of discovery and flow
 */

.section_features,
.section_video,
.section_testimonial,
.section_integrations {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section_features.is-visible,
.section_video.is-visible,
.section_testimonial.is-visible,
.section_integrations.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger child elements for cascading effect */
.features_content {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.features_content.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Add delay to create cascade */
.features_content:nth-child(1) { transition-delay: 0.1s; }
.features_content:nth-child(2) { transition-delay: 0.2s; }
.features_content:nth-child(3) { transition-delay: 0.3s; }
.features_content:nth-child(4) { transition-delay: 0.4s; }

/* =================================================================== */
/* CARD HOVER EFFECTS */
/* =================================================================== */

/**
 * TESTIMONIAL CARD DELIGHT
 * Cards lift and glow on hover
 * Smooth, premium feel
 */

.testimonial_card {
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
    backface-visibility: hidden;
}

.testimonial_card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

/* Subtle animation on card image */
.testimonial_card img {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.testimonial_card:hover img {
    transform: scale(1.05);
}

/* =================================================================== */
/* INPUT & FORM INTERACTIONS */
/* =================================================================== */

/**
 * FRIENDLY FORM FIELDS
 * Inputs should feel responsive and helpful
 */

input[type="email"],
input[type="text"],
textarea,
.newsletter-input,
.spark_input-field {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus,
.newsletter-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15),
                0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

/* Pulse animation on focus */
@keyframes input-pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15),
                    0 0 0 3px rgba(59, 130, 246, 0.1);
    }
    50% {
        box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2),
                    0 0 0 4px rgba(59, 130, 246, 0.15);
    }
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus {
    animation: input-pulse 2s ease-in-out infinite;
}

/* =================================================================== */
/* LINK INTERACTIONS */
/* =================================================================== */

/**
 * PLAYFUL LINK UNDERLINES
 * Animated underline on hover for better feedback
 */

.footer_link,
.navbar_link,
a:not(.button) {
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.footer_link::after,
.navbar_link::after,
a:not(.button)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer_link:hover::after,
.navbar_link:hover::after,
a:not(.button):hover::after {
    width: 100%;
}

/* =================================================================== */
/* SCROLL PROGRESS INDICATOR */
/* =================================================================== */

/**
 * SUBTLE SCROLL PROGRESS
 * Show reading progress with elegant bar
 */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* =================================================================== */
/* LOADING STATES */
/* =================================================================== */

/**
 * DELIGHTFUL SKELETON SCREENS
 * Turn waiting into entertainment
 */

@keyframes skeleton-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loader {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 1000px 100%;
    animation: skeleton-shimmer 2s infinite linear;
    border-radius: 0;
}

/* =================================================================== */
/* CURSOR ENHANCEMENTS */
/* =================================================================== */

/**
 * PLAYFUL CURSOR STATES
 * Visual feedback on interactive elements
 */

.button,
a.button,
.logo_logo,
.logo_logo-integrations,
.testimonial_card,
.navbar_link {
    cursor: pointer;
}

.button:hover,
a.button:hover {
    cursor: pointer;
}

/* Custom cursor on specific interactive areas */
@media (hover: hover) and (pointer: fine) {
    .logo_component {
        cursor: grab;
    }

    .logo_component:active {
        cursor: grabbing;
    }
}

/* =================================================================== */
/* NUMBER COUNTING ANIMATION */
/* =================================================================== */

/**
 * COUNTING NUMBERS
 * Animate numbers from 0 to target value
 * Makes metrics feel more impressive
 */

.stat-number {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-number.is-counting {
    animation: number-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes number-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =================================================================== */
/* SUCCESS STATES & CELEBRATIONS */
/* =================================================================== */

/**
 * CONFETTI BURST
 * Celebrate user achievements
 * Trigger on form submissions, button clicks, etc.
 */

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

.confetti-piece {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    pointer-events: none;
    z-index: 10000;
    animation: confetti-fall 3s ease-out forwards;
}

/* Success checkmark animation */
@keyframes success-checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-checkmark {
    display: inline-block;
    animation: success-checkmark 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =================================================================== */
/* FLOATING ANIMATIONS */
/* =================================================================== */

/**
 * SUBTLE FLOAT EFFECT
 * Add life to static elements
 * Great for badges, icons, CTAs
 */

@keyframes float-gentle {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float-gentle 3s ease-in-out infinite;
}

/* Apply to specific elements */
.hero_content-wrapper img,
.features_dynamic-image-container img {
    animation: float-gentle 6s ease-in-out infinite;
}

/* =================================================================== */
/* SHAKE ANIMATIONS (ERROR STATES) */
/* =================================================================== */

/**
 * FRIENDLY ERROR FEEDBACK
 * Shake input on validation error
 * Makes errors feel helpful, not harsh
 */

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-8px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(8px);
    }
}

.shake-animation {
    animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* =================================================================== */
/* GLOW EFFECTS */
/* =================================================================== */

/**
 * ATTENTION-GRABBING GLOW
 * Use sparingly for important CTAs
 */

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4),
                    0 0 40px rgba(59, 130, 246, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6),
                    0 0 60px rgba(59, 130, 246, 0.3);
    }
}

.glow-effect {
    animation: glow-pulse 2s ease-in-out infinite;
}

/* Apply to primary CTA */
.button.is-primary {
    position: relative;
}

.button.is-primary::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899);
    opacity: 0;
    z-index: -1;
    filter: blur(12px);
    transition: opacity 0.3s ease;
}

.button.is-primary:hover::before {
    opacity: 0.6;
    animation: glow-pulse 2s ease-in-out infinite;
}

/* =================================================================== */
/* PARALLAX EFFECTS */
/* =================================================================== */

/**
 * SUBTLE DEPTH ON SCROLL
 * Create sense of layers and depth
 */

.parallax-layer {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Applied via JavaScript on scroll */

/* =================================================================== */
/* BOUNCE ANIMATIONS */
/* =================================================================== */

/**
 * PLAYFUL BOUNCE
 * Use for attention-grabbing elements
 */

@keyframes bounce-gentle {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-12px);
    }
    60% {
        transform: translateY(-6px);
    }
}

.bounce-animation {
    animation: bounce-gentle 1s ease-in-out;
}

/* =================================================================== */
/* TEXT SHIMMER EFFECT */
/* =================================================================== */

/**
 * PREMIUM TEXT SHIMMER
 * Add sparkle to headings
 */

@keyframes text-shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.text-shimmer {
    background: linear-gradient(
        90deg,
        currentColor 40%,
        rgba(255, 255, 255, 0.8) 50%,
        currentColor 60%
    );
    background-size: 1000px 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shimmer 3s linear infinite;
}

/* =================================================================== */
/* SMOOTH SCROLLING */
/* =================================================================== */

/**
 * BUTTERY SMOOTH SCROLLING
 * Only on devices that support it
 */

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* =================================================================== */
/* RESPONSIVE ADJUSTMENTS */
/* =================================================================== */

/**
 * Reduce animation intensity on mobile for better performance
 */

@media screen and (max-width: 767px) {
    /* Simpler hover states on mobile */
    .button:hover,
    a.button:hover {
        transform: translateY(-1px) scale(1.01);
    }

    .testimonial_card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .logo_logo:hover,
    .logo_logo-integrations:hover {
        transform: translateY(-2px) scale(1.04);
    }

    /* Disable complex animations on mobile */
    .float-animation {
        animation: none;
    }
}

/* =================================================================== */
/* EASTER EGGS */
/* =================================================================== */

/**
 * SECRET DELIGHT MOMENTS
 * Hidden animations for power users
 */

/* Konami code easter egg (applied via JS) */
.konami-active {
    animation: rainbow-rotation 2s linear infinite;
}

@keyframes rainbow-rotation {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Triple click header easter egg */
.heading-style-h1.party-mode {
    animation: party-pulse 0.5s ease-in-out infinite;
}

@keyframes party-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* =================================================================== */
/* PERFORMANCE OPTIMIZATIONS */
/* =================================================================== */

/**
 * Hardware acceleration for smooth animations
 * Use transform and opacity for 60fps
 */

.button,
.logo_logo,
.logo_logo-integrations,
.testimonial_card,
.features_content,
input,
textarea {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Remove will-change after animation completes */
.button:not(:hover),
.logo_logo:not(:hover),
.testimonial_card:not(:hover) {
    will-change: auto;
}

/* =================================================================== */
/* END OF MICRO-INTERACTIONS */
/* =================================================================== */
