Dielectric Metasurfaces from Fundamentals to Applications