@import 'admin.scss';
@import 'search-input.scss';
@import 'search-result.scss';

.webien-search-popup {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  font-family: "Hurme (Geblod)", Sans-serif;
  .inner {
    display: flex;
    flex-direction: column;
    height: 100px;
    max-width: 700px;
    width: 100%;
    transition: height 300ms ease, margin-top 300ms ease;
    @media (max-width: 730px) {
      padding: 0 15px;
    }
    &.searched {
      height: 95%;
      margin-bottom: -5%;
    }
    .search-input-container {
      flex: 0 0 auto;
      position: relative;
      display: flex;
      width: 100%;
      .filters {
        position: relative;
        z-index: 9999;
        .filter-inner {
          position: relative;
          flex: 0 0 auto;
          display: flex;
          align-items: center;
          justify-content: center;
          height: 50px;
          width: 90px;
          background: #efefef;
          border-right: 1px solid #ccc;
          font-size: 13px;
          padding: 0 15px;
          cursor: pointer;
          i {
            color: #af0a3c;
            margin-left: 6px;
            font-size: 12px;
          }
        }
        .choices {
          display: none;
          position: absolute;
          top: calc(100% + 10px);
          left: -20px;
          width: 130px;
          background: #efefef;
          border-radius: 3px;
          &:after {
            content: ' ';
            display: block;
            position: absolute;
            top: 0px;
            left: 50%;
            width: 10px;
            height: 10px;
            background: #efefef;
            transform: rotate(45deg) translateX(-50%);
          }
          .choice {
            display: flex;
            align-items: center;
            padding: 10px;
            font-size: 13px;
            line-height: 1;
            cursor: pointer;
            & + .choice {
              border-top: 1px solid #eee;
            }
            &.chosen:before {
              background: #00b4aa;
            }
            &:before {
              content: ' ';
              display: inline-block;
              height: 13px;
              width: 13px;
              border: 1px solid #ccc;
              border-radius: 3px;
              margin-right: 5px;
            }
          }
        }
      }
      input {
        flex: 1 1 auto;
        background: #efefef;
        box-shadow: none;
        -webkit-appearance: none;
        border-radius: 0;
        border: 0;
        height: 50px;
        box-sizing: border-box;
      }
      button {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        height: 50px;
        width: 50px;
        background: #00b4aa;
        box-shadow: none;
        border-radius: 0;
        outline: 0;
        border: 0;
        -webkit-appearance: none;

        &:focus {
          border: 0;
          outline: 2px solid #00b4aa;
          outline: 2px solid -webkit-focus-ring-color;
        }
        i {
          color: #fff;
          font-size: 18px;
        }
      }
    }
    .search-buttons {
      flex: 0 0 auto;
      height: 50px;
      text-align: right;
      .close {
        display: inline-flex;
        align-items: center;
        height: 100%;
        color: #fff;
        font-size: 14px;
        box-shadow: none;
        padding: 0;
        margin: 0;
        outline: 0;
        border: 0;
        -webkit-appearance: none;
        cursor: pointer;
        &:hover {
          background: none;
        }
        &:focus {
          background: none;
          text-decoration: underline;
        }
      }
    }
    .loading-animation, .results {
      flex: 1 1 auto;
      display: none;
      .item {
        display: flex;
        min-height: 100px;
        border-radius: 8px;
        overflow: hidden;
        & + .item {
          margin-top: 15px;
        }
        .image {
          flex: 0 0 auto;
          width: 100px;
        }
        .content {
          position: relative;
          flex: 1 1 auto;
          width: 65%;
          padding: 20px;
        }
      }
    }
    .results {
      padding-bottom: 50px;
      overflow: auto;
      -ms-overflow-style: none;
      scrollbar-width: none;
      &::-webkit-scrollbar {
        display: none;
      }
      .item {
        background: #fff;
        min-height: 0;
        color: #333;
        .image {
          display: flex;
          align-items: center;
          justify-content: center;
          background: #af0a3c;
          width: auto;
          width: 80px;
          height: 80px;
          border-radius: 50% 50% 0 50%;
          margin: 20px 0 20px 20px;
          i {
            font-size: 28px;
            color: #fff;
          }
        }
        .content {
          .type {
            color: #00b4aa;
            font-size: 13px;
            font-weight: bold;
            margin-bottom: 5px;
          }
          .title {
            font-size: 18px;
            font-weight: bold;
            .location {
              font-size: 16px;
              font-weight: normal;
            }
          }
          .opening {
            font-size: 14px;
            margin-top: 5px;
          }
          .text {
            
          }
        }
      }
    }
    .loading-animation {
      display: none;
      .item {
        height: 100px;
        opacity: 0.9;
        animation: placeHolderSwept 1.5s infinite linear forwards;
        background: #ebebeb;
        background-image: linear-gradient(to right, #ebebec 0%, #e0e0e2 20%, #ebebec 40%, #ebebec 100%);
        .content {
          .line {
            position: absolute;
            background: #fff;
            &.top {
              top: 0;
              right: 0;
              left: 0;
              height: 20px;
            }
            &.right {
              top: 0;
              right: 0;
              bottom: 0;
              width: 20px;
            }
            &.bottom {
              bottom: 0;
              left: 0;
              right: 0;
              height: 35px;
            }
            &.left {
              top: 0;
              bottom: 0;
              left: 0;
              width: 20px;
            }
            &.heading-line {
              right: 0;
              bottom: 53px;
              left: 0;
              height: 14px;
              &:after {
                content: ' ';
                display: block;
                position: absolute;
                right: 0;
                bottom: 100%;
                height: 15px;
                width: 80%;
                background: #fff;
              }
            }
          }
        }
      }
    }
  }
  .searching {
    display: inline-flex;
    align-items: center;
    //justify-content: center;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    margin-top: 15px;
    font-size: 14px;
    opacity: 0;
    transition: 300ms ease opacity;
    pointer-events: none;
    &.show {
      opacity: 1;
    }
  }
  .spinner {
    height: 25px;
    text-align: center;
    font-size: 10px;
    margin-left: 10px;
  }

  .spinner > div {
    background-color: #fff;
    height: 100%;
    width: 6px;
    display: inline-block;
    margin-left: 3px;

    -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
    animation: sk-stretchdelay 1.2s infinite ease-in-out;
  }

  .spinner .rect2 {
    -webkit-animation-delay: -1.1s;
    animation-delay: -1.1s;
  }

  .spinner .rect3 {
    -webkit-animation-delay: -1.0s;
    animation-delay: -1.0s;
  }

  .spinner .rect4 {
    -webkit-animation-delay: -0.9s;
    animation-delay: -0.9s;
  }

  .spinner .rect5 {
    -webkit-animation-delay: -0.8s;
    animation-delay: -0.8s;
  }
}

@keyframes placeHolderSwept {
  0% {
    background-position: -700px 0
  }
  100% {
    background-position: 700px 0
  }
}

@-webkit-keyframes sk-stretchdelay {
  0%, 40%, 100% { -webkit-transform: scaleY(0.4) }
  20% { -webkit-transform: scaleY(1.0) }
}

@keyframes sk-stretchdelay {
  0%, 40%, 100% {
    transform: scaleY(0.4);
    -webkit-transform: scaleY(0.4);
  }  20% {
    transform: scaleY(1.0);
    -webkit-transform: scaleY(1.0);
  }
}