A 27-year-old woman presents with lower abdominal pain, fever, and foul-smelling vaginal discharge. On pelvic examination, she has cervical motion tenderness and a palpable adnexal mass. Transvaginal ultrasound reveals a complex, thick-walled adnexal mass with internal echoes. Which of the following is the most likely diagnosis?