Solar panels are waterproof (how else would they survive rain) as are insulated electric wires. The only challenge is connectors, and there are ways to make connectors submersible-safe.
This is how floating solar is a thing.