Probing the magnetic and structural properties of the 3d, 4d, 5d impurities encapsulated in an icosahedral Ag12 cage