/* main data table */
.dataTable {
  border: 0;
  width: 100%;
  padding: 0;
  border-spacing: 0;
  margin: 0;

  td .ratio {
    color: #999999;
    display: inline-block;
    visibility: hidden;
    text-align: right;
    margin-right: 4px;
    font-weight: normal;
  }

  td.highlight > .ratio {
    visibility: visible;
  }
}

table.dataTable td.label,
table.subDataTable td.label {
  width: 100%;
  white-space: nowrap;
}

table.dataTable img,
table.subDataTable img {
  vertical-align: middle;
}

table.dataTable img {
  border: 0;
  margin-right: 1em;
  margin-left: 0.5em;
}

table.subDataTable img.link {
  transform: translateY(-50%);
}

table.dataTable tr.subDataTable {
  cursor: pointer;

  td.label span.label {
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    width: inherit;
    display: inline-block;
    vertical-align: text-bottom;
  }
}

table.dataTable th {
  margin: 0;
  text-align: left;
  padding: 6px 6px 6px 12px;
  font-size: 12px;
  font-weight: normal;
  vertical-align: top;
}

// for dataTables in exported widgets ( we do not want to apply this for widgets in dashboard )
body>.widget table.dataTable {
  th {
    background: @theme-color-background-tinyContrast;
  }
}

// for dataTables in report pages (not for widgets in the dashboard)
.theWidgetContent .card .card-content table.dataTable {
  margin-left: -20px;
  width: ~"calc(100% + 40px)";

  th {
    background: @theme-color-background-tinyContrast;

    &:first-child {
      padding-left: 20px;
    }
    &:last-child {
      padding-right: 20px;
    }
  }

  td {
    &:first-child {
      padding-left: 20px;
    }

    &:last-child {
      padding-right: 20px;
    }
  }
}

table.dataTable th.sortable {
  cursor: pointer;
}

table.dataTable th.columnSorted {
  font-weight: bold;
}

table.dataTable td {
  padding: 5px 1px 5px 12px;
  background: @theme-color-background-base;
}

table.dataTable td,
table.dataTable td a {
  margin: 0;
  text-decoration: none;
  color: @theme-color-text-light;
}

td.clean {
  background-color: @theme-color-background-base;
}

table.dataTable td.column {
  white-space: nowrap;
}

.dataTable tr.highlight td {
  font-weight: bold;
}

table.dataTable td.label,
table.subActionsDataTable td.label,
table.actionsDataTable td.label {
  border-top: 0;
  border-left: 0;
}

table.dataTable th.label {
  border-left: 0;
}

.dataTableActions table.dataTable th.label {
  /* Ensures tables have enough space to display subtable on click, and prevent the jumping effect */
  min-width: 250px;
}

table.dataTable span.label.highlighted {
  font-style: italic;
}

/* the cell containing the subdatatable */
table.dataTable .cellSubDataTable {
  margin: 0;
  border-left: 0;
  padding: 6px 12px 6px;
}

.cellSubDataTable > .dataTable {
    padding: 6px 0 0;
}

/* A link in a column in the DataTable */
table.dataTable td #urlLink {
  display: none;
}

table.dataTable img {
  margin-left: 0;
}

.subDataTable > .dataTableWrapper {
  width: 95%;
}

.sortIconContainer {
  float: left;
  position: relative;
}

.sortIcon {
  margin: 0;
  position: absolute;
}

.datatableHeaderMessage, .datatableFooterMessage {
  color: #888;
  text-align: left;
  margin: 10px;
  margin-left: 1px;
}

.dataTablePages {
  color: #BFBFBF;
  font-weight: bold;
  margin: 10px;
  font-size: 12px;
}

.dataTableSearchInput {
  display: inline-block;
  opacity: 0;
  color: #adadad !important;
  min-height: 30px !important;
  padding-left: 25px !important;
  width: 100% !important;
  transition: opacity 0.3s ease !important;
  box-shadow: 0 0 !important;
  visibility: hidden;
}

.searchAction:hover {
  .dataTableSearchInput {
    &:hover,
    &:focus {
      color: #333 !important;
    }
  }
}

.searchAction {
  transition: width 0.3s ease !important;
  text-align: left !important;
  padding-left: 10px;
  position: relative;
  cursor: pointer;

  .icon-search {
    display: inline-block;
    cursor: pointer;
    z-index: 1;
    position: absolute;
    top: 8px;
    left: 8px;
  }

  .icon-close {
    display: none;
  }
}

.searchAction.searchActive {
  cursor: text;

  .dataTableSearchInput {
    visibility: visible;
  }

  .icon-close {
    display: inline-block;
    font-size: 10px;
    cursor: pointer;
    position: absolute;
    top: 12px;
    right: 10px;
    color: #adadad !important;
    &:hover,
    &:focus {
      color: #333 !important;
    }
  }
  .icon-search {
    cursor: pointer;
    color: #adadad !important;
    &:hover,
    &:focus {
      color: #333 !important;
    }
  }

  .dataTableSearchInput {
    opacity: 1;
  }
}

.dataTableNext,
.dataTablePrevious {
  font-size: 12px;
  color: #184A83;
  cursor: pointer;
  &:hover {
    text-decoration: underline;
  }
  @media print{
    display: none;
  }
}

.datatableRelatedReports {
  color: #888;
  font-size: 12px;
  padding-bottom: 5px;
  margin-top: 6px;
  @media print{
    display: none;
  }
}

.datatableRelatedReports span {
  cursor: pointer;
  font-weight: bold;
  &:hover {
    text-decoration: underline;
  }
}

.dataTableFeatures {
  text-align: center;
}

.dataTableNext,
.dataTablePrevious {
  visibility: hidden;
}

