OP I really feel for you. We had massive problems with ds1 as a teenager. He wouldn't sleep, wouldn't go to college, ended up without A levels, was hell to live with - argued, ,shouted, on the computer til all hours (we also switched off the wifi). He was aggressive although never physically hurt us but did break stuff, damage his room, throw things at walls etc
I also felt that I couldn't go on with it at times. Dh has the patience of a saint but even he was at stretched to his limit. However, we hung in there and ds gradually came round. What really made a difference for him was leaving sixth form and getting a job - he grew up very fast then.
He is now working hard in a responsible job and is delightful to be with. He recently moved out to live independently and we really miss him. If you'd told me 3 years ago that it would be like this and come good I wouldn't have believed you as it was so horrible at the time, and had been for the previous 3 years.
What I did find was that trying to reason or negotiate with ds was futile and just stressed me out. He didn't respond to reasoning and although he appeared to be able to negotiate, he never kept his side of he agreement. Looking back, I should habe picked my battles but the arguments used to ratchet up really quickly and even simple stuff would escalate into full blown rows.
So, I have no advice apart from "hang on in there". We were lucky I suppose in that ds never went out (didn't feel lucky at the time!) So we didn't have to worry about where he was or if he was getting into trouble. If you think your dd is speaking to strangers on the Internet who might be grooming her, I would speak to school or NSPCC for advice.
Good luck OP. I really hope she grows out of it shortly.