I preferred Nicaragua to Costa Rica, tbh. I think CR has a greater rep because it's politically stable and has geared itself toward tourism. When I was down there, Nicaragua was enjoying one of its rare peaceful periods. CR may have the better surfing and beaches, but I'm not as into that anyway.
In order to stay in CR for six months, I had to hop over the border for 3+ days twice. Strange loophole that allows you to avoid getting a visa. Granada, Nicaragua is one of the best cities I've ever been to. Beautiful Spanish architechture, wide traffic-free avenues, amazing mix of local culture and tourism, incredible people. Costa Ricans tend to be more standoffish by Latin American standards.
Panama was also great, and completely different from either of the other two countries. Went to Bocas del Toro -- a chain of islands off the Atlantic coast. Had more of a Caribbean vibe. Laid back party atmosphere. There was an amazing bar called El Barco Hundido (The Sunken Ship) that was on the water next to an actual sunken boat.