.dataTablePaginationControl {
  margin: 5px 0 !important;
}

.dataTableFeatures .loadingPiwik {
  font-size: 13px;
  display: inline-block;
  padding-bottom: 13px;
}

.dataTable .loadingPiwikBelow {
  padding-bottom: 5px;
  display: block;
  text-align: center;
}

.dataTableFeatures {
  &.hasEvolution {
    .dataTableFooterIcons {
      margin-top: 17px;
    }
  }
}

.widget .dataTableFeatures {
  border-bottom-style: none !important;
}


// customizing footer appearance for row evolution graph
.ui-dialog .dataTableVizEvolution {

  .dataTableFooterIcons {
    display: block;
  }

  .dataTableFeatures {
    border-bottom-style: none !important;
    margin-top: 0 !important;
  }
}

.dataTableFooterWrap {
  position: relative;
  float: left;
  margin-left: 10px;
}

.dataTableFooterWrap select {
  float: left;
  margin: 1px 0 1px 10px;
}

.tableIconsGroup > span > span {
    position:relative;
    float:left;
}

.dataTableFooterActiveItem {
  position: absolute;
  top: -6px;
  left: 0;
}


.exportToFormatItems img {
  vertical-align: middle;
  margin: -4px -3px -2px 2px;
}

.tableIconsGroup {
  float: left;
  padding-right: 4px;
}

.tableIconsGroup .tableIcon span {
  margin-right: 5px;
  margin-left: 5px;
}

.tableIconsGroup img {
  vertical-align: bottom;
}

.tableIconsGroupActive {
  display: block;
  float: left;
  background: #dcdacf;
  border-radius: 2px;
}

.tableIconsGroupActive .tableIcon {
  background: none;
}

.tableIconsGroupActive .tableIcon:hover {
  background: #e9e8e1;
}

.dataTableSpacer {
  clear: both;
}

/* Actions table */
.dataTableActions table.dataTable tr td.label {
  background-image: none;
}

/* levels higher than 4 have a default padding left */
.actionsDataTable tr td.label {
  padding-left: 7em;
}

tr.level0 td.label {
  padding-left: 20px !important;
}

.widget {
  tr.level0 td.label {
    padding-left: 12px !important;
  }
}

tr.level1 td.label {
  padding-left: 2.5em !important;
}

tr.level2 td.label {
  padding-left: 3.5em !important;
}

tr.level3 td.label {
  padding-left: 4.5em !important;
}

tr.level4 td.label {
  padding-left: 5em !important;
}
tr.level5 td.label {
  padding-left: 5.5em !important;
}
tr.level6 td.label {
  padding-left: 6em !important;
}
tr.level7 td.label {
  padding-left: 6.5em !important;
}
tr.level8 td.label {
  padding-left: 7em !important;
}
tr.level9 td.label {
  padding-left: 7.5em !important;
}
tr.level10 td.label {
  padding-left: 8em !important;
}
tr.level11 td.label {
  padding-left: 8.5em !important;
}
tr.level12 td.label {
  padding-left: 9em !important;
}

/* less right margins for the link image in the Pa*/
.dataTableActions table.dataTable img.link {
  margin-right: 0.5em;
  margin-left: 0;
  margin-bottom: 4px;
  vertical-align: text-bottom;
}

table.dataTable td.label img {
  margin-top: -3px;
  max-height: 16px;
}

tr td.label img.plusMinus {
  margin-left: -3px;
  margin-right: 3px;
  margin-top: -3px;
}

.pk-emptyDataTable {
  padding-top: 20px;
  padding-bottom: 10px;
  padding-left: 1px;
}

.widget .pk-emptyDataTable {
  padding-left: 0;
  padding-top: 33px;
  text-align: center;
}

.helpDate {
  color: #777777;
  font-size: 11px;
  font-style: italic;
  padding: 4px;
  text-align: right;
  display: block;
}

body .ui-tooltip.rowActionTooltip {
  font-size: 11px;
  padding: 3px 5px 3px 6px;
}

table.dataTable span.cell-tooltip {
  cursor: default;
}

.dataTable .jqplot-graph {
  > div {
    position: relative;
  }
}

td.cellSubDataTable .loadingPiwik {
    padding:0;
}

.dataTable .searchReset {
  position:relative;

  img {
    position: absolute;
    top: 4px;
    left: -15px;
    cursor: pointer;
    display: inline;
  }
}

.dataTableControls {
  text-align: left;
  padding-left: 0 !important;

  &.col {
    padding-right: 0;
  }

  .dropdown-content {
    a {
      &:hover {
        text-decoration: none;
      }
    }
  }

  .dataTableAction {
    border: 0;
    border: none;
    border-radius: 2px;
    display: inline-block;
    height: 36px;
    line-height: 36px;
    outline: 0;
    width: 36px;
    text-transform: uppercase;
    vertical-align: middle;
    text-decoration: none !important;
    text-align: center;
    color: #adadad;
    font-size: 16px;
    &:hover {
      color: #333;
      background-color: @theme-color-background-base;
      text-decoration: none !important;
    }

    .icon-export {
      margin-top: 6px;
      display: block;
    }

    .icon-more-verti {
      font-size: 18px;
    }
  }
}

@media only screen and (min-width: 993px) {
  #dashboardWidgetsArea .widget,
  .theWidgetContent > div:not(#dashboard) {
    &:hover {
      .limitSelection,
      .dataTableControls .dataTableAction {
        visibility: visible;
      }
    }
    .limitSelection,
    .dataTableControls .dataTableAction {
      visibility: hidden;

      &.forceActionVisible {
        visibility: visible;
      }
    }
  }
}
