/**
 * Animation variants for AvatarGroup hover effects
 * Creates a "Fan Pop" effect where:
 * 1. Hovered avatar leaps forward (scales up + lifts)
 * 2. Neighboring avatars rotate slightly away ("bow out") and recede
 * 3. Keeps visual footprint compact while adding dynamic interest
 */
const getAvatarGroupVariants = (shouldReduceMotion = false, enableAnimations = true) => {
    if (shouldReduceMotion || !enableAnimations) {
        return {
            initial: { scale: 1, opacity: 1, x: 0, y: 0, rotate: 0 },
            hover: { scale: 1, x: 0, y: 0, rotate: 0 },
            notHovered: { scale: 1, opacity: 1, x: 0, y: 0, rotate: 0 },
            default: { scale: 1, opacity: 1, x: 0, y: 0, rotate: 0 },
        };
    }
    return {
        initial: {
            scale: 1,
            opacity: 1,
            x: 0,
            y: 0,
            rotate: 0,
            filter: "saturate(1)",
        },
        hover: {
            scale: 1.02,
            y: -1,
            rotate: 0,
            opacity: 1,
            filter: "saturate(1)",
            transition: {
                type: "spring",
                stiffness: 400,
                damping: 15,
                mass: 0.8,
            },
        },
        notHovered: () => {
            return {
                scale: 1,
                y: 0,
                filter: "saturate(0)",
                transition: {
                    type: "spring",
                    stiffness: 300,
                    damping: 20,
                },
            };
        },
        default: {
            scale: 1,
            opacity: 1,
            x: 0,
            y: 0,
            rotate: 0,
            filter: "saturate(1)",
            transition: {
                type: "spring",
                stiffness: 300,
                damping: 20,
            },
        },
    };
};
/**
 * Determines which animation state to use based on hover index
 */
const getAnimationState = (currentIndex, hoveredIndex, enableAnimations) => {
    if (!enableAnimations)
        return "default";
    if (hoveredIndex === currentIndex)
        return "hover";
    if (hoveredIndex !== null)
        return "notHovered"; // Apply to ALL other items
    return "default";
};

export { getAnimationState, getAvatarGroupVariants };
