/*!
 * Custom CSS styling for DataTables, the search/sort/pagination/etc plugin for our submission tables
 * Utilitized in the 'All Submissions' and 'Curate' pages
 * @author Katie Williams
 * 
 * Based on a file created by the DataTables downloader builder:
 * https://datatables.net/download
 *
 */

/* Tables */

table a.link-text  {
    padding-top:8px
}

table a.truncate-text,
table span.truncate-text {
  display: inline-block;
}

table .truncate-text {
  max-width: 100%;
  /* IE hax contains corresponding width */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

table a.show-truncated-text {
  position: absolute;
  right: -3px;
}

table a.show-truncated-text:hover {
  text-decoration: none;
}

table.submissionsTable th {
  /* padding: 8px 0 3px 18px !important; */
}

table.submissionsTable th:nth-child(2) {
  width: 35.25%;
}

table.submissionsTable th:nth-child(3) {
  width: 8.75%;
}

table.submissionsTable,
table.data_lakesStatsTable {
  width: 100%;
  margin: 0 auto;
  clear: both;
  border-collapse: separate;
  border-spacing: 0;
}

table.submissionsTable th:first-child {
  width: 2.25%;
}

table.submissionsTable th,
#data_lakesStatsTable th {
  min-height: 40px;
}

table.submissionsTable th.sorting_disabled {
  cursor: default;
}

table.submissionsTable th.sorting_disabled::after {
  display: none;
}

table.submissionsTable tr .doi-wrapper {
  position: relative;
}

table.submissionsTable tr .doi-update-btn {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

table.submissionsTable tr .doi-details {
  opacity: 0;
  transition: opacity 0.2s;
}

table.submissionsTable tr:hover .doi-details {
  opacity: 1;
}

table.submissionsTable td.submission-name-only {
  max-width: 40em;
}

table.submissionsTable tr:hover .favorite-toggle {
  color: #0073ff !important;
}

table.submissionsTable tr .favorite-count {
  display: inline;
  padding-left: 4px;
}

table.submissionsTable .favorite-icons {
  font-size: 2rem;
}

table.submissionsTable td.org-name-only {
  max-width: 40em;
}

table.submissionsTable td.submission-name-extra-cols {
  max-width: 22em;
}

table.submissionsTable td.org-name-extra-cols {
  max-width: 10em;
}

table.submissionsTable td.submission-name-with-notes {
  max-width: 15em;
}

table.submissionsTable td.org-name-with-notes {
  max-width: 10em;
}

table.submissionsTable td.sub-project-num,
table.submissionsTable td.sub-resource-count {
  max-width: 90px;
}

#data_lakesStatsTable th:first-child,
#data_lakesStatsTable tbody tr td:first-child  {
max-width: 30em;
}

/* Submitted col */
#data_lakesStatsTable th:nth-child(3),
#data_lakesStatsTable tbody tr td:nth-child(3),
/* Downloads Last Month col */
#data_lakesStatsTable th:nth-child(4),
#data_lakesStatsTable tbody tr td:nth-child(4),
/* Downloads Last Year col */
#data_lakesStatsTable th:nth-child(5),
#data_lakesStatsTable tbody tr td:nth-child(5),
/* Resources col */
#data_lakesStatsTable th:nth-child(6),
#data_lakesStatsTable tbody tr td:nth-child(6) {
  min-width: 8em;
}

table .popover {
  width: 600px;
  /* extra-wide to show td.truncated-text overflows */
}

/*DataTables Loading Row Animation  */
table #loadingRow {
  height: 300px;
}

.circle {
  position: absolute;
  left: 43%;
  top: 50%;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #015582;
  animation-name: loading;
  animation-duration: 3s;
  animation-iteration-count: infinite;
}

.circle:nth-of-type(1) {
  margin-left: 0;
  animation-delay: .1s;
}

.circle:nth-of-type(2) {
  margin-left: 3rem;
  animation-delay: .2s;
}

.circle:nth-of-type(3) {
  margin-left: 6rem;
  animation-delay: .3s;
}

.circle:nth-of-type(4) {
  margin-left: 9rem;
  animation-delay: .4s;
}

.circle:nth-of-type(5) {
  margin-left: 12rem;
  animation-delay: .5s;
}

.circle:nth-of-type(6) {
  margin-left: 15rem;
  animation-delay: .6s;
}

.circle:nth-of-type(7) {
  margin-left: 18rem;
  animation-delay: .7s;
}

@keyframes loading {
  0% {
  }
  50% {
    transform: translateY(-5rem) scale(2);
  }
  100% {
    opacity: 0;
  }
}

