You might consider a convertable pistol,,,
One that can change back and forth between a .22 and a centerfire.
I only mention this because you said recreation and
A pistol like the Sig Sauer P-226 Classic .22
comes to mind,,,
The thing about this is .22 ammo is so danged cheap,,,
So you get to shoot for recreation inexpensively.
Later you buy a X-Change Kit
that converts the pistol to a 9mm, .40S&W, .357SIG, or .45ACP,,,
Unfortunately this drives the price way above the $500 limit.
Another option is to buy a CZ-75B in 9mm
for about $500,,,
Then later buy the Kadet Adaptor Kit
to make it into a .22 pistol.
This option isn't for everyone,,,
But at least it's worth considering.
An argument to go this way is by saying,,,
But Honey, it's only a .22 plinker.