@import 'vars';

// z-index
$fixed-table-loading-z-index: $zindex-base + 5;

// bootstrap-table
// =============================================================

.bootstrap-table .table {
  margin-bottom: 0 !important;
  border-collapse: collapse !important;
  border-bottom: 1px solid $table-border-color;
}

.bootstrap-table .table:not(.table-condensed), .bootstrap-table .table:not(.table-condensed) > tbody > tr > th, .bootstrap-table .table:not(.table-condensed) > tfoot > tr > th, .bootstrap-table .table:not(.table-condensed) > thead > tr > td, .bootstrap-table .table:not(.table-condensed) > tbody > tr > td, .bootstrap-table .table:not(.table-condensed) > tfoot > tr > td {
  padding: 8px;
}

.bootstrap-table .table.table-no-bordered > thead > tr > th, .bootstrap-table .table.table-no-bordered > tbody > tr > td {
  border-right: 2px solid transparent;
}

.bootstrap-table .table.table-no-bordered > tbody > tr > td:last-child {
  border-right: none;
}

.fixed-table-container {
  position: relative;
  clear: both;
  border: 1px solid $table-border-color;
}

.fixed-table-container.table-no-bordered {
  border: 1px solid transparent;
}

.fixed-table-footer, .fixed-table-header {
  height: 37px; /*cellHeight*/
  overflow: hidden;
}

.fixed-table-header {
  border-bottom: 1px solid $table-border-color;
}

.fixed-table-footer {
  border-top: 1px solid $table-border-color;
}

.fixed-table-body {
  height: 100%;
  overflow-x: auto;
  overflow-y: auto;
}

.fixed-table-container table {
  width: 100%;
}

.fixed-table-container thead th {
  height: 0;
  padding: 0;
  margin: 0;
  border-left: 1px solid $table-border-color;
}

.fixed-table-container thead th:focus {
  outline: 0 solid transparent;
}

.fixed-table-container thead th:first-child {
  border-left: none;
}