/* Table Body styles */
  table.dataTable thead th {
    color: rgb(113, 114, 119);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    padding: 8px 18px 3px 3px;
    border-bottom: 1px solid #999;
  }
  table.dataTable thead th:active,
  table.dataTable thead td:active {
    outline: none;
  }
  table.dataTable thead .sorting::after,
  table.dataTable thead .sorting_asc::after,
  table.dataTable thead .sorting_desc::after,
  table.dataTable thead .sorting_asc_disabled::after,
  table.dataTable thead .sorting_desc_disabled::after {
    display: inline-block;
    cursor: pointer;
    font-family: FontAwesome;
    padding-left: 4px;
  }
  table.dataTable thead th:hover {
    color: #015582;
  }
  table.dataTable th:not(:first-child)::after {
    content: "\f0dc";
  }
  table.dataTable thead .sorting:not(:first-child)::after {
    content: "\f0dc";
  }
  table.dataTable thead .sorting_asc:not(:first-child)::after {
    content: "\f0de";
  }
  table.dataTable thead .sorting_desc:not(:first-child)::after {
    content: "\f0dd";
  }
  table#data_lakesStatsTable th:first-child::after {
    content: "\f0dc";
  }
  table#data_lakesStatsTable thead .sorting:first-child::after {
    content: "\f0dc";
  }
  table#data_lakesStatsTable thead .sorting_asc:first-child::after {
    content: "\f0de";
  }
  table#data_lakesStatsTable thead .sorting_desc:first-child::after {
    content: "\f0dd";
  }
  table.dataTable tbody th,
  table.dataTable tbody td {
    padding: 8px 20px 0 3px;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    color: #2d2d2d;
  }

  table.dataTable:not(.curate) thead th:first-child,
  table.dataTable:not(.curate) tbody td:first-child {
    padding:0;
    width: 0;
  }
  tbody tr:hover {
    background-color: #f1f6ff !important;
  }
  table.dataTable.row-border tbody th, 
  table.dataTable.row-border tbody td, 
  table.dataTable.display tbody th, 
  table.dataTable.display tbody td {
    border-top: 1px solid #ddd;
  }
  table.dataTable.row-border tbody tr:first-child th,
  table.dataTable.row-border tbody tr:first-child td, 
  table.dataTable.display tbody tr:first-child th,
  table.dataTable.display tbody tr:first-child td {
    border-top: none;
  }
  table.dataTable.no-footer {
    border-bottom: 1px solid #999999;
  }
  table.dataTable.nowrap th, table.dataTable.nowrap td {
    white-space: nowrap;
  }
  table.dataTable.compact thead th,
  table.dataTable.compact thead td {
    padding: 4px 17px 4px 4px;
  }
  table.dataTable.compact tbody th,
  table.dataTable.compact tbody td {
    padding: 4px;
  }
  /*
   * Control features (search, number of entries, pagination) layout
   */
  .dataTables_wrapper {
    position: relative;
    clear: both;
    zoom: 1;
    padding-top: 10px;
  }
  #data_lakesStatsTable_wrapper.dataTables_wrapper {
    overflow-x: scroll;
    height: auto;
  }
  .dataTables_wrapper .dataTables_length {
    float: right;
  }
  .dataTables_wrapper .dataTables_filter {
    float: left;
    text-align: right;
  }
  .dataTables_wrapper .dataTables_filter input {
    font-weight: normal;
    border: none;
    border-bottom: 2px solid #707277;
  }
  .dataTables_wrapper .dataTables_filter label {
    position: relative;
  }
  .dataTables_wrapper .dataTables_filter label::after {
    content: "\f002";
    font-family: FontAwesome;
    position: absolute;
    right: 1px;
    color: #707277;
  }
  .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #015582;
    color: #015582;
  }
  .dataTables_wrapper .dataTables_info {
    clear: both;
    float: left;
    padding-top: 1em;
  }
  .dataTables_wrapper .dataTables_paginate {
    float: right;
    text-align: right;
    padding-top: 0.75em;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button {
    box-sizing: border-box;
    display: inline-block;
    min-width: 1.5em;
    padding: 0.5em 1em;
    margin-left: 2px;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    color: #333 !important;
    border: 1px solid transparent;
    border-radius: 2px;
    font-weight: 500;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button.current,
  .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    color: #333 !important;
    background-color: #F0F0F0;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
  .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
  .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
    cursor: default;
    color: #666 !important;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: black !important;
    background-color: #8BDEDD;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button:active {
    color: whitesmoke !important;
    outline: none;
    background-color: #015582;
  }
  .dataTables_wrapper .dataTables_paginate .ellipsis {
    padding: 0 1em;
  }
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    color: #333;
  }
  .dataTables_wrapper:after {
    visibility: hidden;
    display: block;
    content: "";
    clear: both;
    height: 0;
  }
  .dataTables_wrapper .dataTables_length {
    color: #707277;
  }
  .dataTables_wrapper .dataTables_length select {
    cursor: pointer;
  }
  .dataTables_wrapper .dataTables_info {
    color: #757575;
    font-style: italic;
  }
  /* Add sidescroll to table and controls for smaller screens */
  @media screen and (max-width: 992px) {
    .dataTables_wrapper {
      overflow-x: scroll;
    }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
      float: none;
      text-align: left;
      font-size: 16px;
    }
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
      float: none;
      text-align: center;
      font-size: 16px;
    }
    .dataTables_wrapper .dataTables_paginate {
      margin-top: 0.5em;
    }
    /* hide dashboard icons for smaller screens */
    @media screen and (max-width: 320px) {
      .favorite-dashboard-icon {
        display: none;
      }
    }
  }
