iphone storage full but I have icloud unused storage
Hello - Clearly I don't understand this iCloud storage thing so please clue me in. I have 50GB of iCloud storage of which my iPhone says 21.8GB are available. My iPhone itself has 11.7GB used and 0 available. I'm unable to update anything or take video etc because it says I need to enable more storage in Settings. But in Settings I'm showing all of that available. So what am I missing? I think I've selected the wrong toggle option somewhere as I can access all of my photos from the cloud on my phone (which is fine, like that). What are the proper settings so that my huge photo library is stored in the cloud and accessible via my phone but my phone still has room to take photos/videos etc. If I try to make space by deleting and I go to photos on my iphone and select some the message is "these photos will be deleted from iCloud Photo Library on all your devices". I don't want to lose them from all devices, or God forbid, everywhere, I'm just trying to make space on my phone. In Settings ->Photos, I have iCloud Photo Library turned on and Optimize Phone Storage checked, all other options turned off.
Please help, I'm clearly missing a major piece of understanding here! Thanks.