Coupling between radiation and internal modes: Light trapping in thin film solar cells with periodic texture