INCOME TAXES - Schedule of Reconciliation of Unrecognized Tax Benefits (Details) - USD ($) $ in Thousands |
12 Months Ended | ||
|---|---|---|---|
Aug. 31, 2026 |
Aug. 31, 2025 |
Aug. 31, 2024 |
|
| Reconciliation of Unrecognized Tax Benefits, Excluding Amounts Pertaining to Examined Tax Returns [Roll Forward] | |||
| Beginning balance | $ 39,434 | $ 35,290 | $ 21,053 |
| Additions based on tax positions related to the current year | 3,318 | 5,344 | 6,068 |
| Additions for tax positions related to prior years | 176 | 2,368 | 11,726 |
| Release for tax positions of prior years | (21,675) | (3,568) | (3,557) |
| Ending balance | $ 21,253 | $ 39,434 | $ 35,290 |
| X | ||||||||||
- Definition A roll forward is a reconciliation of a concept from the beginning of a period to the end of a period. No definition available.
|
| X | ||||||||||
- Definition Amount of unrecognized tax benefits. Reference 1: http://www.xbrl.org/2003/role/exampleRef
|
| X | ||||||||||
- Definition Amount of decrease in unrecognized tax benefits resulting from tax positions taken in prior period tax returns. Reference 1: http://www.xbrl.org/2003/role/exampleRef
|
| X | ||||||||||
- Definition Amount of increase in unrecognized tax benefits resulting from tax positions that have been or will be taken in current period tax return. Reference 1: http://www.xbrl.org/2003/role/exampleRef
|
| X | ||||||||||
- Definition Amount of increase in unrecognized tax benefits resulting from tax positions taken in prior period tax returns. Reference 1: http://www.xbrl.org/2003/role/exampleRef
|