Unraveling the electronic, optical, ferroelectric, and electrocaloric properties of PbxSr1-xTiO3 thin film: Insight from first-principles effective Hamiltonian