fix CSS transitions for switching directly between modals