Isometries on CAT(0) spaces, iteration of mapping classes and Weil-Petersson geometry