@import '~@ripedata/components/src/common';

.search {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-flow: column;
  background-color: $color-lt-gray;

  &-container {
    /* Need to set min-height and overflow so flex will work properly
    ** Firefox and Edge default to min-height: auto which causes the
    ** flex object to not shrink even though it's set to shrink.
    ** Chrome defaults to min-height: 0px so it works by default
    */
    min-height: 0px;
    overflow: hidden;

    flex-grow: 1;
    flex-shrink: 1;
    display: flex;
    flex-flow: row;
    justify-content: center;
  }

  &-main {
    margin-left: 15px;
    flex-grow: 1;
    flex-shrink: 1;

    display: flex;
    flex-direction: column;
  }

  &-input {
    margin: 30px;
    flex-grow: 1;
    flex-shrink: 1;

    &-container {
      flex-grow: 0;
      flex-shrink: 0;
      display: flex;
      flex-direction: row;
      align-items: center;
      background-color: $color-meddk-gray;
    }

    &-button {
      flex-grow: 0;
      flex-shrink: 0;
      margin-right: 30px;
      padding-left: 30px;
      padding-right: 30px;
      background-color: $color-orange;
      color: $color-white;
    }
  }

  &-status {
    @extend %text-group-title;
    color: $color-black;

    &-container {
      margin-bottom: 20px;
      padding: 20px;
      border-bottom: 1px solid $color-meddk-gray;
    }
  }

  &-results {
    overflow: auto;
    flex-grow: 1;
    flex-shrink: 1;

    &-container {
      flex-grow: 1;
      flex-shrink: 1;

      min-height: 0px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    &-more {
      margin: 0px;
      background-color: $color-orange;
      color: $color-white;
    }
  }

  &-item {
    margin-bottom: 10px;
    background-color: $color-white;
    border-left: 12px solid;
    margin-bottom: 15px;
    padding: 10px 10px 10px 0;

    display: flex;
    flex-direction: row;

    cursor: pointer;

    &-fixed {
      padding-left: 10px;
      width: 250px;

      flex-grow: 0;
      flex-shrink: 0;

      display: flex;
      flex-direction: column;
    }

    &-stretch {
      padding-left: 10px;
      flex-grow: 1;
      flex-shrink: 1;
      display: flex;
      flex-direction: column;
    }

    &-title {
      @extend %text-group-title;
      color: $color-black;
    }

    &-feature {
      @extend %text-feature-copy;
      color: $color-black;
      margin-bottom: 10px;
    }

    &-text {
      @extend %text-body-copy;
      color: $color-black;
    }

    &-note {
      margin-top: auto;
      font-weight: 600;
      color: $color-red;
    }

    &-multi {
      flex-grow: 1;
      flex-shrink: 1;

      display: flex;
      flex-direction: row;
      justify-content: space-between;

    }

    &-logo {
      object-fit: contain;
      max-width: 150px;
      // max-height: 100px;
      margin-left: auto;
      margin-right: auto;
      margin-top: auto;
      margin-bottom: auto;
    }
  }


  // Content styles
  &-content {
    flex-grow: 1;
    flex-shrink: 1;

    display: flex;
    flex-flow: column;

    margin: 30px;

    &-container {
      min-height: 0px;
      overflow: hidden;

      flex-grow: 1;
      flex-shrink: 1;
      display: flex;
      flex-flow: row;
    }
  }

  // Facet container styles
  &-facets {
    flex-grow: 0;
    flex-shrink: 0;
    width: 300px;
    display: flex;
    flex-flow: column;
    overflow: auto;

    background-color: $color-white;

    &-title {
      @extend %text-group-title;
      color: $color-black;
      margin: 20px;
    }

    &-section {
      min-width: 300px;
      max-width: 350px;
      margin-left: unset;
      margin-right: unset;
      flex-grow: 1;
      flex-shrink: 1;
      overflow-y: auto;
      overflow-x: hidden;
    }
  }

  // Facet styles
  &-facet {

    &-container {
      flex-grow: 0;
      flex-shrink: 0;
      display: flex;
      width: 250px;
      flex-flow: column;
      align-items: stretch;
      margin: 0 20px 20px 20px;
    }

    &-title {
      @extend %text-chart-title;
      margin-bottom: 10px;
    }

    &-slider {
      margin-bottom: 20px;
    }

    &-type {
      padding: 10px 20px 10px 20px;
    }

    &-separator {
      padding-bottom: 20px;
      margin-bottom: 20px;
      border-bottom: 1px solid $color-meddk-gray;
    }
  }
}


// .search-filters {
//   flex-order: 1;
//   flex-wrap: wrap;
//   align-items: flex-start;
//   align-content: space-between;
//
//   margin: 10px;
//   padding: 14px;
//   border-radius: 3px;
//   box-shadow: inset 0 0 0 1px rgba( 16, 22, 26, 0.15 );
//   background: rgba( 255, 255, 255, 0.7 )
// }

.search-resultlist {
  /* border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba( 16, 22, 26, 0.15 );
  background: rgba( 255, 255, 255, 0.7 ) */
  overflow: auto;
}

.search-result-item {
  margin: 10px 10px 20px 10px;
  display: flex;
  flex-flow: row;
  align-items: center;
}

.search-result-item-icon {
  flex-grow: 0;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}

.search-result-item-content {
  flex-grow: 1;
  flex-shrink: 1;
  margin-left: 10px;
  margin-right: 10px;
  display: flex;
  flex-flow: column;
}

.search-result-item-line {
  display: flex;
  flex-flow: row;
  margin-bottom: 5px;
}

.search-result-item-line-item {
  margin-right: 20px;
  vertical-align: bottom;
}

.search-result-item-title {
  font-size: 125%;
  margin-right: 20px;
}

.search-result-item-right {
  right: 0px;
}
