TMI!!

So during sex I had a pretty bad pain and didn’t know what it was and after sex, I was in so much pain to the point where I had to crouch to reduce pain. I got a notification that night that my period will start in 2 days. The pain felt like a really bad cramp from my period but I didn’t know what it is. And I had gas and then the pain kinda went away but now when I pee, I feel like cramps which is super weird for me. Does anyone know what this could be?