Is it true that for as long as you think about evil in your heart and do not act it out,you are okay?

NO!

Those negative thoughts are the same like carrying out the acts.Thoughts form the foundation for the subsequent actions.Who then says the foundation of a house is not important?

Evil thoughts are just as evil as evil deeds!

“But I tell you that anyone who looks at a woman to lust after her has already committed adultery with her in his heart.”