Since you seem to be offline, ill leave a response here which we can discuss later on.
Well if hydration has been ruled out as a cause then we can consider electrolyte imbalance as cause for your symptoms. It is possible that you have an electrolyte imbalance which worsens throughout the day and causes the cramps early in the morning in combination with the slight decrease in water level which is common in the mornings. A complete electrolyte profile would be helpful here including potassium, calcium, magnesium. If this is the case then electrolyte replacement would be beneficial here.
Now if this is ruled out as a cause then we can consider neurological problems as a cause for the symptoms. It is possible that after you lie down at night that causes a change in the position of the spine which in turn leads to compression of the nerves in the back. This could cause leg cramps in the morning when you wake up. In some casses it can be accompanied by numbness, tingling or shooting pains in the legs as well but this is not always the case. A MRI of the lower back would be helpful here as well as a nerve conduction study.
Another cause for these symptoms could be associated with the arteries of the legs. It is possible that you may have compromised blood flow in the lower limbs which can cause cramps and pain in the region. A doppler ultrasound of the lower limbs would be helpful in diagnosing the problem (peripheral arterial disease).
Another cause can be peripheral neuropathy in which the nerves of the lower limbs are damaged which again would be picked up with the help of a simple nerve conduction study. Neuropathy has been known to be associated with thyroid diseases as well. And talking about thyroid issues, those too can cause leg cramps of this sort. A repeat thyroid profile would be helpful in determining if this can be the cause.
Lastly drugs can cause this problem as well, in your case atorvastatin is known to cause this sort of problem quite commonly and it would be wise to get tests like CPK, LDH done which would show if the drug is affecting your muscles. infact atorvastatin causes the cramps early in the morning inmost cases, one option would be to change it to a drug which is safer in comparison like rosuvastatin.
I would suggest that you discuss these possibilities with your doctor and im sure one of these would be the cause for your cramps. Also this discussion is open for any clarifications or additional information you might like to add.
Do you have any more questions?
Please leave a POSITIVE rating by clicking on the stars above, until you do i am not compensated for my time. You can continue to ask follow-up questions even after the POSITIVE rating. You can also ask questions from me directly by going on the link below,