@use "_theme.scss";

.draft-search-bar {
  display: flex;
  position: relative;
  width: 300px;

  @media (max-width: theme.$sm) {
    width: 100%;
  }

  .draft-search-input {
    height: 40px;
    width: 100%;
    padding: 0 20px;
    padding-right: 90px;
    font-size: var(--text-size-regular);
    color: var(--text-color-dark);
    border: 1px solid var(--color-line);
    border-top-left-radius: var(--button-border-radius);
    border-bottom-left-radius: var(--button-border-radius);
    border-right: none;
    outline: none;
    transition: border-color 0.2s ease;

    &:focus {
      border-color: var(--color-highlight, var(--color-line));
    }

    &::placeholder {
      color: var(--text-color-medium);
      font-size: var(--text-size-regular);
      opacity: 1;
      transition: opacity 0.2s ease;
    }

    &:focus::placeholder {
      opacity: 0;
    }
  }

  .draft-search-clear {
    position: absolute;
    right: 50px;
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding-right: 12px;

    &:hover {
      opacity: 0.7;
    }
  }

  .draft-search-button {
    position: absolute;
    right: 0;
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-primary-background-color);
    border: none;
    border-top-right-radius: var(--button-border-radius);
    border-bottom-right-radius: var(--button-border-radius);
    cursor: pointer;

    &:hover {
      background: var(--button-primary-hover-background-color, var(--button-primary-background-color));
    }

    .icon {
      path {
        fill: var(--button-primary-text-color);
      }
    }
  }
}
