Spotting?! What does it mean

Mackenzie • Mackenzie

I'm not sexually active. I was spotting today and it was super painful and its mid ish cycle. Its stopped now but why did that happen?!