| EQUITY, LONG-TERM INCENTIVE COMPENSATION PLANS AND NON-CONTROLLING INTEREST - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 3 Months Ended | 6 Months Ended | |||
|---|---|---|---|---|---|
| Dec. 31, 2020 | Dec. 31, 2019 | Dec. 31, 2020 | Dec. 31, 2019 | Jun. 30, 2020 | |
| Stock-based compensation expense | |||||
| Stock-based compensation expense | $ 26,827 | $ 26,789 | $ 53,819 | $ 53,733 | |
| Stock-based compensation capitalized as inventory | 5,855 | 5,855 | $ 6,752 | ||
| Costs of revenues | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | 4,104 | 3,362 | 7,771 | 6,226 | |
| Research and development | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | 5,225 | 5,073 | 10,696 | 10,360 | |
| Selling, general and administrative | |||||
| Stock-based compensation expense | |||||
| Stock-based compensation expense | $ 17,498 | $ 18,354 | $ 35,352 | $ 37,147 | |
| X | ||||||||||
| 
- Definition Stock Based Compensation Capitalized as Inventory No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of expense for award under share-based payment arrangement. Excludes amount capitalized. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Line items represent financial concepts included in a table. These concepts are used to disclose reportable information associated with domain members defined in one or many axes to the table. No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |