This is a long story but I promise I will try and keep it as short as possible.
I met this guy online 2 years ago now when I moved here for uni. We clicked immediately, had a lot in common and just understood each other very well. We would talk constantly but never meet up. For context, he is muslim and I myself am not and his family is against him dating or even hanging out alone with girls that do not share the same beliefs.
In those two years we shared everything about each other - our problems, fears, trauma ... I always considered him my best friend, a person I can share anything and everything with. We were also flirty with each other, but since I knew I would probably never meet him in person, I didn't think much of it. Until a month ago when we finally met for the first time.
He came over in the evening, we were just sitting in front of my building talking and then he ended up spending the night at my place. We talked about how this feels so natural and easy. He said he wants to do more video chats and how he wants to see me more often and it seemed we were both on the same page. Then a few days later one of his close relatives died and I could just sense that he wasn't in a good place. I wanted to be there for him but he was more and more distant. Things were different now because I realized I really had deep feelings for him. I honestly thought he felt the same way. Then he started saying how everything is ***ed up and he doesn't know what he wants, so I distanced myself from him.
We didn't talk for 3 weeks at all and then 2 days ago he reached out again. He said how he thought he could do this on his own but he's been going through some really dark stuff and he had suicidal thoughts. He asked me if I could come to his place and I didn't even think about it twice. It was around 9 pm so I packed an overnight bag and went straight to his place. He told me everything that happened and mentioned his ex girlfriend - he said how he still has feelings for her and how he regrets ruining things between them 8 months ago. I knew about her but I didn't think he still had such strong feelings, that caught me off guard. It wasn't just about her, there were a lot of other things happening with his family. He said how he can't eat for days now, he's been having nightmares and suicidal thoughts.
While talking about it he was just crying while I was holding him in my arms. It honestly broke my heart seeing him in so much pain. We fell asleep cuddling and every now and then he would wake up and pull me closer so I would just tell him "it's okay, I'm here". I didn't sleep at all that night. It was a week night so we needed to wake up early and go to uni. When we got ready we still had time so we talked for a bit. He said how nice it is to fall asleep and wake up next to me, that I'm the first girl he ever asked to come over to his place, that he didn't dream at all and he feels so much "lighter" now. He seemed so much better too.
On campus that day we ran into each other one time and he smiled at me and waved before leaving for his class. Later that day I asked him how he was feeling and he said he's having a really good day and he actually ate something. I know it sounds funny but that made me so happy. But I still felt sad and empty to be honest. I thought he had feelings for me too. He then thanked me for the hundredth time that day for being there for him. I said he can reach out anytime and I'll always be there for him but otherwise I can't be just friends. To that he said he will do that but he needs to face it alone for a while.
So my question is, did I do the right thing in the end? Did I read too much into it? I just can't figure him out and I don't know what to do...
Any insight would be helpful and thank you to anyone who takes time in reading this through!