I lived through the teen issues. My child also was a dream at school but sometimes took things out on me.
When calmer moments prevail, I would have a discussion with daughter. She needs to first be told that you love her dearly, that you are proud of her, that she is everything you want in a child.
Tell her that now that she is older, she is to be given more leeway in choosing things, like her clothes, shoes, etc.
But:
Then I would explain that with age comes more responsibility. She is no longer a baby, and there are more grown up things expected of her.
They just need to know the rules beforehand. First I would appogize because evidently you have not made the rules plain and you need to make them clear. Explain in a nice tone that respect is due parents, and neither disrespectful speech nor hitting will not be tolerated. Consequences will come if this happens again. When you are through with the rules, ask if she understands.
When a situation arises again, remind her of the rule and that she said she understood. You could give a choice at this point. Do you want to continue with the way you are talking and get a consequence or would you rather stop this action? The first time or two will be a test of your resolve.
If she does not cool down and stop acting or speaking disrespectfully, then administer the consequences.You might explain what will be taken away, such as phone or T.V. priveledges, or friends over. DO NOT BACK DOWN, NO MATTER WHAT HAPPENS. They have made the choice, and will have to live with it. This will asure less of these episodes in the future.
]I work in a school where we have loads of training in effective discipline. Patience and sticking to your resolve will work.