// 项目详情核心组件样式

// 阶段导航工具栏
.stage-toolbar {
  --background: white;
  --border-width: 0 0 1px 0;
  --border-color: var(--ion-color-light-shade);
  padding: 12px 0;

  .stage-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    &::-webkit-scrollbar {
      display: none;
    }

    .stage-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      cursor: pointer;
      transition: all 0.3s;
      flex-shrink: 0;
      min-width: 60px;

      .stage-circle {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        font-size: 14px;
        transition: all 0.3s;
        border: 2px solid var(--ion-color-light-shade);
        background-color: white;
        color: var(--ion-color-medium);

        ion-icon {
          font-size: 20px;
        }
      }

      .stage-label {
        font-size: 11px;
        color: var(--ion-color-medium);
        text-align: center;
        white-space: nowrap;
      }

      // 已完成状态
      &.completed {
        .stage-circle {
          background-color: var(--ion-color-success);
          border-color: var(--ion-color-success);
          color: white;
        }

        .stage-label {
          color: var(--ion-color-success);
        }
      }

      // 进行中状态
      &.active {
        .stage-circle {
          background-color: var(--ion-color-primary);
          border-color: var(--ion-color-primary);
          color: white;
          box-shadow: 0 0 0 4px rgba(var(--ion-color-primary-rgb), 0.2);
          transform: scale(1.1);
        }

        .stage-label {
          color: var(--ion-color-primary);
          font-weight: 600;
        }
      }

      // 待开始状态
      &.pending {
        .stage-circle {
          background-color: white;
          border-color: var(--ion-color-light-shade);
          color: var(--ion-color-medium);
        }
      }
    }

    .stage-connector {
      flex: 1;
      height: 2px;
      background-color: var(--ion-color-light-shade);
      margin: 0 8px;
      margin-bottom: 20px;
      transition: background-color 0.3s;
      min-width: 20px;

      &.completed {
        background-color: var(--ion-color-success);
      }
    }
  }
}

// 加载和错误容器
.loading-container,
.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 20px;
  text-align: center;

  ion-spinner {
    --color: var(--ion-color-primary);
    transform: scale(1.5);
    margin-bottom: 16px;
  }

  ion-icon {
    font-size: 64px;
    color: var(--ion-color-danger);
    margin-bottom: 16px;
  }

  p {
    color: var(--ion-color-medium);
    margin-bottom: 16px;
  }
}

// 客户快速查看
.customer-quick-view {
  padding: 12px 12px 0;

  ion-card {
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

    ion-card-content {
      padding: 12px;

      .customer-info {
        display: flex;
        align-items: center;
        gap: 12px;

        ion-avatar {
          width: 48px;
          height: 48px;
          flex-shrink: 0;

          ion-icon {
            font-size: 48px;
            color: var(--ion-color-medium);
          }
        }

        .info-text {
          flex: 1;
          min-width: 0;

          h3 {
            margin: 0 0 4px;
            font-size: 16px;
            font-weight: 600;
            color: var(--ion-color-dark);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }

          p {
            margin: 0 0 6px;
            font-size: 13px;
            color: var(--ion-color-medium);
          }

          .tags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;

            ion-badge {
              font-size: 11px;
              padding: 4px 8px;
            }
          }
        }
      }
    }
  }
}

// 阶段内容区域
.stage-content {
  padding: 12px;
  padding-bottom: 80px; // 为底部操作栏留空间
}

// 响应式适配
@media (min-width: 768px) {
  .stage-navigation {
    max-width: 600px;
    margin: 0 auto;
  }

  .customer-quick-view,
  .stage-content {
    max-width: 800px;
    margin: 0 auto;
  }
}

// 平板和桌面端
@media (min-width: 1024px) {
  .stage-navigation {
    max-width: 800px;
  }

  .customer-quick-view,
  .stage-content {
    max-width: 1000px;
  }
}
