src/components/SearchOverlay/SearchOverlay.scss
@import '../../constants/styles';
@import '../../constants/overlay';

.SearchOverlay {
  position: static;
  display: flex;
  flex-direction: column;
  padding-inline-end: 8px;
  flex-wrap: nowrap;
  border: 0px;
  border-radius: 0px;
  background: transparent;
  visibility: visible !important;
  flex-grow: 0;

  .search-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .search-options-button {
    height: 32px;
    width: 32px;

    .Icon {
      width: 24px;
      height: 24px;

      svg {
        width: 24px;
        height: 24px;

        .dot {
          fill: var(--blue-5);
        }

        .filter {
          fill: var(--gray-6);
        }
      }
    }
  }

  .replace-icon {
    .Icon {
      svg {
        fill: var(--gray-6);
        color: var(--gray-6)
      }
    }
    margin: 0 8px 0 0;
  }

  .input-container {
    display: flex;
    position: relative;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--text-color);
    padding: 4px 8px;
    background: var(--component-background);
    flex: 1;

    &.with-replace-icon {
      justify-content: flex-start;
    }

    input {
      width: 100%;
      padding-inline-end: 26px;
      height: 24px;
      border: none;
      background: transparent;
      padding: 0;

      @include mobile {
        font-size: 13px;
      }
    }

    &.with-replace-icon input {
      padding-inline-end: 0;
    }

    input::placeholder {
      color: var(--placeholder-text);
    }

    .Icon {
      width: 16px;
      height: 16px;
    }

    .clearSearch-button {
      @include button-reset;
      cursor: pointer;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      width: 24px;
      height: 24px;

      svg {
        color: var(--gray-7);
      }
      &:hover {
        background: var(--blue-1);
      }
    }
  }

  .search-option-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .divider {
    height: 1px;
    width: 100%;
    background: var(--divider);
    margin: 16px 0px;
  }

  .options {
    display: flex;
    flex-wrap: wrap;
    margin-top: 8px;

    // toolkit choice component
    > span {
      margin-inline-end: 16px;
      // label of toolkit choice component
      > label {
        white-space: nowrap;
        @include mobile {
          font-size: 13px;
        }
      }
    }
  }

  .replace-options {
    margin-top: 8px;
    
    .replace-buttons {
      display: flex;
      flex-direction: row;
      justify-content: flex-end;
      padding-top: 10px;
      .spinner {
        margin: 0;
        position: absolute;
        inset-inline-start: 30px;
      }
      .btn-replace {
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: var(--blue-5);
        border: 1px solid var(--blue-5);
        color: var(--gray-0);
        padding: 6px 18px;
        width: auto;
        width: -webkit-fit-content;
        width: -moz-fit-content;
        width: fit-content;
        border-radius: 4px;
        height: 32px;
        cursor: pointer;
        @include mobile {
          font-size: 13px;
        }
      }

      .btn-replace-all {
        display: flex;
        justify-content: center;
        align-items: center;
        color: var(--blue-5);
        padding: 6px 18px;
        width: auto;
        width: -webkit-fit-content;
        width: -moz-fit-content;
        width: fit-content;
        height: 32px;
        cursor: pointer;
        margin-inline-end: 5px;

        &:hover:not(:disabled) {
          color: var(--blue-6);
        }
        @include mobile {
          font-size: 13px;
        }
      }

      button {
        &:disabled {
          opacity: 0.5;
          cursor: default;
        }
      }
    }
  }

  .footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--faded-text);
    margin-bottom: 16px;

    .spinner {
      height: 25px !important;
      width: 25px !important;
      margin: 0px;
    }

    .buttons {
      display: flex;
      flex-direction: row;
      align-self: flex-end;
      justify-content: space-evenly;
      margin-inline-start: auto;
      width: 64px;
      height: 28px;

      .button {
        @include button-reset;
        width: 28px;
        height: 28px;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;

        svg {
          color: var(--gray-6);
        }

        &:hover {
          background-color: var(--blue-1);
        }
      }

      .arrow {
        width: 18px;
        height: 18px;
      }
    }
  }

  &.modular-ui {
    .replace-buttons {
      .btn-replace {
        &:hover:not(:disabled) {
          @extend %default-button-hover;
        }
      }
      .btn-replace-all {
        &:hover:not(:disabled) {
          @extend %tertiary-button-hover;
        }
      }
    }

    .footer .buttons {
      .button {
        &:hover {
          @extend %icon-button-hover;
        }
      }
    }

    .input-container {
      &:focus-within {
        outline: none;
        border: 1px solid var(--focus-border);
      }

      .clearSearch-button {
        &:hover {
          @extend %icon-button-hover;
        }
      }

      .search-panel-input {
        padding-inline-start: 8px;

        @include mobile {
          font-size: 13px;
        }
      }
    }
  }
}
