| Income Taxes  - Schedule of Components of Income Tax Expense (Benefit) (Details) - USD ($) $ in Thousands | 12 Months Ended | ||
|---|---|---|---|
| Jun. 30, 2017 | Jun. 30, 2016 | Jun. 30, 2015 | |
| Current: | |||
| Federal | $ 200,831 | $ 94,088 | $ 63,123 | 
| State | 4,660 | 6,123 | 3,655 | 
| Foreign | 38,208 | 37,680 | 25,438 | 
| Current income tax expense (benefit) | 243,699 | 137,891 | 92,216 | 
| Deferred: | |||
| Federal | 444 | 15,645 | (22,390) | 
| State | 2,852 | 3,583 | 409 | 
| Foreign | 175 | (3,349) | (2,262) | 
| Deferred income tax expense (benefit) | 3,471 | 15,879 | (24,243) | 
| Provision for income taxes | $ 247,170 | $ 153,770 | $ 67,973 | 
| X | ||||||||||
| 
- Definition Amount of current federal tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of current foreign income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of current income tax expense (benefit) pertaining to taxable income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of current state and local tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred federal income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred foreign income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of deferred state and local tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| 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 
 |