/**
This is an entirely custom library for CommCare HQ and serves as the stylesheet
for the new reporting grids (tables).
 */

.datagrid-table-wrapper {
  overflow-x: scroll;
}

.datagrid-number-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-block;

  li {
    padding: 0;
    margin: 0;
    display: inline-block;

    &.current {
      font-weight: bold;
    }
  }
}

.datagrid-loading {
  background-color: rgba(255, 255, 255, .75);
  position: absolute;
  width: 100%;

  .loading-text {
    color: $cc-neutral-low;
    font-size: $font-size-base * 1.2;
    line-height: 100px;
    top: calc(50% - 50px);
    text-align: center;
  }
}

.datagrid-filter-settings {
  padding-bottom: 10px;

  .filter-type {
    display: inline-block;
    width: 80px;
  }

  .filter-clause {
    display: inline-block;
    width: 100px;
  }
}


.datagrid-filter {
  padding-bottom: 10px;

  .datagrid-filter-choice {
    display: inline-block;
    width: 197px;
  }

  .datagrid-filter-value {
    display: inline-block;
    width: 354px;
  }

  a {
    display: inline-block;
    line-height: 20px;
    text-align: center;

    &:hover {
      text-decoration: none;
    }
  }
}

.datagrid-add-expression {
  margin-bottom: 10px;
}

$_header-height: 18px;

.datagrid-sort {
  display: inline-block;
  width: 15px;
  height: $_header-height;
  line-height: $_header-height;
}

.datagrid-add-link {
  display: block;
  width: 100px;
  height: auto;
  line-height: $_header-height;
}

.datagrid-edit-link {
  display: inline-block;
  width: calc(100% - 35px);
  line-height: $_header-height;
  height: $_header-height;

  .edit-icon {
    opacity: 0;
    transition: .5s ease-in-out opacity;
  }

  &:hover {
    .edit-icon {
      opacity: 1.0;
    }
  }
}

.datagrid-external-link {
  display: inline-block;
  width: 15px;
}

.datagrid-sort,
.datagrid-add-link,
.datagrid-edit-link,
.datagrid-external-link {
  color: $call-to-action-mid;

  &:hover {
    text-decoration: none;
  }
}

.datagrid-save {
  float: right;
  margin-top: -40px;
}

.datagrid-initial-loading {
  position: relative;
  z-index: 1000;

  .modal-dialog {
    position: absolute;
    left: 50%;
    top: 0;
    width: 300px;
    margin-left: -150px;

    .modal-content {
      padding-top: 20px;

      .lead {
        padding-top: 10px;
      }
    }
  }
}

.table-datagrid {
  min-height: 200px;
}
