Scaling and precursor motifs in earthquake networks