Impact of Stellar Superflares on Planetary Habitability