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

.#{$component} {
  position: relative;
  display: inline-block;
  width: 100%;
  .input-element {
    width: 100%;
    padding: 0 10px;
    color: $content-color-light;
    border: 1px solid $border-color-base;
    border-radius: 4px;
    box-sizing: border-box;
    transition: border $transition-time, box-shadow $transition-time;
    &::placeholder {
      color: $sub-text-color-light;
    }
    &:hover {
      border-color: $primary-color;
    }
    &:focus {
      outline: none;
    }
    &.active {
      border-color: $primary-color;
      box-shadow: 0 0 0 2px lighten($primary-color, 40);
    }
    &.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 {
      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;
      box-shadow: none;
    }
    &.input-textarea {
      padding: 6px 10px;
      font-size: 14px;
      line-height: normal;
    }
  }
  .no-border-shadow {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 2px;
    background: lighten($primary-color, 40);
  }
  .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;
    }
  }
}
