Income Taxes - Income tax (benefit) provision (Details) - USD ($) $ in Thousands  | 
12 Months Ended | ||
|---|---|---|---|
Dec. 31, 2021  | 
Dec. 31, 2020  | 
Dec. 31, 2019  | 
|
| Current income tax provision (benefit): | |||
| Federal | $ (779) | $ (4,566) | $ 109 | 
| State | 1,779 | 1,522 | 474 | 
| Foreign | 844 | 298 | (1) | 
| Total current | 1,844 | (2,746) | 582 | 
| Deferred income tax (benefit) provision: | |||
| Federal | (8,025) | 3,655 | (4,794) | 
| State | 3,561 | 2,207 | 202 | 
| Foreign | 573 | (3,610) | 262 | 
| Total deferred | (3,891) | 2,252 | (4,330) | 
| Total income tax benefit | $ (2,047) | $ (494) | $ (3,748) | 
| X | ||||||||||
- References No definition available. 
  | 
| X | ||||||||||
- Definition Amount of current federal tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
  | 
| X | ||||||||||
- Definition Amount of current foreign income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
  | 
| X | ||||||||||
- Definition Amount of current income tax expense (benefit) pertaining to taxable income (loss) from continuing operations. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
  | 
| X | ||||||||||
- Definition Amount of current state and local tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
  | 
| X | ||||||||||
- Definition Amount of deferred federal income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
  | 
| X | ||||||||||
- References No definition available. 
  | 
| X | ||||||||||
- Definition Amount of deferred foreign income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
  | 
| X | ||||||||||
- Definition Amount of deferred income tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://fasb.org/us-gaap/role/ref/legacyRef 
  | 
| X | ||||||||||
- Definition Amount of deferred state and local tax expense (benefit) pertaining to income (loss) from continuing operations. Reference 1: http://www.xbrl.org/2009/role/commonPracticeRef 
  | 
| 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/disclosureRef 
  |