/**
 * PisellSingleSelect 组件样式
 * 基于 Figma 设计规范，覆盖时使用 pisell-lowcode-xxx
 */

.pisell-single-select {
  width: 100%;

  &.pisell-lowcode-select-focused .pisell-lowcode-select-selector {
    border-color: #d6bbfb !important;
    box-shadow: 0 0 0 4px #F4EBFF, 0 1px 2px rgba(16, 24, 40, 0.05) !important;
  }

  .pisell-lowcode-select-clear {
    color: #667085;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: -22px -8px;
    padding: 10px 8px;

    &:hover {
      color: #344054;
    }
  }

  &-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
  }

  &-label {
    font-size: 14px;
    font-weight: 600;
    color: #344054; // Gray/700
    line-height: 20px;

    &-required::after {
      content: ' *';
      color: #d92d20; // Error/600
      margin-left: 0;
    }
  }

  &-helper-text {
    font-size: 14px;
    font-weight: 400;
    color: #667085; // Gray/500
    line-height: 20px;
  }

  &-error-text {
    font-size: 12px;
    font-weight: 400;
    color: #d92d20; // Error/600
    line-height: 1.5;
    animation: pisell-single-select-fadeIn 0.3s ease-in-out;
  }

  // 错误状态（Figma 设计体系 Error 色）
  &-error {
    .pisell-lowcode-select .pisell-lowcode-select-selector {
      border-color: #fda29b !important; // Error/300

      &:hover {
        border-color: #f97066 !important; // Error/400
      }
    }
  }

  // 只读状态：仅展示 Tag，无 Select 无外框，Tag 使用与 disabled 一致的样式
  &-readonly {
    &-display {
      display: flex;
      align-items: center;
      gap: 8px;
      min-height: 24px;
    }

    &-tag {
      margin: 0;
      cursor: default;
      border-radius: 12px;
      border: 1px solid transparent;
      font-size: 14px;
      line-height: 22px;
      padding: 2px 10px;
    }

    &-icon {
      display: flex;
      align-items: center;
    }

    &-empty {
      color: #667085;
      font-weight: 400;
    }
  }
}

@keyframes pisell-single-select-fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
