Defect-induced diverse electronic, magnetic and optical properties in monolayer CaP3