Your best bet is probably Russian Hill, Pacific Heights, Cow Hollow, and Noe Valley. Let’s take them in parts:
Sunshine: Generally, the farther east you go the more sunshine you get, but Noe Valley tends to get some of the best weather (along with the Mission around Dolores Park) because it is in a valley which acts as a fog barrier to a certain extent.
In terms of crime, Noe and Twin Peaks tend to be better than Russian Hill a bit which just gets a lot more foot traffic from the nearby areas. You are still in the city however, which means you should keep that in mind. But since Twin Peaks is so residential, you are just a bit safer. (Generally, the foggier areas on the west are a bit safer than those near where all the action is.)
As to transportation, all of these are okay except maybe Twin Peaks. SF’s transportation system is pretty good and you should have any problems once you figure it out.
Anyway good luck with finding your ideal place. (Btw, these places are relatively expensive as well, as you will find out when to try to find a place in them.)