Long-Term Debt (Tables)
6 Months Ended
Jun. 30, 2018
Debt Disclosure [Abstract]  
Schedule of convertible senior notes
As of June 30, 2018 and December 31, 2017, the carrying amounts of the Notes on the consolidated balance sheets were calculated as follows (in thousands):
 
June 30, 2018
 
December 31, 2017
Convertible senior notes, principal amount
$
230,000

 
$
230,000

Unamortized debt discount
(12,712
)
 
(15,930
)
Unamortized debt issuance costs
(2,514
)
 
(3,151
)
Convertible senior notes, net
$
214,774

 
$
210,919

Schedule of interest expense related to convertible senior notes
For the three and six months ended June 30, 2018 and 2017, interest expense related to the Notes consisted of the following (in thousands):
 
Three months ended June 30,
 
Six months ended June 30,
 
2018
 
2017
 
2018
 
2017
Contractual coupon interest
$
1,438

 
$
1,438

 
$
2,875

 
$
2,875

Debt discount amortization
1,622

 
1,523

 
3,219

 
3,022

Debt issuance cost amortization
321

 
301

 
637

 
598

Interest expense, Notes
$
3,380

 
$
3,261

 
$
6,730

 
$
6,494

Note: Amounts may not foot due to rounding.
Schedule of maturities of convertible senior notes
The undiscounted interest and principal payments due in relation to the Notes from June 30, 2018 to the maturity of the Notes on May 1, 2020 are as follows (in thousands):
 
Total
2018
2019
2020
Senior convertible notes, including interest
$
241,500

2,875

5,750

$
232,875