.fixed-table-container thead th .th-inner, .fixed-table-container tbody td .th-inner {
  padding: 8px;
  overflow: hidden;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.fixed-table-container thead th .sortable {
  padding-right: 30px;
  cursor: pointer;
  background-repeat: no-repeat;
  background-position: right;
}

.fixed-table-container thead th .both {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAQAAADYWf5HAAAAkElEQVQoz7X QMQ5AQBCF4dWQSJxC5wwax1Cq1e7BAdxD5SL+Tq/QCM1oNiJidwox0355mXnG/DrEtIQ6azioNZQxI0ykPhTQIwhCR+BmBYtlK7kLJYwWCcJA9M4qdrZrd8pPjZWPtOqdRQy320YSV17OatFC4euts6z39GYMKRPCTKY9UnPQ6P+GtMRfGtPnBCiqhAeJPmkqAAAAAElFTkSuQmCC");
}

.fixed-table-container thead th .asc {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZ0lEQVQ4y2NgGLKgquEuFxBPAGI2ahhWCsS/gDibUoO0gPgxEP8H4ttArEyuQYxAPBdqEAxPBImTY5gjEL9DM+wTENuQahAvEO9DMwiGdwAxOymGJQLxTyD+jgWDxCMZRsEoGAVoAADeemwtPcZI2wAAAABJRU5ErkJggg==");
}

.fixed-table-container thead th .desc {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAAZUlEQVQ4y2NgGAWjYBSggaqGu5FA/BOIv2PBIPFEUgxjB+IdQPwfC94HxLykus4GiD+hGfQOiB3J8SojEE9EM2wuSJzcsFMG4ttQgx4DsRalkZENxL+AuJQaMcsGxBOAmGvopk8AVz1sLZgg0bsAAAAASUVORK5CYII= ");
}

.fixed-table-container th.detail {
  width: 30px;
}

.fixed-table-container tbody td {
  border-left: 1px solid $table-border-color;
}

.fixed-table-container tbody tr:first-child td {
  border-top: none;
}

.fixed-table-container tbody td:first-child {
  border-left: none;
}

.fixed-table-container .table, .fixed-table-container table {
  // border-bottom: none;
  .icon {
    top: auto;
    margin: 0 5px;
  }
}

/* the same color with .active */
.fixed-table-container tbody .selected td {
  background-color: $table-active-bg;
}

.fixed-table-container .bs-checkbox {
  text-align: center;
}

.fixed-table-container .bs-checkbox .th-inner {
  padding: 8px 0;
}

.fixed-table-container input[type="radio"], .fixed-table-container input[type="checkbox"] {
  margin: 0 auto !important;
}

.fixed-table-container .no-records-found {
  text-align: center;
}

.fixed-table-pagination div.pagination, .fixed-table-pagination .pagination-detail {
  margin-top: 10px;
  margin-bottom: 10px;
}

.fixed-table-pagination div.pagination .pagination {
  margin: 0;
}

// Pagination: for v3

.fixed-table-pagination .pagination li {
  display: inline;

  &:first-child {
    > a {
      @include border-left-radius($border-radius);
      margin-left: 0;
    }
  }

  &:last-child {
    > a {
      @include border-right-radius($border-radius);
    }
  }

  &.active > a {
    @include plain-hover-focus {
      z-index: 2;
      color: $pagination-active-color;
      cursor: default;
      background-color: $pagination-active-bg;
      border-color: $pagination-active-border;
    }
  }

  &.disabled > a {
    @include plain-hover-focus {
      color: $pagination-disabled-color;
      cursor: $cursor-disabled;
      background-color: $pagination-disabled-bg;
      border-color: $pagination-disabled-border;
    }
  }
}

.fixed-table-pagination .pagination a {

  @include hover-focus {
    color: $pagination-hover-color;
    background-color: $pagination-hover-bg;
    border-color: $pagination-hover-border;
  }
  position: relative;
  float: left; // Collapse white-space
  padding: 6px 12px;
  margin-left: -1px;
  line-height: 1.428571429;
  color: $pagination-color;
  text-decoration: none;
  background-color: $pagination-bg;
  border: $pagination-border-width solid $pagination-border-color;
}

.fixed-table-pagination .pagination-info {
  margin-right: 5px;
  line-height: 34px;
}

.fixed-table-pagination .btn-group {
  position: relative;
  display: inline-block;
  vertical-align: middle;
}

.fixed-table-pagination .dropup  .dropdown-menu {
  margin-bottom: 0;
}

.fixed-table-pagination .page-list {
  display: inline-block;
}

.fixed-table-toolbar .columns-left {
  margin-right: 5px;
}

.fixed-table-toolbar .columns-right {
  margin-left: 5px;
}

.fixed-table-toolbar .columns label {
  display: block;
  padding: 3px 20px;
  clear: both;
  font-weight: $font-weight-normal;
  line-height: 1.428571429;
}

.fixed-table-toolbar .bs-bars, .fixed-table-toolbar .search, .fixed-table-toolbar .columns {
  position: relative;
  margin-top: 10px;
  margin-bottom: 10px;
  line-height: 34px;
}

.fixed-table-pagination li.disabled a {
  pointer-events: none;
  cursor: default;
}

.fixed-table-loading {
  position: absolute;
  top: 42px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: $fixed-table-loading-z-index;
  display: none;
  text-align: center;
  background-color: $color-white;
}

.fixed-table-body .card-view .title {
  display: inline-block;
  min-width: 30%;
  font-weight: $font-weight-medium;
  text-align: left !important;
}

/* support bootstrap 2 */
.fixed-table-body thead th .th-inner {
  box-sizing: border-box;
}

.table th, .table td {
  box-sizing: border-box;
  vertical-align: middle;
}

.fixed-table-toolbar .dropdown-menu {
  max-height: 300px;
  overflow: auto;
  text-align: left;
}

.fixed-table-toolbar .btn-group > .btn-group {
  display: inline-block;
  margin-left: -1px !important;
}

.fixed-table-toolbar .btn-group > .btn-group > .btn {
  border-radius: 0;
}

.fixed-table-toolbar .btn-group > .btn-group:first-child > .btn {
  border-top-left-radius: $border-radius;
  border-bottom-left-radius: $border-radius;
}

.fixed-table-toolbar .btn-group > .btn-group:last-child > .btn {
  border-top-right-radius: $border-radius;
  border-bottom-right-radius: $border-radius;
}

.bootstrap-table .table > thead > tr > th {
  vertical-align: bottom;
  border-bottom: 1px solid $table-border-color;
}

/* support bootstrap 3 */
.bootstrap-table .table thead > tr > th {
  padding: 0;
  margin: 0;
}

.bootstrap-table .fixed-table-footer tbody > tr > td {
  padding: 0 !important;
}

.bootstrap-table .fixed-table-footer .table {
  padding: 0 !important;
  border-bottom: none;
  border-radius: 0;
}

.pull-right .dropdown-menu {
  right: 0;
  left: auto;
}

/* calculate scrollbar width */
p.fixed-table-scroll-inner {
  width: 100%;
  height: 200px;
}

div.fixed-table-scroll-outer {
  top: 0;
  left: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  visibility: hidden;
}

// for bootstrapV3.x dropdown-menu style
// =====================================
.bootstrap-table {
  .dropdown-menu > li {
    padding: 0 5px;
    margin: 2px 0;
  }

  .dropdown-menu > li > a {
    display: block;
    padding: $dropdown-item-padding-y $dropdown-item-padding-x;
    font-weight: normal;
    line-height: $line-height-base;
    color: $dropdown-link-color;
    white-space: nowrap; // prevent links from randomly breaking onto new lines
    border-radius: $dropdown-item-border-radius;
    transition: background-color .25s;

    &:hover, &:focus {
      color: $dropdown-link-hover-color;
      text-decoration: none;
      background-color: $dropdown-link-hover-bg;
    }
  }

  // Active state
  .dropdown-menu > .active > a {
    &, &:hover, &:focus {
      color: $dropdown-link-active-color;
      text-decoration: none;
      background-color: $dropdown-link-active-bg;
      outline: 0;
    }
  }
  // disabled state
  .dropdown-menu > .disabled > a {
    &, &:hover, &:focus {
      color: $dropdown-link-disabled-color;
    }

    // Nuke hover/focus effects
    &:hover, &:focus {
      text-decoration: none;
      // @include reset-filter;
      cursor: $cursor-disabled;
      background-color: transparent;
      background-image: none; // Remove CSS gradient
    }
  }
}

// use v3 class
.pull-left {
  float: left;
}

.pull-right {
  float: right;
}
