Madrid in the heat can be problematic, but there are public pools and a lot of flats have pools on the roof. When you posted before you had a pretty big budget so you should be able to get somewhere with air conditioning, heating and a pool. Alternatively, live outside the city where the temperature goes down more at night. Many people go away every weekend in the summer to escape the heat, but there are places nearby for day trips too. There's a thread about it somewhere.
Ask about the orientation of the house/ flat because south facing will get really hot and north will be freezing cold.
There's plenty of night life. It's Madrid's speciality.