Chitosan-based hydrogels for the sorption of metals and dyes in water: isothermal, kinetic, and thermodynamic evaluations