| Income Taxes  - Details of Income Taxes (Details) - USD ($) $ in Thousands | 3 Months Ended | 6 Months Ended | ||
|---|---|---|---|---|
| Dec. 31, 2015 | Dec. 31, 2014 | Dec. 31, 2015 | Dec. 31, 2014 | |
| Income Tax Disclosure [Abstract] | ||||
| Income (loss) before income taxes | $ 185,475 | $ (6,268) | $ 319,774 | $ 92,739 | 
| Provision for (benefit from) income taxes | $ 33,268 | $ (26,536) | $ 62,670 | $ 238 | 
| Effective tax rate | 17.90% | 423.40% | 19.60% | 0.30% | 
| X | ||||||||||
| 
- Definition Percentage of current income tax expense (benefit) and deferred income tax expense (benefit) pertaining to continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Sum of operating profit and nonoperating income or expense before Income or Loss from equity method investments, income taxes, extraordinary items, and noncontrolling interest. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of current income tax expense (benefit) and deferred income tax expense (benefit) pertaining to continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 |