/**
* Styles for React-based faceted search UI for studies
*/
@import './_colors.scss';

// To consider: remove this min-height once study result list can be shown
#main-body {
  min-height: 300px;
}

.search-button {
  position: absolute;
  right: 10px;
  top: 19px;
}

#bulk-download-modal {
  #download-command-caption {
    font-size: 12px;
  }

  .download-refresh-button {
    margin-top: -3px;
  }
}

nav.search-links, #search-panel {
  a {
    cursor: pointer;
    text-decoration: none;
    color: $action-color;
    &:hover {
      text-decoration: none;
      color: $action-color;
      background: lighten($action-color, 50%);
    }
  }
}


 nav.search-links {
  a {
    padding: 0.5em 1em 0.25em 1em;
    font-size: larger;
    display: inline-block;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    &.active {
      background-color: #fff;
      color: #333;
      border-bottom: 2px solid #333;
    }
  }
}

#search-panel {
  .facet{
    white-space: nowrap;
    display: inline-block;
    margin-right: 8px;
    box-sizing: border-box;
    vertical-align: top;
    > a {
      background-color: white;
      padding: 8px 16px;
      border-radius: 15px;
      border: 0.64px solid #4d72aa;
      width: 100%;
      box-sizing: border-box;
      display: inline-block;
      user-select: none;
    }
    &.active > a, &.selected > a {
      background-color: $action-color;
      color: #fff;
    }

    .facet-clear, .cell-filter-clear {
      float: right;
      padding: 0px;
      background-color: $action-color;
      margin-left: 0.5em;
      color: #fff;
      border: none;
    }
  }
  #download-button {
    background-color: white;
    vertical-align: top;
    display: inline-block;
    padding: 8px 16px;
    margin-right: 8px;
    border-radius: 15px;
    border: 0.64px solid #4d72aa;
    box-sizing: border-box;
  }
  #more-facets-button > span,
  #download-button > span {
    color: $action-color;
    font-weight: 500;
  }

  #download-button.active {
    background-color: $action-color;
  }

  #download-button.active > span {
    color: #fff;
  }

  .facet.active > span,
  #more-facets-button.active > span {
    color: #fff;
    background-color: $action-color;
  }

  .filters-search-bar {
    margin: 6px 2px 12px 2px;
    input {
      background: #E9ECEF;
      border: none;
      height: 45px;
    }
    input::placeholder,input::-ms-input-placeholder {
      color: #777;
    }
    button {
      background: #eee;
      border: none;
      color: $action-color;
      margin-top: -5px;
    }
  }

  .clear-filters {
    color: #3D5A87;

    margin-left: 10px;
    position: relative;
    top: 8px;
    cursor: pointer;
  }

  ul {
    list-style-type: none;
    padding-left: 5px;
  }

  ul.facet-filter-list {
    max-height: 300px;
    overflow-y: auto;
    label {
      display: inline-block;
      white-space: nowrap;
    }
    input {
      font-size: 2em;
      vertical-align: middle;
      margin-top: 0px;
      margin-right: 12px;
    }
    label span {
      vertical-align: middle;
    }
  }

  li {
    width: 100%;
    margin-bottom: 0.5em;
  }

  .default-filters-list-name {
    padding-left: 15px;
    font-weight: bold;
  }

  .facet-ontology-links {
    text-align: right;
    float: right;
    > a {
      margin-right: 1em;
      display: block;
    }
  }

  .filters-box-searchable, #facets-accordion {
    width: 560px;
    border: 1px solid #aaa;
    background: #fff;
    position: absolute;
    z-index: 9000;
    border-radius: 5px;
    padding: 2px;
    margin-top: 2px;
    .badge {
      font-weight: normal;
      background: $action-color;
      cursor: pointer;
      margin-right: 0.2em;
    }
    .filter-badge-list {
      white-space: normal
    }
  }

  .filters-box-header {
    margin: 5px 0px;
    display: flex;
    justify-content: space-between;
  }

  label {
    margin-left: 8px;
    font-weight: normal;
  }

  .facet-apply-button {
    float: right;
    margin: 0 10px 10px 0;
  }

  .filters-box-footer {
    height: 40px;
  }

  #facets-accordion {
    background: #eff2f5;
    overflow-x: hidden;
    .filters-box-searchable {
      margin-left: 0px;
    }
    .panel-heading {
      background: #fff;
      padding: 0px;
      width: 100%;
      border: none;
    }
    .panel-title a {
      padding: 10px 15px;
      color: $action-color;
      width: 100%;
      display: block;
      border: 1px solid #ddd;
    }
    .facet {
      width: 98%;
      display: block;
      margin: 5px 2px;
      .filters-box-searchable {
        position: relative;
        width: 98%;
        border: none;
        margin-top: -2px;
      }
    }
  }

  .accordion .card {
    margin: 10px;
    border: 1px solid #aaa;
    border-radius: 4px;
  }

  .accordion .card-header {
    padding: 5px;
    color: #3D5A87;
    font-weight: 500;
    cursor: pointer;
  }

  .combined-facet {
    width: auto;
    .filters-box-searchable {
      width: 390px;
      margin-left: 0;
      position: relative;
      border: none;
    }
    .multi-facet-container {
      display: flex;
      .single-facet:nth-of-type(2) {
        margin-left: 12px;
      }
    }
    h4 {
      margin-left: 5px;
      margin-top: 6px;
    }
  }
}

.row.gene-study-filter {
  margin-top: 0.5em;
}

.study-gene-result {
  .gene-load-spinner {
    position: absolute;
    top: 40%;
    left: 50%;
    color: #999;
    font-size: 2.5em;
  }
  .expression-graph {
    min-height: 450px
  }
  .graph-container {
    display: flex;
    align-items: center;
    margin-top: 0.25em;
  }

  /* hide morpheus toolbar */
  div[data-name="toolbar"] {
    display: none;
  }
}

.advanced-opts {
  display: inline;
}

.new-feature {
  padding: 0.15em 0.35em;
  border-radius: 3px;
  background: #d95350;
  font-weight: bold;
  color: #fff;
}

.download-table-container {
  margin: 1em 0em 1em 0em;
  overflow-x: hidden;
}
.download-size-message {
  float: right;
}

#download-size-amount {
  border: 2px solid #eee;
  padding: 0.5em;
  border-radius: 5px;
  margin-left: 1em;
}

.download-steps-header .badge {
  color: #fff;
  background-color: #333;
  font-size: 0.9em;
  vertical-align: inherit;
  border-radius: 2em;
}

.download-steps-header .greyed {
  color: #888;
  .badge {
     background-color: #888;
  }
}

.download-url-modal .input-group {
  margin: 1em 0 2em 0;
}

span.search-title {
  font-weight: bold;
  color: #666;
  display: block;
  margin: 3px 0;
}

span.metadata-search {
  width: 98%;
}

div.metadata-search-wrap {
  margin-right: 0.75em;
}

span.text-search {
  width: 312px;
}

.advanced-opts {
  margin-top: 23px;
}

#home-page-bookmark {
  a, span.action {
    padding: 0 5px;
    font-size: larger;
  }
  :hover {
    background-color: inherit;
  }
}

#search-options-menu {
  ul {
    list-style-type: none;
    padding-left: 0px;
  }

  ul.facet-filter-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 0;
    label {
      display: inline-block;
      white-space: nowrap;
    }
    input {
      font-size: 2em;
      vertical-align: middle;
      margin-top: 0px;
      margin-right: 12px;
    }
    label span {
      vertical-align: middle;
      font-weight: normal;
    }
  }

  li {
    width: 100%;
    margin-bottom: 0.5em;
  }
}
