How did Spain recover from the 2004 terror attacks?

One of the darkest days in recent Spanish history was March 11, 2004, when Islamists detonated bombs on three Madrid commuter trains, killing 191 people and wounding over a thousand others.