Condensed Consolidated Statements of Stockholders' Equity - USD ($) $ in Thousands | Total | Underwriters | Common Stock | Common StockUnderwriters | Additional Paid-In Capital | Additional Paid-In CapitalUnderwriters | Accumulated Other Comprehensive Income (Loss) | Accumulated Deficit |
Beginning Balance at Dec. 31, 2018 | $ 606,258 | | $ 5 | | $ 2,106,960 | | $ (155) | $ (1,500,552) |
Beginning Balance (in shares) at Dec. 31, 2018 | | | 49,422,991 | | | | | |
Issuance of common stock upon exercise of options | 3,364 | | | | 3,364 | | | |
Issuance of common stock upon exercise of options (in shares) | | | 125,655 | | | | | |
Share-based compensation expense | 13,024 | | | | 13,024 | | | |
Unrealized gain (loss) on available-for-sale investments | 676 | | | | | | 676 | |
Translation gain (loss) | (19) | | | | | | (19) | |
Net income (loss) | 620,134 | | | | | | | 620,134 |
Ending Balance at Mar. 31, 2019 | 1,243,437 | | $ 5 | | 2,123,348 | | 502 | (880,418) |
Ending Balance (in shares) at Mar. 31, 2019 | | | 49,548,646 | | | | | |
Beginning Balance at Dec. 31, 2018 | 606,258 | | $ 5 | | 2,106,960 | | (155) | (1,500,552) |
Beginning Balance (in shares) at Dec. 31, 2018 | | | 49,422,991 | | | | | |
Translation gain (loss) | (12) | | | | | | | |
Net income (loss) | 558,731 | | | | | | | |
Ending Balance at Jun. 30, 2019 | 1,200,989 | | $ 5 | | 2,141,498 | | 1,307 | (941,821) |
Ending Balance (in shares) at Jun. 30, 2019 | | | 49,802,573 | | | | | |
Beginning Balance at Mar. 31, 2019 | 1,243,437 | | $ 5 | | 2,123,348 | | 502 | (880,418) |
Beginning Balance (in shares) at Mar. 31, 2019 | | | 49,548,646 | | | | | |
Issuance of common stock upon exercise of options | 4,722 | | | | 4,722 | | | |
Issuance of common stock upon exercise of options (in shares) | | | 229,565 | | | | | |
Issuance of common stock upon vesting of restricted stock unit awards (in shares) | | | 24,362 | | | | | |
Share-based compensation expense | 13,428 | | | | 13,428 | | | |
Unrealized gain (loss) on available-for-sale investments | 798 | | | | | | 798 | |
Translation gain (loss) | 7 | | | | | | 7 | |
Net income (loss) | (61,403) | | | | | | | (61,403) |
Ending Balance at Jun. 30, 2019 | 1,200,989 | | $ 5 | | 2,141,498 | | 1,307 | (941,821) |
Ending Balance (in shares) at Jun. 30, 2019 | | | 49,802,573 | | | | | |
Beginning Balance at Dec. 31, 2019 | 1,071,465 | | $ 5 | | 2,173,154 | | 1,303 | (1,102,997) |
Beginning Balance (in shares) at Dec. 31, 2019 | | | 50,170,953 | | | | | |
Issuance of common stock upon exercise of options | 3,191 | | | | 3,191 | | | |
Issuance of common stock upon exercise of options (in shares) | | | 125,761 | | | | | |
Share-based compensation expense | 15,214 | | | | 15,214 | | | |
Unrealized gain (loss) on available-for-sale investments | (1,164) | | | | | | (1,164) | |
Translation gain (loss) | (14) | | | | | | (14) | |
Net income (loss) | (100,207) | | | | | | | (100,207) |
Ending Balance at Mar. 31, 2020 | 988,485 | | $ 5 | | 2,191,559 | | 125 | (1,203,204) |
Ending Balance (in shares) at Mar. 31, 2020 | | | 50,296,714 | | | | | |
Beginning Balance at Dec. 31, 2019 | 1,071,465 | | $ 5 | | 2,173,154 | | 1,303 | (1,102,997) |
Beginning Balance (in shares) at Dec. 31, 2019 | | | 50,170,953 | | | | | |
Translation gain (loss) | 17 | | | | | | | |
Net income (loss) | (185,135) | | | | | | | |
Ending Balance at Jun. 30, 2020 | 1,242,637 | | $ 6 | | 2,528,112 | | 2,651 | (1,288,132) |
Ending Balance (in shares) at Jun. 30, 2020 | | | 57,574,878 | | | | | |
Beginning Balance at Mar. 31, 2020 | 988,485 | | $ 5 | | 2,191,559 | | 125 | (1,203,204) |
Beginning Balance (in shares) at Mar. 31, 2020 | | | 50,296,714 | | | | | |
Issuance of common stock | | $ 301,754 | | $ 1 | | $ 301,753 | | |
Issuance of common stock (in shares) | | | | 6,325,000 | | | | |
Issuance of common stock upon exercise of options | 21,089 | | | | 21,089 | | | |
Issuance of common stock upon exercise of options (in shares) | | | 903,641 | | | | | |
Issuance of common stock under employee stock purchase plan and upon vesting of restricted stock unit awards | 1,475 | | | | 1,475 | | | |
Issuance of common stock under employee stock purchase plan and upon vesting of restricted stock unit awards (in shares) | | | 49,523 | | | | | |
Share-based compensation expense | 12,236 | | | | 12,236 | | | |
Unrealized gain (loss) on available-for-sale investments | 2,495 | | | | | | 2,495 | |
Translation gain (loss) | 31 | | | | | | 31 | |
Net income (loss) | (84,928) | | | | | | | (84,928) |
Ending Balance at Jun. 30, 2020 | $ 1,242,637 | | $ 6 | | $ 2,528,112 | | $ 2,651 | $ (1,288,132) |
Ending Balance (in shares) at Jun. 30, 2020 | | | 57,574,878 | | | | | |