.search-pop-overlay {
  background-color: rgba(0, 0, 0, .3);
  display: none;
  height: 100%;
  left: 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 2080;
}

.search-popup {
  background: white;
  border-radius: 5px;
  color: $black-dim;
  display: none;
  height: 80%;
  left: 50%;
  margin-left: -350px;
  padding: 0;
  position: fixed;
  top: 10%;
  width: 700px;
  z-index: 9999;

  +mobile() {
    border-radius: 0;
    height: 100%;
    left: 0;
    margin: 0;
    padding: 0;
    top: 0;
    width: 100%;
  }

  .search-icon, .popup-btn-close {
    color: $grey-dark;
    display: inline-block;
    font-size: 18px;
    height: 36px;
    padding-left: 10px;
    padding-right: 10px;
    width: 18px;
  }

  .popup-btn-close {
    border-left: 1px solid #eee;
    cursor: pointer;
    float: right;

    &:hover .fa {
      color: $black-deep;
    }
  }

  .search-header {
    background: $whitesmoke;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    padding: 5px;
  }
}

if (hexo-config('algolia_search.enable')) {
  .search-input {
    display: inline-block;
    width: calc(90% - 30px);

    input {
      background: transparent;
      border: 0;
      outline: none;
      padding: 5px 0;
      width: 100%;
    }
    // Hide default icon of algolia search
    .ais-search-box--magnifier svg, .ais-search-box--reset svg {
      display: none;
    }
  }

  .algolia-powered {
    float: right;

    img {
      display: inline-block;
      height: 18px;
      vertical-align: middle;
    }
  }

  .algolia-results {
    height: calc(100% - 55px);
    overflow: auto;
    padding: 5px 30px;
    position: relative;

    hr {
      margin: 10px 0;
    }

    .highlight {
      color: red;
      font-size: inherit;
      font-style: normal;
      margin: 0;
      padding: 0 2px;
    }
  }

  .algolia-hits {
    margin-top: 20px;
  }

  .algolia-hit-item {
    margin: 15px 0;
  }

  .algolia-hit-item-link {
    border-bottom: 1px dashed #ccc;
    display: block;
    the-transition();
  }

  .algolia-pagination {
    .pagination {
      border-top: none;
      margin: 40px 0;
      opacity: 1;
      padding: 0;
    }

    .pagination-item {
      display: inline-block;
    }

    .page-number {
      border-top: none;

      &:hover {
        border-bottom: 1px solid $black-deep;
      }
    }

    .current .page-number {
      @extend .pagination .page-number.current;
    }

    .disabled-item {
      visibility: hidden;
    }
  }
}

if (hexo-config('local_search.enable')) {
  .search-loading-icon {
    margin: 20% auto 0 auto;
    text-align: center;
  }

  .search-popup {
    ul.search-result-list {
      margin: 0 5px;
      padding: 0;
    }

    p.search-result {
      border-bottom: 1px dashed #ccc;
      padding: 5px 0;
    }

    a.search-result-title {
      font-weight: bold;
    }

    .search-keyword {
      border-bottom: 1px dashed #f00;
      color: #f00;
      font-weight: bold;
    }

    #search-result {
      height: calc(100% - 55px);
      overflow: auto;
      padding: 5px 25px;
      position: relative;
    }

    .search-input-container {
      display: inline-block;
      height: 36px;
      line-height: 36px;
      padding: 0 5px;
      position: absolute;
      width: calc(100% - 90px);

      input {
        background: transparent;
        border: 0;
        display: block;
        height: 20px;
        outline: none;
        padding: 8px 0;
        vertical-align: middle;
        width: 100%;
      }
    }

    #no-result {
      color: $grey-light;
      left: 50%;
      position: absolute;
      top: 50%;
      transform: translate(-50%, -50%);
    }
  }
}
