Is it haram for an unmarried girl to think about having sex? By this I mean seeing herself having sex with a guy who she finds attractive and thinking about how it would feel if the were a married couple in bed.
that top answer is totally wrong its sad that is been voted as the most correct when it doesnt clarify the difference between passing thoughts and intentionally fantasising about having sex. when you continue to dwell on that image it will let lust into your heart and harm you spiritually so yeah its a sin. If shaitan cast the image in your imagination and you look at it or your nafs wandered to it, disengage for your own spiritual well being. when you continuely lust it builds up in your heart over time and weighs you down making you feel depressed... so leading you to a bigger sin is not the only harm in it at all. not sinning is about helping yourself.
Sexual fantasies, I would say, are not uncommon for Muslims. The only problem, for men especially, is that sexual fantasies may lead to something more, including masturbation, or even worse, committing zina. That being said however, having sexual fantasies is by no means a sin, as long as the person does not act upon it.
Sexual fantasies are among the thoughts that cross a person’s mind because it is something that is stored in the subconscious which is affected by the environment in which he lives and the scenes that he sees. These are thoughts that occur to most people, especially the youth, but they vary from one person to another with regard to their type, strength and effect.
“Allaah burdens not a person beyond his scope”
It was narrated from Abu Hurayrah (may Allaah be pleased with him) that the Prophet (peace and blessings of Allaah be upon him) said: “Allaah has forgiven my ummah for whatever crosses their mind so long as they do not speak of it or act upon it.” Narrated by al-Bukhaari (2528) and Muslim (127).
Therefore, it is very important not to act upon a fantasy, whichever form it may be. So as long as the person is in control of the situation, it is not a sin.
Finally, take a look at this site that answers in more detail a very similar, if not the same, topic.
First of all, if the thoughts are un-intentional, or in dream, then its not your fault or not a sin at all. But if you intentionally visualize anything like that, then it should be avoided completely, as it can be first way towards Zina (as committing Zina's first step starts from thinking about it, which fuels your lust). So you should avoid anything, which fuels the lust.
If you want to visualizer about it that how it would feel, with intention to know that situation, its my personal opinion to avoid that too (unless you are 100% sure that you have control over yourself completely).
(Note: my opinions are based on very limited knowledged i have about islam, and i am not a scholar, i would recommend that you consult a scholar as well, in this case)
And Allah knows the best.
Thinking about haram act till has not been done,Also till intention wouldn't be Sexual satisfaction and be without Manipulation,isn't sin.
But pay attention It leads to sin and makes injuries in person 's mind and make it dark.It 's better to avoid thinking about that.(ayatollah Makarem)
Hazrat masih(Christ) (a.s.) said to his Followers:
"Hazrat Moses intuited you to avoid zina,but I enjoin you even don't think about it;because someone who thinks about zina is the same as a person who Turns Fire in a beautiful colorful room;in that situation It 's possible that room doesn't take fire but fire 's smoke will make the room dark and will ruins it."(ghurar al-hikam,volume3,page451)
So It 's better to avoid thinking about sins which leads to sin.
As the other answers have pointed out
Thoughts by themselves do not count as hayir (good deeds) or sher (bad deeds). To illustrate for example: its not enough to think about the suras when you are performing the salah. If the imam is not leading the salah you have to move your lips in recitation and be able to hear yourself in recitation.
So idle thoughts don' t count either way. That being said special consideration and caution must be exercised in taming your nefs. An explanation of the nefs and its role is beyond the scope of this answer space, but briefly:
Nefs directly translated means breath but it generally symbolizes all biological needs and desires of the person. Without our nefs we could not survive. Without hunger and thirst we would not strive to make a living to put food and drink on the table Without the desire to have sex with the opposite gender, reproduction would not happen and none of us would exist.
For this, Allah maintains a very powerful and potentially explosive attraction between these opposites. Just like gasoline and oxygen can either cause a destructive explosion or a very useful controlled slow burn to power our vehicles; likewise an unregulated interaction between the genders can lead to explosion (adultery, prostitution, fatherless children, immorality, promiscuity, family corruption, etc) while the regulated and harnessed 'controlled slow burn' will yield the blessed results of peaceful and happy marriage structure and children.
Such volatile mixtures are difficult to control if uncovered. If we think of men as oxygen and women as gasoline, leaving the latter uncovered can lead to explosion; Allah Muhafaza. For this reason, Allah commanded women to cover themselves in public and in front of non-mehram men (Quran 24:31). And men (and women) are commanded to 'lower their gaze'(Quran 24:30).
This 'lower your gaze' applies for today also for media and Internet. It is hard to control yourself when the display of forbidden fruit is just clicks away.
It's when you let your nefs take over your heart and let love of the ephemoral dunya take preference over the love of Allah that may result in sinful action and spiritual corruption.
The nefs has to be kept restrained on a leash of self restraint through faith and taqwa (Quran 91:7-10). This concept of taqwa and self-restraint is alien to the west where it is encouraged to follow your lusts and desires, instant gratification, and let your nefs run wild.
So how do we tame our nefs and keep it on a leash when our senses are bombarded by inappropriate and un-Islamic promiscuity?
The other answers already covered fasting as one technique.
Another effective technique could be neuro-linguistic programming. Please see works on this topic by Anthony Robbins. The way it would work is associating a negative sensation with the sexually provocative image or fantasy. For example associating the smell of very bad breath every time you see the image. After some time and practice you will be disgusted with the image instead of having pleasure fantasies.
Another technique: Each time the sexual fantasy pops into your mind, make dua to Allah to present this person in perfect form and personality in Jennah and for sabr to wait until then. As promised in the Quran the real jewels are in Jennah, in this dunya what looks like jewels are just broken glass and you will likely cut your yourself if you touch or wear them.
According to Islamqa it is Makrooh which means that one will be rewarded for avoiding it but will not be punished for doing it.