Good morning, I'm Dr. Sara. I'm a licensed veterinarian who works exclusively with dogs and cats. I'm sorry to hear that you've had a rough night with Sophia - I know it can be scary when they are sick.
Labored breathing is one of the few true emergencies with pets. If they are having true difficulty breathing, this merits a trip to the ER, especially if their gums are pale or blue/purple in color. I wish I could tell you more but it's difficult in this venue to know exactly what sort of issue could be happening without an exam, but it has the potential to be serious.
Hind legs collapsing can actually be a pretty vague sign in older pets - as it could just be a consequence of normal aging, some spinal disease, or weakness caused by any other internal disease like severe kidney or liver issues, heart disease, respiratory compromise, anemias, infections, etc. The list unfortunately is quite long. Blood work can help rule some of these out, while others will require other tests like ultrasounds or X-rays.
If she's still laboring to breathe, I would call your vet ASAP. How is she doing this morning?