Experimental and computational study of the pH-sensitive properties of organic dye molecules