Can atrophy be why my legs hurt so much?

Yes. The general use or lose it phenomenon is quite true at any age. Regardless of injury or surgery, weakness is a process of nerve injury. Nervous tissue takes a very long time to heal, however if the nerve does not get any signals to move a muscle from you then that muscle will atrophy. That is difficult to overcome but not impossible. Keep activating those muscles to preserve your strength!