In the long run, the price becomes equal to the minimum of the average total cost (across firms).
As a result, at the end, firms that remain in the market must be making zero economic profit. Firms stop entering/exiting the market only when price and the average total cost are forced to become equal. They are then operating at efficient scale.
This makes sense because the opportunity costs which are taken into account cover other things. The economic profit is zero, not the accounting profit!
In the short run, an increase in demand raises price and quantity supplied (and they make positive economic profit). The resulting influx of firms would force the cost back down, which again results in the long run average total cost being stationary.
While a competitive firm is a price taker, a monopoly firm is a price maker.
A firm is considered a monopoly if it is the sole seller of its product and its product does not have any close substitutes. Monopolies arise when there is a barrier to entry such as