Improved bar animation and gesture detection