Here is my input on this, although I am working on gaining muscle size, weight and strength. Either way you look at it, caloric intake is a MAJOR part of reaching any goal when it comes to getting your body the way you want it. I am no personal trainer but I do a lot of studies on this subject. In order to gain weight, or stay at a certain weight while exercising you want to stay at or increase your caloric intake. As mentioned before, weight lifting, doing heavier weights with lower reps and more sets builds muscle and size. Decrease the amount of weight, aim for higher reps and lower sets. This will help with toning your body. In order to lose the body fat you will have to increase your cardio. Double the amount that you do in the gym currently. One day work just cardio the whole time you are there. The next day aim for weights to tone your body. Cutting out complex carbohydrates eating only the simple carbs and LESS sugar really helps. I do not know how much water you take in at this point in time but decrease it a little. Still take in the recommended daily intake for water as it is essential to stay hydrated.
Going on diets is not necessarily unhealthy, just depends on how you go about dieting. Many of these diet products out there do not work and if it says you can lose 20 lbs in a few weeks, ABSOLUTELY DO NOT USE IT. That is very unhealthy and can cause more problems than it solves. Eat foods with less fat in it, such as salads. Try not to take in high amounts of proteins and carbohydrates since the excess that your body does not burn becomes fat stores for later use. Also as stated above, 3 months is just the beginning. It takes a while to really gain weight and to lose it in return. If something you want was handed to you on a silver platter, there is nothing special about it right? Just work hard, change your routine up periodically and never give up. Stay confident and over time the progress you are making will really start to show.
I mean, take it from me, I have been working out for years and have never completely reached my goal but have come close. Due to things that come up, I take time away from the gym and have to start all over again. Lucky for me, everything I read and the advice I get from others help me a lot. When I first joined a gym a few years ago, I went from 140 lbs to 170 lbs in just over 2 months but hit a plateau. My goal was 195. Point is, it will happen, just takes time but it is very much worth it when you reach that goal. I hope this helps and the best of luck to you. I have faith in you.