A 2-Styryl-1,8-naphthyridine derivative as a versatile fluorescent probe for the selective recognition of Hg2+, Ag+ and F− ions by tuning the solvent