(A) all necessary equitable and legal relief, including, where appropriate, declaratory relief, injunctive relief, civil penalties, and compensatory damages, to prevent the occurrence, continuance, or repetition of the actual or threatened violation of section 2 and to compensate for losses resulting from such violation