| Other income, net (Details) - USD ($) $ in Thousands | 3 Months Ended | |
|---|---|---|
| Mar. 31, 2019 | Mar. 31, 2018 | |
| Other income, net | ||
| Realized foreign exchange gains | $ 295 | |
| Unrealized foreign exchange gains | 5,095 | $ 7,862 | 
| Losses on redemption or maturity of available-for-sale debt securities | 0 | (1,163) | 
| Other | 40 | 431 | 
| Other income, net | $ 5,430 | $ 7,130 | 
| X | ||||||||||
| 
- Definition Amount of other income (expense) related to nonoperating activities, classified as other. No definition available. 
 | 
| 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). Reference 1: http://www.xbrl.org/2003/role/disclosureRef 
 | 
| X | ||||||||||
| 
- Definition Amount before tax of foreign currency transaction realized and unrealized gain (loss) recognized in the income statement. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount before tax of foreign currency transaction unrealized gain (loss) recognized in the income statement. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- Definition Amount of income (expense) related to nonoperating activities, classified as other. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 |