// wrapper
.yc-textarea-wrapper {
  overflow: hidden;
  position: relative;
  cursor: text;
  width: 100%;
  height: fit-content;
  background-color: var(--color-fill-2);
  border: 1px solid transparent;
  border-radius: var(--border-radius-small);
  color: var(--color-text-1);
  font-size: 14px;
  font-weight: 400;
  display: inline-flex;
  align-items: center;
  transition:
    color 0.1s cubic-bezier(0, 0, 1, 1),
    border-color 0.1s cubic-bezier(0, 0, 1, 1),
    background-color 0.1s cubic-bezier(0, 0, 1, 1);
  &:not(.yc-textarea-disabled) {
    &:hover {
      background-color: var(--color-fill-3);
      border-color: transparent;
    }
    &:hover .yc-textarea-clear-button {
      visibility: visible;
    }
    &:focus-within {
      background-color: var(--color-bg-1);
      border-color: rgb(var(--primary-6));
      box-shadow: 0 0 0 0 var(--color-primary-light-2);
    }
  }

  .yc-textarea-word-limit {
    position: absolute;
    right: 10px;
    bottom: 6px;
    user-select: none;
    color: var(--color-text-3);
    font-size: 12px;
  }
  .yc-textarea-clear-button {
    visibility: hidden;
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
  }
  .yc-textarea,
  .yc-textarea-mirror {
    display: block;
    width: 100%;
    padding: 4px 12px;
    min-height: 32px;
    color: inherit;
    outline: none;
    background-color: transparent;
    border-width: 0;
    border-radius: var(--border-radius-none);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5715;
    font-variant: normal;
    letter-spacing: normal;
    text-indent: 0;
    text-rendering: auto;
    text-transform: none;
    white-space: pre-wrap;
    overflow-wrap: break-word;
  }
  .yc-textarea {
    resize: vertical;
    &::placeholder {
      color: var(--color-text-3);
    }
  }
  .yc-textarea-mirror {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
  }
}
// auto-size
.yc-textarea-auto-size {
  .yc-textarea {
    resize: none;
  }
}
// error
.yc-textarea-error {
  background-color: var(--color-danger-light-1);
  &:not(.yc-textarea-disabled) {
    &:hover {
      background-color: var(--color-danger-light-2);
      border-color: transparent;
    }
    &:focus-within {
      background-color: var(--color-bg-1);
      border-color: rgb(var(--danger-6));
      box-shadow: 0 0 0 0 var(--color-danger-light-2);
    }
  }
}
// disabled
.yc-textarea-disabled {
  cursor: not-allowed;
  .yc-textarea {
    cursor: not-allowed;
  }
  background-color: var(--color-fill-2);
  border-color: transparent;
  color: var(--color-text-4);
  -webkit-text-fill-color: var(--color-text-4);
}
