First principles insight into physical properties of CaX2O4 (X = In, Gd) spinels for optical and spintronic applications