I was reading the Quran when my mind said that I’m officially not a Muslim. I’ve been repenting and crying because I love being Muslim. Did that thought make me a Kafir? Do I have to go to the mosque and say my Shahadah?
as salam alaikum
since you were doing a good deed with good intention, you didn't do anything wrong, let alone not being Muslim or having left Islam.
A believer should be aware that Shaytan is always ready to whisper to him and one way to fight him is to ignore bad thoughts and multiply good actions.
With prayers for your success.