Origin of 'Lunacy': Exploring the Moon's Influence on Mental Health
The word you're looking for is lunacy.
It comes from the Latin word "luna," meaning "moon," and was historically used to describe mental instability that was thought to be influenced by the phases of the moon.