@external rstudio-themes-dark;
@external rstudio-themes-default, rstudio-themes-dark-grey, rstudio-themes-alternate;
@external histBar;

/* This is exposed to allow users to customize RStudio further with their rsthemes. */
@external dataGridHeader;

@eval THEME_DEFAULT_BACKGROUND org.rstudio.core.client.theme.ThemeColors.defaultBackground;
@eval THEME_DARKGREY_BACKGROUND org.rstudio.core.client.theme.ThemeColors.darkGreyBackground;
@eval THEME_ALTERNATE_BACKGROUND org.rstudio.core.client.theme.ThemeColors.alternateBackground;
@eval THEME_DEFAULT_BORDER org.rstudio.core.client.theme.ThemeColors.defaultBorder;
@eval THEME_DARKGREY_BORDER org.rstudio.core.client.theme.ThemeColors.darkGreyBorder;
@eval THEME_ALTERNATE_BORDER org.rstudio.core.client.theme.ThemeColors.alternateBorder;

@def selectionBorderWidth 1px;

.dataGridHeader:active, .dataGridHeader:focus {
   outline: 0;
}

.dataGridWidget {
   font-size: 9pt;
   outline: none;
}

.dataGridWidget > div {
   /* Override GWT styling set on element */
   min-height: 16px !important;
}

.dataGridFirstColumn {
}

.dataGridLastColumn {

}

.dataGridFooter {
  border-top: 1px solid #BBB;
  padding: 3px 4px;
  text-align: left;
  overflow: hidden;
  cursor: default;
}

.dataGridHeader {
  border-bottom: 1px solid #d6dadc;
  border-right: 1px solid #d6dadc;
  padding: 1px 2px;
  text-align: left;
  font-weight: normal;
  font-size: 11px;
  color: #3c474d;
  background-color: #eeeff1;
  overflow: hidden;
  cursor: default;
  height: 16px;
}

.rstudio-themes-dark .dataGridHeader {
  border-top: 0px;
  border-left: 0px;
  color: white;
}

.dataGridCell {
  /* CHANGE: use less padding (originally was 15px) */
  padding: 2px 4px;
  overflow: hidden;

  /* CHANGE: use default cursor rather than pointer/caret */
  cursor: default;

}

.dataGridCell:first-child {
   padding: 0 4px;
}
.dataGridCell:first-child+.dataGridCell {
   padding: 0 4px;
}

.dataGridFirstColumnFooter {

}

.dataGridFirstColumnHeader {

}

.dataGridLastColumnFooter {

}

.dataGridLastColumnHeader {
  border-right: none;
}

.dataGridSortableHeader {
  cursor: default;
}

.dataGridSortableHeader:hover {
  color: #6c6b6b;
}

.dataGridSortedHeaderAscending {

}

.dataGridSortedHeaderAscending img {
  width: 0px !important;
  height: 0px !important;
  background: none !important;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 7px solid #818a98;
  margin-left: 3px;
}

.dataGridSortedHeaderDescending {

}

.dataGridSortedHeaderDescending img {
  width: 0px !important;
  height: 0px !important;
  background: none !important;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid #818a98;
  margin-left: 3px;
}

.dataGridEvenRow {
  /*background: #ffffff;*/
}

.dataGridEvenRowCell {
  border: selectionBorderWidth solid #ffffff;
}

.dataGridOddRow {
  /*background-color: #eef4fb;*/
}

.dataGridOddRowCell {
  /*border: selectionBorderWidth solid #eef4fb;*/
  border: selectionBorderWidth solid #ffffff;
}

.dataGridHoveredRow {
  /* CHANGE: Disable hover effects */
  /* background: #eee; */
}

.dataGridHoveredRowCell {
  /* CHANGE: Disable hover effects */
  /* border: selectionBorderWidth solid #eee; */
}


.dataGridKeyboardSelectedRow {
}

.dataGridKeyboardSelectedRowCell {
}
.dataGridKeyboardSelectedRowCell:first-child {
}
.dataGridKeyboardSelectedRowCell:first-child + td + td {
}

.dataGridSelectedRow {
  /* CHANGE: use same selected background color as History table */
  background: #CCC;
  /* color: white; */
  height: auto;
  overflow: auto;
}

.dataGridSelectedRowCell {
  /* CHANGE: use same selected background color as History table */
  border: selectionBorderWidth solid #CCC;
}

.dataGridWidget:focus .dataGridSelectedRow {
  background: rgb(146, 193, 240);
}
.dataGridWidget:focus .dataGridSelectedRowCell {
  border-color: rgb(146, 193, 240);
}

/**
 * The keyboard selected cell is visible over selection.
 */
.dataGridKeyboardSelectedCell {
  border: selectionBorderWidth solid transparent;
}

.rstudio-themes-default .dataGridHeader {
   background: THEME_DEFAULT_BACKGROUND;
   border-color: THEME_DEFAULT_BORDER;
}

.rstudio-themes-dark-grey .dataGridHeader {
   background: THEME_DARKGREY_BACKGROUND;
   border-color: THEME_DARKGREY_BORDER;
}

.rstudio-themes-alternate .dataGridHeader {
   background: THEME_ALTERNATE_BACKGROUND;
   border-color: THEME_ALTERNATE_BORDER;
}

/**
 * Styles for brushing histograms
 */
.histBar {
   background-color: THEME_ALTERNATE_BACKGROUND;
}

