You PC could have been infected with malware via downloading and insta some random apps. Which operating system have you been using?
Did you download the electrum app from the official source and even verify the signature?
Its a Win10 machine, the wallet (as portable version) was downloaded from the orignal website and I used it for years without any problems. My wallet was also passwort protected which is why I am asking myself if malware just waits till the wallet has been opened.
Dont get me wrong, there is nothing I can do now but I dont want to make the same mistake twice. So I want to know how that was possible and if this could be a real scenario. i had the wallet since 2017.
If you your device is fully secured, and you are very sure that no malware attack will affect your device as you said, then you have revealed your private key with someone or someone have access to your private key without you knowing about it, and the person has done it by sending out all your Bitcoin to his wallet.
It is still possible to have malware attack even in the latest windows because must of these antivirus are not fully secured and some of these windows defenders do get outdated before our notice which can also attract malware.
Next time, make sure you save your seed phrase to in a secured and reliable place because it is very possible that the Bitcoin was stolen by someone who have access to your private key.