I spent 3 days in Barcelona and 3 in Madrid. After that, the plan was to go to different places along the coast, some of which nobody has heard of and some which are very famous. I knew I'd be leaving Spain from Valencia on the 16th, so I had 4 nights to spend.
I flew from Madrid to Malaga on 3/12, because only planes from the U.K. land at Gibraltar's airport. I also didn't want to spend the night in Gibraltar and didn't want to drive there nor rent a car in Gibraltar and return it to Spain. I rented a car at the Malaga airport. I tried to schedule 2 to 4 hours driving time per day. Because of my arm injury, I switched from a manual to an automatic. I got a shitty Skoda but it did the job until the very end. I calculated about a 2 hour drive to Gibraltar. I found what I thought was a nice hotel on the east side of Malaga, also about a 2 hour drive from Gibraltar. It happened to be the worst hotel of my trip (with Stockholm a close second.)
One of the target places was The Alhambra in Grenada, so found a place near the coast called Almeria (I wanted to spend all my nights at Spanish coastal cities.) While perusing the map for my next goal, I saw there were Punic Walls in Cartagena, so I picked it and found a nice hotel there. It happened to be the best hotel of the trip. I looked for a place in between Cartagena and Valencia and found Javea or Xabia (both spellings are correct - I think one is Andalusian but don't quote me.) There was a cool AirBnB and it really was very nice.
Finally, I would drive to Valencia from Xabia early and hang around before my flight to Vienna. Plans changed a bit because of the car.