First-principles study of the electronic structure and optical properties of cubic Perovskite NaMgF3