Tailoring randomly rough textures for light trapping in thin-film solar cells