There are few who can argue that Spain was a diminishing power well before French Revolution and Napoleon's... influences. Economic stagnation, internal political identity crises, so on and so forth. By the end of the 19th century, Spain had lost virtually all of her remaining colonial holdings.
So it begs the question - did Spain have the capacity to gain a 'second wind'? If so... how?