First Time

Last night I lost my virginity. It hurt so much and eventually I started bleeding. I don’t know yet but if this is my period is it ok that I had sex while it started. If not, what could this be? Is it safe? Why did it hurt so much?