The Arab and The Moors build most of the magnificent buildings from scratch.
https://en.wikipedia.org/wiki/Moorish_architecture
For Alhambra case, the Arab Moors build it as small fortress from the remain roman fortifications. Then the Moorish emir Mohammed ben Al-Ahmar of the Emirate of Granada rebuild it as Palace.
Lets make difference between ruin and the Palace. But the Spaniard in denial of the Arab Moors Superpower legacy. They refuse to accept the cultural and architectural Arab Moors legacy. What a shame.
Alhambra on Wikipedia
The Alhambra (/ælˈhæmbrə/; Spanish: [aˈlambɾa]; Arabic: الْحَمْرَاء [ʔælħæmˈɾˠɑːʔ], Al-Ḥamrā, lit. "The Red One"),[Note 1][Note 2] the complete Arabic form of which was Qalat Al-Hamra,[Note 3] is a palace and fortress complex located in Granada, Andalusia, Spain. It was originally constructed as a small fortress in AD 889 on the remains of Roman fortifications, and then largely ignored until its ruins were renovated and rebuilt in the mid-13th century by the Moorish emir Mohammed ben Al-Ahmar of the Emirate of Granada, who built its current palace and walls. It was converted into a royal palace in 1333 by Yusuf I, Sultan of Granada.[1] After the conclusion of the Christian Reconquista in 1492, the site became the Royal Court of Ferdinand and Isabella (where Christopher Columbus received royal endorsement for his expedition), and the palaces were partially altered to Renaissance tastes. In 1526 Charles I & V commissioned a new Renaissance palace better befitting the Holy Roman Emperor in the revolutionary Mannerist style influenced by Humanist philosophy in direct juxtaposition with the Nasrid Andalusian architecture, but which was ultimately never completed due to Morisco rebellions in Granada.
Alhambra's late flowering of Islamic palaces were built for the last Muslim emirs in Spain during the decline of the Nasrid dynasty who were increasingly subject to the Christian Kings of Castile. After being allowed to fall into disrepair for centuries, the buildings occupied by squatters, Alhambra was rediscovered following the defeat of Napoleon, who had conducted retaliatory destruction of the site, the re-discoverers were first British intellectuals and then other north European Romantic travelers. It is now one of Spain's major tourist attractions, exhibiting the country's most significant and well-known Islamic architecture, together with 16th-century and later Christian building and garden interventions. The Alhambra is a UNESCO World Heritage Site and the inspiration for many songs and stories.[2]
https://en.wikipedia.org/wiki/Alhambra