/*
  backgrid
  http://github.com/wyuenho/backgrid

  Copyright (c) 2013 Jimmy Yuen Ho Wong and contributors
  Licensed under the MIT license.
*/

.backgrid-container {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
}

.backgrid {
  width: 100%;
  background-color: transparent;
  border-collapse: collapse;
  border: 0;
  -webkit-border-radius: 4px;
     -moz-border-radius: 4px;
          border-radius: 4px;

  & thead,
  & th:nth-child(even),
  & tr:nth-child(even) {
    background-color: transparent;
  }

  .sort-caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.3em;
    border: 0;
    content: "";
  }

  .ascending .sort-caret {
    vertical-align: baseline;
    border-top: none;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #000000;
    border-left: 4px solid transparent;
  }

  .descending .sort-caret {
    vertical-align: super;
    border-top: 4px solid #000000;
    border-right: 4px solid transparent;
    border-bottom: none;
    border-left: 4px solid transparent;
  }



  td {
    display: none;
    padding: 4px 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    &.renderable {
      display: table-cell;
    }
  }

  td.error,
  tbody tr:nth-child(odd) td.error {
    outline: 1px solid #ffd24d;
  }


  th {
    @extend td;
    font-weight: bold;
    &.sortable a {
      cursor: pointer;
      text-decoration: none;
    }
  }

  thead th {
    vertical-align: top;
    border-bottom: 1px solid #DDD;
    a {
      display: block;
    }

    &.merge {
        border-bottom: none;
    }
  }

  thead tr.toprow th {
    text-align: center;
  }

  tbody tr.empty {
    font-style: italic;
    color: gray;
    td {
      display: table-cell;
      text-align: center;
    }
  }

  tbody tr:hover {
    background-color: $white;
  }

  .string-cell,
  .uri-cell,
  .email-cell,
  .string-cell.editor input[type=text],
  .uri-cell.editor input[type=text],
  .email-cell.editor input[type=text] {
    text-align: left;
  }

  .date-cell,
  .time-cell,
  .datetime-cell,
  .number-cell,
  .integer-cell,
  .percent-cell,
  .date-cell.editor input[type=text],
  .time-cell.editor input[type=text],
  .datetime-cell.editor input[type=text],
  .number-cell.editor input[type=text],
  .integer-cell.editor input[type=text],
  .percent-cell.editor input[type=text] {
    text-align: right;
  }

  .boolean-cell,
  .boolean-cell.editor input[type=checkbox] {
    text-align: center;
  }

  /* Powa specific cell formats */
  .query-cell {
    text-align: left;
  }
  .size-cell,
  .sizerate-cell,
  .duration-cell {
    text-align: right;
  }
}
