Investigation of the structural, electronic, mechanical, and optical properties of NaXCl3 (X = Be, Mg) using density functional theory