@import "../../styles/helper";

#search {
  padding: 0 !important;
  height: calc(100% - 106px) !important;
  width: 100% !important;
  overflow-y: hidden !important;

  &.show-result {
    #search-main {
      transform: scale(0.8);

      #search-input {
      }

      #search-history {
        display: none;
      }
    }
  }

  #search-main {
    position: fixed;
    width: 266px;
    right: 42px;
    transform: translateX(calc(-50vw + 266px / 2 + 60px)) translateY(20vh);
    @include transition;

    #search-input {
      position: relative;
      width: 100%;
      height: 38px;
      border-radius: 28px;
      background: rgba(255, 255, 255, 0.1);
      box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.29);
      overflow: hidden;
      @include thin-border;

      input {
        background-color: rgba(0, 0, 0, 0);
        text-align: left;
        font-size: 15px;
        line-height: 16px;
        color: white;
        border: none;
        padding-left: 15px;
        width: calc(100% - 15px);
        height: 100%;

        &::placeholder {
          opacity: 0.9;
          color: white;
          letter-spacing: 1px;
        }
      }

      .icon {
        position: absolute;
        height: 90%;
        right: 5px;
        top: 5%;
        cursor: pointer;
      }
    }

    #search-history {
      margin-top: 36px;

      & > p {
        font-size: 16px;
        text-align: center;
        letter-spacing: 0.05em;
        margin-bottom: 10px;
      }

      .search-history-content {
        margin-top: 4px;
        text-align: center;
        max-height: 166px;
        overflow: hidden;

        .search-history-item {
          display: inline-block;
          color: white;
          background-color: rgba(0, 0, 0, 0.2);
          font-size: 13px;
          padding: 4px 10px 5px;
          margin: 6px;
          border-radius: 16px;
          border: 1px solid rgba(255, 255, 255, 0.1);
          transition: all ease 600ms;
          cursor: pointer;

          &:hover {
            transform: scale(1.05);
          }
        }
      }
    }
  }

  #search-result-nav {
    margin-left: 70px;
    display: inline-block;
    position: fixed;

    & > div {
      display: inline-block;
      background: rgba(0, 0, 0, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.5);
      border-radius: 30px;
      padding: 3px 12px;
      margin-right: 16px;
      opacity: 0.8;
      font-size: 14px;
      cursor: pointer;
      @include transition;

      &.active,
      &:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.26);
        border: 1px solid #ffffff;
        transform-origin: bottom;
      }
    }
  }

  #search-result-title {
    position: fixed;
    text-align: left;
    margin-top: 48px;
    font-weight: normal;
    font-size: 22px;
    margin-left: 70px;
  }

  #search-result-content {
    width: 300vw;
    display: flex;
    @include transition;
    transition-duration: 800ms;
    height: calc(100% - 91px);
    margin-top: 90px;
    overflow: hidden;

    #vol-search-result-content,
    #track-search-result-content,
    #article-search-result-content {
      width: calc(100vw - 70px * 2) !important;
      padding: 20px 70px 0 !important;
      height: calc(100% - 25px);
      overflow-y: scroll;

      .pagination {
        margin-bottom: 88px;
      }
    }
  }
}
