$component: $lib-name + "-input";

.#{$component} {
  position: relative;
  display: inline-block;
  width: 100%;
  .input-element {
    width: 100%;
    padding: 0 10px;
    color: $title-color-light;
    border: 1px solid $border-color-base;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border $transition-time;
    &::placeholder {
      color: $placeholder-text-color;
    }
    &:hover {
      border-color: $primary-color;
    }
    &:focus {
      outline: none;
    }
    &.active {
      border-color: $primary-color;
    }
    &.disabled {
      color: $sub-text-color-light;
      border-color: $border-color-base;
      cursor: not-allowed;
      background: $background-color-disabled;
    }
    &.prefix {
      padding-left: 34px;
    }
    &.suffix {
      padding-right: 34px;
    }
    &.no-border {
      padding-left: 0;
      border-top-color: transparent;
      border-left-color: transparent;
      border-right-color: transparent;
      &:hover,
      &.active {
        border-top-color: transparent;
        border-left-color: transparent;
        border-right-color: transparent;
      }
      border-radius: 0;
    }
    &.circle {
      border-radius: 20px;
    }
    &.input-textarea {
      padding: 6px 10px;
      font-size: 14px;
      line-height: normal;
    }
  }
  .prefix-area,
  .suffix-area {
    position: absolute;
    z-index: 1;
    line-height: 1;
    color: $sub-text-color-light;
    .icon.close:hover {
      color: $primary-color;
      cursor: pointer;
    }
  }
  .prepend-area,
  .append-area {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    border: 1px solid $border-color-base;
    border-radius: 4px;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .prepend-area {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .append-area {
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  &.#{$component}--large {
    font-size: 14px;
    .input-element,
    .prepend-area,
    .append-area {
      height: 40px;
      line-height: 40px;
    }
    .prefix-area,
    .suffix-area {
      top: 13px;
      .icon {
        font-size: 16px;
      }
    }
  }
  &.#{$component}--default {
    font-size: 14px;
    .input-element,
    .prepend-area,
    .append-area {
      height: 32px;
      line-height: 32px;
    }
    .prefix-area,
    .suffix-area {
      top: 9px;
      .icon {
        font-size: 14px;
      }
    }
  }
  &.#{$component}--small {
    font-size: 12px;
    .input-element,
    .prepend-area,
    .append-area {
      height: 28px;
      line-height: 28px;
    }
    .prefix-area,
    .suffix-area {
      top: 7px;
      .icon {
        font-size: 12px;
      }
    }
  }
  &.#{$component}--prepend,
  &.#{$component}--append {
    display: flex;
  }
  &.#{$component}--prepend {
    .input-element {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
  &.#{$component}--append {
    .input-element {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
  }
  .fail-color {
    color: $error-color;
  }
  .success-color {
    color: $success-color;
  }
}
