I don't know much about Italy, but why did the country with the heart of the Roman Empire and the birthplace of the renaissance never managed to leverage those things to become a major power like France or Germany or even Spain in the 15th century?
I would assume they would be pretty rich, they had a central position in the Mediterranean that seems conducive to trade and maybe colonization(?) and they seem to be pretty secure from invasions with the alps on the north side and sea from pretty much everywhere else.
So why did they never become a major power? or if they were a major power, why didn't they manage to leverage it to modern times?
I think the question is flawed -- in many salient ways, the states, and later state, of Italy were and did become major powers on the world stage -- up to and including the modern day, in which Italy is the prime mover in the founding of the European Union, and by many measures the 7th largest economy in the world (larger than Russia, Brazil or India).
But, let's start at the beginning. I'll skim over the Roman Republic/Empire as you've acknowledged in your question the primacy of Italy for an enormous period of antiquity. But that means we've got the year 476 (the traditional, though somewhat arbitrary, date of the 'fall of the Western Roman Empire') until today to look at, and see what Italy and its various states have accomplished.
So! First things first, we have to consider just who might reasonably be deemed to be 'Italian' -- for example, the Lombards who settled in Italy and formed an iteration of the Kingdom of Italy: Shall we consider them to be an Italian state, or an occupying force? It's hard to tell, as often as not the 'invaders' from the lands on the periphery of the Roman Empire were Latinized and Romanized to a significant extent. In this context it's perhaps salient that most of the time and with most of the semi-Germanic tribes who eventually came to call Italy home and the kingdom theirs, there was a blurring of distinctions on whether they were Roman or not. But I'm digressing a bit.
If we take a wide view of 'Italy' as a political force, it's basically been the central theatre for nearly all of European history. Great powers of their day, like the Lombard Kingdom of Italy, could be considered the earliest iterations of power related to a 'state' of Italy after the fall of the Western Roman Empire.
Then there are the more curious examples in the early middle ages -- Charlemagne's Carolingian Empire, and then the Holy Roman Empire, for example.
The Carolingian Empire included areas that are primarily today Germany, France and Italy (along with Belgium, Switzerland etc.) -- but notably, the largest city in the empire was Rome, and Charlemagne was explicitly crowned emperor in Rome by the Pope. So in a real way, Italy as a socio-cultural-political unit was a fundamental factor in the realization of great-power status for Charlemagne.
The same is then true of the Holy Roman Empire -- and though the oft-quoted quip about it being 'neither Holy, nor Roman, nor an Empire' is in the popular imagination, it's mostly stuck around because it's a funny aside, and not because it's particularly accurate. It WAS an empire, though with varying degrees of imperial power throughout its existence, and in 962 when Otto is crowned the Holy Roman Emperor it is explicitly to capitalize on Charlemagne's, and thus Rome's legacy.
So the HRE becomes another state that is integrally partially Italian and partially German -- culturally and socially, it's again important to note that some of the largest cities in the HRE are Bologna, Rome, Florence, et cetera, and not just Frankfurt and the German cities, though they were large too.
But you could argue all of these are a stretch, perhaps -- indeed, I think most historians would balk at calling the Holy Roman Empire an Italian state, as in many/most ways, it really wasn't.
We can certainly, however, find Italian kingdoms/states/governments/polities that have great-power status throughout the Middle Ages. The most obvious are naturally the Maritime Republics -- Venice and Genoa foremost, though others like Pisa and Amalfi not insignificant.
To say Venice was a Mediterranean superpower in the 1000-1300 period is, I think, not overstating the case. Venice was one of Europe's largest and most cosmopolitan cities, and presided over a large maritime empire stretching from what is now Russia/Ukraine to Africa to Greece to Lebanon, and of course its Terrafirma land empire in Italy. Venice's impact on the world is really hard to overestimate, in my view -- from facilitating the Crusades, to spreading the Black Death, to sacking Constantinople and indirectly bringing about the fall of the Byzantine Empire to capturing early European exploratory sentiment with the travels of one of Venice's most famous sons, Marco Polo. Genoa gets a bit of short-shrift in all this, possibly only because the city of Venice itself is (frankly) way cooler, but Genoa also has enormous impact on the world stage, from ferrying the Ottomans into Greece, to basically founding mercantilism/capitalism and the banking system -- not to mention an equally exploratory spirit, personified by Genoa's answer to Marco Polo in Christopher Colombus (who I daresay had something of an impact on the world too).
There were other powers in Italy beyond the maritime republics, though, that had huge influence in the world -- the Norman Kingdom of Sicily, for one, which led the charges on the Crusades literally and figuratively, and acted as counter-balance to the Holy Roman Empire's attempts to bring the Papal States to heel. They even briefly turned Palermo into one of Europe's richest, most learned and most cosmopolitan capitals.
Then we come to the Renaissance, which you've already mentioned, and so I'll gloss over -- but suffice it to say that the adage that the Renaissance 'rescued the world from darkness' is, while not perhaps accurate or nuanced, at least a good indicator of the importance this period has had on our collective civilization's memory. Powers like Florence under the Medicis, Rome under the Renaissance Popes, and Milan, Sienna, Pisa, Verona, Padua, etc. all had vastly outsize effects on the world, from architecture to art to cuisine to engineering to military invention and beyond.
Part and parcel with the Renaissance, we get into a period where Italy is particularly fractured and tormented -- the infamous Italian Wars. Even here, though, it's hard to think of Italy as being a backwater; even during the periods of strife, it remained a dynamo of great individuals to make their name on the world stage, from the aforementioned Christopher Colombus to Leonardo da Vinci and all of the other famous names you've heard.
Now, perhaps, we get to the heart of your question -- so what about in the age of empire? Well, it's true, Italy is a latecomer to the stage, because it was so fractured. But the Kingdom of Sardinia, which isn't really very well-named as it was mainly the rich, industrial, powerful provinces of Northern Italy and the Po Plain like Milan, Turin and Genoa (plus Sardinia, admittedly), does participate as one of the 'lesser of the Great Powers' in the 19th century. Napoleon (another son of Italy by many reckonings, gone on to greatness in foreign service) had created his Kingdom of Italy satellite state, and while this didn't long outlast him, it did crystallize the momentum the House of Savoy of the Kingdom of Sardinia gained. Within a few decades of Napoleon's defeat, the Kingdom of Sardinia is participating in the Crimean War alongside Britain and France, as well as several wars against the Hapsburg empire.
These movements culminate in the Risorgimento, which sees the unification of Italy and such fascinating figures as Garibaldi, Cavour and Victor-Emmanuel. Is this 'great power'? Well, it was considered so by the other European states of the time; Bismarck, Napoleon III and the hapless Hapsburgs all reckoned on Italy as a major power in the new balance in Europe. Italy during this period also continued its tradition of supplying the world with exceptional individuals -- the radio, for example, is developed by Guglielmo Marconi in 1895, the telephone is arguably creditable to Antonio Meucci in 1870, the battery to Alessandro Volta, and on.
Europe also generally perceived Italy as a great power during the world wars. Italy embarked on some colonialism late in the game, and indeed took over some bits of Africa, including Libya, Somalia and Eritrea (which are, tragicomically, perhaps the most ruined and degraded states in Africa today). It participated in World War I, and by some measures caused the dissolution of Austria-Hungary after the battle of Vittorio Veneto.
Cont'd