Trifunctional metasurface for manipulating linearly and circularly polarized waves in transmission and reflection modes