All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad,
, is His slave and Messenger.
All that you suffer from and the thoughts that you mentioned are nothing but whispers.
These whispers do not harm you and do not affect the validity of your faith as long as you hate them and repel them, whether or not they lasted for long.
As long as you do not willingly give in to them and reject and repel them, then they will not harm you at all.
However, you have to strive against them and endeavor to get rid of them until Allah rids you from them with His Favor and Mercy.
We can authoritatively assert that you did not deliberately indulge in these thoughts; rather, they are mere whispers, and therefore, you are not sinful for them in principle as they occur without your choice.
So you must repel them and do your best to get rid of them and do not pay any attention to them.
We recommend that you consult a trustworthy psychiatrist.
Allah knows best.