// ====================================================================
// Styles for data tables generated by php class `uiSelectTable`.
//
//   OLD STUFF! (overly complex selectors, not worth fixing atm)
//
//   Cf.
//     lib/uiparts/uiSelectTable.php
//     lib/helper/templates/ui_select_table.php
//
// ====================================================================

.uiTable {
  // crude solution for horizontal scrolling on small screens
  overflow-y: auto;
  _overflow: auto;
  margin: 0 0 1em;
}

// --------------------------------------------------------------------
// DATA TABLES (as output by uiSelectTable php component)
//
//   <table class="uiTabular">
//   <table class="uiTabular is-dense">   for compact rows
//
// --------------------------------------------------------------------
.uiTabular {
  border: 1px solid #BDBCAA;
  border-top: 1px solid #D9D8CE;
  width: 100%;

  /* thead */
  th {
    padding: 0;
    font: 13px Arial, sans-serif;
    color: #5C5B52;
    border-bottom: 1px solid #A1A1A1;
    text-align: left;
    background: #D9D6B7 url(/assets/legacy/widgets-selecttable.gif) repeat-x 0 0;
  }

  // use `<span class="is-padded">` for labels within TH that are not links
  th a,
  th .is-padded {
    display: block;
    float: left;
    padding: 6px 10px;
    text-align: left;
    text-decoration: none;
  }

  /* non-sortable */
  th a {
    color: #005CB1;
  }

  th a:hover {
    text-decoration: underline;
    color: #005CB1;
    padding-right: 12px;
    background-color: #fff;
  }

  th a.active {
    color: #000;
  }

  /* sort icon */
  th a.sort {
    padding-right: 12px;
  }

  th a.sort:hover {
    background: url(/assets/legacy/widgets-selecttable.gif) no-repeat 100% 50%;
  }

  th a.sortasc {
    padding-right: 12px;
    background: url(/assets/legacy/widgets-selecttable.gif) no-repeat 100% -37px;
  }

  th a.sortdesc {
    padding-right: 12px;
    background: url(/assets/legacy/widgets-selecttable.gif) no-repeat 100% -72px;
  }

  /* tbody */
  td {
    padding: 10px 10px;
    color: #666;
    font-size: 13px;
    line-height: 1.1em;
    border-bottom: 1px solid #E8E5CA;
  }

  &.is-dense td {
    padding: 5px 10px;
  }

  tbody td {
    background-color: $--clr-tbl-bg;
    color: #5C5B52;
  }

  .odd td {
    background-color: #fff;
  }

  /* uiTable hover */
  tbody tr.hover {
    background-color: #fff;
  }

  tbody var {
    color: #000;
    font-size: 13px;
  }

  /* errors */
  tbody td.error {
    background-color: #FBCFCF;
  }

  /* CELL STYLES */
  td.red {
    color: #C82222;
  }

  /* failed reviews */
  td.compound {
    color: #000;
    padding-top: 0;
    padding-bottom: 0;
  }

  td.kanji {
    text-align: center;
    font-size: 24px;
    line-height: 1em;
    color: #000;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  td.keyword {
    text-align: left;
    font: 15px/1em Georgia, serif;
    white-space: nowrap;
  }
}

@media (max-width:767px) {

  /* hug edges on phones (xs) */
  .uiTable {
    border: none;
  }

  .uiTabular {
    border-left: none;
    border-right: none;
  }
}