How is the word φιλόσοφος formed?

I know φιλέω/φιλῶ means “love”, but about the σοφός, is it σοφ and then added -ος, or just the whole word? I have this question, because I am not sure about whether it is a noun or an adjective. Wiki tells me that σοφός is an adjective meaning “wise”, but if so, how can the whole word become a noun?

Just as in English, an article can turn an adjective into a noun: the good, the unwashed

I know that, but I wonder that if the logic is “love”+“wisdom”+“er” or “love”+“wise man”.

The meaning of parts of words can be found by checking similar words in dictionaries:

Check some words with φιλο- + -ος in LSJ:
φιλο- = being fond of/loving … not “love”
for instance φιλο-θορυβος = being fond of noise/uproar