@import "../../../assets/scss/variables";

#search-bar {
  height: 44px;
  width: 100%;
  border-bottom: 2px solid $blue-to-gray;
  display: flex;
  align-items: center;
  padding: 13px 0 2rem 0px;

  .icon-search {
    padding-left: 15px;
    padding-right: 15px;
    border-right: 2px solid $main-color;
  }

  & > :not(input) {
    margin-right: 10px;
  }

  .img-container {
    padding-left: 1.5rem;
    svg{
      filter: $svg-default;
    }
  }

  img {
    padding-right: 12px;
  }

  .search-divider {
    width: 2px;
    height: 23px;
    background-color: $blue-to-gray;
    margin-left: 1.4rem;
    margin-right: 1rem;
  }

  @keyframes slideText {
    0% {
      -webkit-transform: translate3d(0, 0, 0);
      transform: translate3d(0, 0, 0);
      visibility: visible;
    }

    100% {
      padding-left: 100%;
      -webkit-transform: translate3d(-100%, 0, 0);
      transform: translate3d(-100%, 0, 0);
    }
  }

  .input-container {
    position: relative;
    width: 100%;
    overflow: hidden;

    .placeholder-text {
      position: absolute;
      top: 0;
      left: 7px;
      white-space: nowrap;
      overflow: hidden;

      &.animate {
        animation: slideText 10s infinite linear;
        animation-delay: 3s;
      }

      z-index: -1;
      color: #ccc;
    }

    input {
      background: transparent;
      width: 100%;
      min-width: 300px;
      border: none;
      padding-left: 5px;
      outline: none;
      color: $black;

      &::placeholder {
        opacity: 0;
        color: $inactive-text;
      }
    }
  }

  button {
    background-color: transparent;
    border: none;
    outline: transparent;
  }

  // --- Responsive: stack children + search input vertically on small screens ---
  // Only applies to the default (multi-child, full-width) theme — the "single"
  // theme below is a fixed-size compact widget and isn't meant to stack.
  @media (max-width: 768px) {
    &:not(.single) {
      flex-direction: column;
      align-items: stretch;
      height: auto;
      padding: 13px 15px 1.25rem 15px;

      .search-bar-item {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
      }

      .input-container {
        width: 100%;
        margin-bottom: 10px;

        input {
          min-width: 0; // the 300px min-width is what forces horizontal overflow on narrow screens
        }
      }

      .search-divider {
        display: none; // a vertical divider doesn't make sense in a stacked column layout
      }
    }
  }

  &.single{
    div{
      span{
        margin-right: 10px;
      }
    }
    color:$white!important;
    width: 170px!important;
    height:37px!important;
    border-radius: 6px!important;
    border-bottom: none!important;
    background-color: $blue-to-gray!important;
    font-size: 1.4rem!important;
    padding: 12px 10px 12px 15px!important;
    & > :not(input) {
      margin-right: 0!important;
    }
    input{
      color:$white!important;
      font-size: 1.4rem!important;
      min-width:unset!important;
      padding-left: 0!important;
      border-bottom: 1px solid white;
    }
    button {
      background-color: transparent;
      border: none;
      outline: transparent;
      width: 25px!important;
      img{
        width:100% !important;
        padding-right: 0!important;
      }
    }
  }
}
