| Other income, net (Details) - USD ($) $ in Thousands | 3 Months Ended | |
|---|---|---|
| Mar. 31, 2018 | Mar. 31, 2017 | |
| Other income, net | ||
| Unrealized foreign exchange gains | $ 7,862 | $ 52 | 
| Losses on redemption or maturity of available-for-sale debt securities | (1,163) | |
| Other | 431 | 378 | 
| Other income, net | $ 7,130 | $ 430 | 
| X | ||||||||||
| 
- Definition Amount of realized loss on investment in debt security measured at fair value with change in fair value recognized in other comprehensive income (available-for-sale). No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount of other income (expense) related to nonoperating activities, classified as other. No definition available. 
 | 
| X | ||||||||||
| 
- Definition Amount before tax of foreign currency transaction unrealized gain (loss) recognized in the income statement. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- Definition Amount of income (expense) related to nonoperating activities, classified as other. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 |