Effect of Mg doping on optical and electrical properties of SnO2 thin films: An experiment and first-principles study