Hello,
Welcome to the ehealthforum and I am really glad to help you out. What you seem to be having is onycholyis. Onycholysis is characterized by a spontaneous separation of the nail plate. It can be due to dermatological causes, systemic causes, neoplastic diseases and biologic causes.
Try avoiding trauma to the nail, contact with contact irritants and moisture and keep your nail shirt. Topical antifungals and steroids may be needed. Severe cases may need oral antifungals and steroid injections.
My sincere advice is to consult a dermatologist and get it evaluated. I sincerely hope that helps. Take care.