In order to fix the issue we need to know what it is. If you have a leak from somewhere then you would have to figure out where the leak is coming from.
You did mention your trunk area was full of water so I would start there first by checking your trunk/hatch seal and then move on to the drain hose coming from the sunroof. If it's clogged or disconnected you will have a leakage problem. Have you noticed any leaks before or is this the first occurence?