Recent Progress in Reconfigurable and Intelligent Metasurfaces: A Comprehensive Review of Tuning Mechanisms, Hardware Designs, and Applications