Medical question 🧐

I’ve been trying for months to figure out why my legs hurt at the end of my period for 2-3 days, mostly at night. I don’t think it’s restless legs or endometriosis. Anyways, I get pretty bloated the first 1-3 days of my period, then days 4-5 I pee a LOT more than usual which I’m thinking is from being bloated and water retention. Then when my period is ending, I get achy legs on days 5-6, sometimes 7. I’m thinking the achy legs is from dehydration after peeing so much the previous day/s? I have zero medical experience so I’m just wondering if this even makes sense or could be the cause of my aching legs at the end of my period? 😂 thank you