// PisellSteps 组件样式
// 基于 Ant Design Steps 进行样式扩展和定制

@pisell-steps-prefix: pisell-steps;

// ============ CSS 变量定义 ============
.@{pisell-steps-prefix} {
  // 间距相关
  --pisell-steps-item-gap: 8px;
  --pisell-steps-margin: 16px;

  // 栅格布局
  --pisell-steps-grid-columns: 3;

  // 颜色变量
  --pisell-steps-primary-color: #7f56d9;
  --pisell-steps-primary-light: #f4ebff;
  --pisell-steps-text-color: rgba(0, 0, 0, 0.88);
  --pisell-steps-text-secondary: rgba(0, 0, 0, 0.45);
  --pisell-steps-border-color: rgba(0, 0, 0, 0.06);
  --pisell-steps-error-color: #ff4d4f;
  --pisell-steps-success-color: #52c41a;
}

// ============ 基础样式 ============
.@{pisell-steps-prefix} {
  position: relative;
  width: 100%;

  // 默认尺寸（32px）- 当没有设置 size 或 size='default' 时
  .ant-steps-item-icon {
    width: 32px;
    height: 32px;
    line-height: 32px;
  }

  // 覆盖 Ant Design 默认样式，使用自定义主题色
  .ant-steps-item-finish {
    .ant-steps-item-icon {
      background-color: var(--pisell-steps-primary-light);
      border-color: var(--pisell-steps-primary-light);

      > .ant-steps-icon {
        color: var(--pisell-steps-primary-color);
      }
    }

    .ant-steps-item-tail::after {
      background-color: var(--pisell-steps-primary-color);
    }
  }

  .ant-steps-item-process {
    .ant-steps-item-icon {
      background-color: var(--pisell-steps-primary-color);
      border-color: var(--pisell-steps-primary-color);

      > .ant-steps-icon {
        color: #ffffff;
      }
    }
  }

  .ant-steps-item-wait {
    .ant-steps-item-icon {
      background-color: var(--pisell-steps-border-color);
      border-color: var(--pisell-steps-border-color);

      > .ant-steps-icon {
        color: var(--pisell-steps-text-secondary);
      }
    }
  }

  .ant-steps-item-error {
    .ant-steps-item-icon {
      background-color: var(--pisell-steps-error-color);
      border-color: var(--pisell-steps-error-color);

      > .ant-steps-icon {
        color: #ffffff;
      }
    }
  }
}

// ============ 可点击样式 ============
.@{pisell-steps-prefix}-clickable {
  .ant-steps-item,
  .pisell-lowcode-steps-item {
    cursor: pointer;
    transition: all 0.3s ease;

    &:hover {
      .ant-steps-item-icon {
        transform: scale(1.1);
      }
    }

    &-finish {
      &:hover {
        .ant-steps-item-title {
          color: var(--pisell-steps-primary-color);
        }
      }
    }
  }
}

// ============ 尺寸变体 ============
.@{pisell-steps-prefix}-small {
  .ant-steps-item-icon {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
  }

  .ant-steps-item-title {
    font-size: 14px;
  }

  .ant-steps-item-description {
    font-size: 14px;
  }
}

.@{pisell-steps-prefix}-large {
  .ant-steps-item-icon,
  .pisell-lowcode-steps-item-icon {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 16px !important;
  }

  .ant-steps-item-title,
  .pisell-lowcode-steps-item-title {
    font-size: 16px;
  }

  .ant-steps-item-description,
  .pisell-lowcode-steps-item-description {
    font-size: 16px;
  }
}

// ============ 类型变体 ============
// Dot 类型
.@{pisell-steps-prefix}-dot {
  .ant-steps-item-icon {
    width: 8px;
    height: 8px;

    .ant-steps-icon-dot {
      width: 8px;
      height: 8px;
    }
  }
}

// Navigation 类型
.@{pisell-steps-prefix}-navigation {
  .ant-steps-item {
    padding: 12px 24px;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      right: -12px;
      width: 0;
      height: 0;
      border-top: 24px solid transparent;
      border-bottom: 24px solid transparent;
      border-left: 12px solid var(--pisell-steps-border-color);
      z-index: 1;
    }
  }
}

// ============ 响应式样式 ============
.@{pisell-steps-prefix}-responsive {
  @media (max-width: 768px) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    .ant-steps {
      min-width: max-content;
    }

    .ant-steps-item {
      min-width: 120px;
      flex-shrink: 0;
    }
  }

  @media (max-width: 480px) {
    .ant-steps-item {
      min-width: 100px;

      .ant-steps-item-title {
        font-size: 12px;
      }

      .ant-steps-item-description {
        display: none;
      }

      .ant-steps-item-icon {
        width: 24px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
      }
    }
  }
}

// ============ 栅格布局 ============
.@{pisell-steps-prefix}-grid-layout {
  .ant-steps {
    display: grid;
    grid-template-columns: repeat(var(--pisell-steps-grid-columns), 1fr);
    gap: var(--pisell-steps-margin);
  }
}

// 连接器位置样式已移除

// ============ 标识区和文本区间距 =============
// 控制图标和文本之间的间距
// 只有当设置了 itemGap 时才应用自定义间距，否则保持 antd 原样式
.@{pisell-steps-prefix}-has-item-gap {
  // 垂直布局时（labelPlacement='vertical'），控制内容区域的上边距
  .ant-steps-label-vertical {
    .ant-steps-item-content {
      margin-top: var(--pisell-steps-item-gap);
    }
  }

  // 水平布局时（labelPlacement='horizontal'），控制图标右侧的间距
  .ant-steps-item {
    .ant-steps-item-icon {
      margin-right: var(--pisell-steps-item-gap) !important;
    }
  }

  // 低代码平台中的样式支持 - 水平布局
  .pisell-lowcode-steps-item-icon {
    margin-right: var(--pisell-steps-item-gap) !important;
  }

  // 低代码平台垂直布局 - 设置内容区域的上边距
  &.pisell-lowcode-steps-label-vertical,
  .pisell-lowcode-steps-label-vertical {
    .pisell-lowcode-steps-item-content {
      margin-top: var(--pisell-steps-item-gap);
    }
  }
}

// 动画效果样式已移除

// ============ 进度百分比显示 ============
// 进度百分比样式已移除，直接使用 antd Steps 的默认进度条样式

// ============ 竖向布局特殊样式 ============
.@{pisell-steps-prefix}-vertical {
  .ant-steps-item {
    padding-bottom: var(--pisell-steps-margin);

    &:last-child {
      padding-bottom: 0;
    }
  }
}

// ============ 自定义图标尺寸 ============
// ============ 禁用状态 ============
.@{pisell-steps-prefix} {
  .ant-steps-item-disabled {
    cursor: not-allowed;
    opacity: 0.5;

    &:hover {
      .ant-steps-item-icon {
        transform: none;
      }
    }
  }
}

// ============ 移动端当前步骤视图 ============
.@{pisell-steps-prefix}-mobile-current {
  display: flex;
  align-items: center;
  justify-content: flex-start;

  &__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
  }

  &__number {
    font-size: 14px;
    color: black;
    line-height: 20px;
  }

  &__title {
    color: black;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
  }
}

// ============ 滚动模式样式 ============
.@{pisell-steps-prefix}-scroll-view {
  width: 100%;
  position: relative;

  // 滚动内容容器
  .@{pisell-steps-prefix}-scroll-content {
    display: inline-flex;
    min-width: max-content;
  }
}
