Superconducting properties of barium in three phases under high pressure from first principles