It is ramadan and yesterday, i was not sure if my period ended yet. So, I thought today i was not going to fast because i was not certain that it had ended. When i woke up today after fajr, i did not intend to fast but i soon realized that, in fact, it did end. And it would have ended before fajr. At that point, it was well before dhuhr and i had not eaten or drank anything so, i fasted this whole day.
Is my fast valid? Do i still have to make it up?