Advice? Daughters father locked up

Angelina

So my daughters father and I were together for six years she is 2.5 we split up when she was one. I’ve always loved him and wished he could love me the same way but unfortunately there is no hope for us to ever be together and I have accepted that but recently he went to jail and has been locked up. In the past two years have been hell for me. Rough custody battle where he had temporary custody of her up until recently when he was arrested and the baby was placed with me by dcf and we have a court hearing December 1st for me to get custody of her back. Is it wrong that I still care about him? It’s normal to me because of my big heart and our past together. He wrote me a letter and I wrote him back. How can I deal with my emotions knowing that I will have to love him from a distance and that he is at fault for his own actions and I shouldn’t feel bad. Any advice from other mommies out there who have been through something similar?