I had the same thing happen to me after knee surgery. I am still convinced it was the anesthesia that affected so badly. I had to cut back on my caffeine and my ADD meds. Eventually, after several months, everything went back to normal and i am fine now. I told all my medical professionals and only my orthopedic surgeon seemed unsurprised. He told me to hydrate very well and keep in touch about it. Hope yours gets better soon.