I’m not even sure if the OP has sinned at all in what he describes. What do you mean “I had a thought?” There’s a difference between a thought popping into our heads and us deliberately dwelling on our thoughts. If a supposedly hateful thought just came along, about a priest or not, it isn’t really a sin. All kinds of thoughts run through our heads all the time, quite unconsciously.
The analogy I typically use, particularly with regard to sexual thoughts, but it holds up here too, is that it’s sort of like when I’m in the grocery store and I see a magazine at the checkout stand. The woman on the cover is wearing barely anything, and yet I did not put that magazine there, I did not put that photo on the cover, and I did not put that string bikini on that woman. Though I saw it, so long as I didn’t pick it up and examine it or, still worse, put it in my cart and buy it, I didn’t commit a sin. There’s a difference between seeing the thing (or having the thought) and dwelling on it.
In any case, it is unwise to ask questions about matters of conscience on internet forums, as you can see from the contradictory answers you’ve already gotten. Please speak with your priest about matters pertaining to the confessional.
-Fr ACEGC