You're at a critical point in detox at 5-6 days. You're just starting to get the VERY worst of the w/d symptoms behind you. Honestly the anxiety and depression can last a while. Think about it, you've just lost your best friend in your mind at least. You're body is freaking out over you cutting it off from the pills.
What is happening to you is why we recommend getting involved in recovery be it NA, AA, church, a combination of or all the above. It's very hard to be successful long term on our own. I know that I couldn't have done it without NA the first few years up until I found Jesus Christ. Now I don't even think about using anymore. But it's been years since I took pain pills for fun. You really should check out some recovery meetings. Don't have to worry about being embarassed or anything like that. Everyone there had their first meeting to attend at some point. Good luck and God bless.
I am not a dr. My statements are based on years of experience and related education. Consult with the professional of your choice regarding matters of concern.