@import '../icon/icon.scss';

.nut-theme-dark {
  .nut-step {
    &.nut-step-wait {
      .nut-step-main {
        .nut-step-title {
          color: $dark2;
        }

        .nut-step-content {
          color: $dark2;
        }
      }

      .nut-step-head {
        color: $dark2;
      }

      .nut-step-icon.is-text {
        background-color: $dark5;
      }

      .nut-step-icon.is-icon {
        background-color: $dark5;

        .nut-icon {
          color: $dark2;
        }
      }

      .nut-step-content {
        color: $dark2;
      }
    }
  }

  .nut-step-process,
  .nut-step-finish {
    .nut-step-main {
      .nut-step-content {
        color: $dark1;
      }
    }
  }
}

.nut-step {
  flex-grow: 0;
  flex-shrink: 0;
  flex: 1;
  text-align: center;
  font-size: 0;

  &-head {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: $steps-base-icon-margin-bottom;
  }

  // 计算方法：left = calc(50% + (100% - $steps-base-line-width) / 2)
  // 如 width=70%时，left=65%; width=100%,left=50%;
  &-line {
    position: absolute;
    top: calc($steps-base-icon-height / 2);
    left: calc(50% + (100% - $steps-base-line-width) / 2);
    // right: calc(0 - $steps-base-line-width / 2);
    height: $steps-base-line-height;
    width: $steps-base-line-width;
    background: $steps-base-line-background;
  }

  &-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: $steps-base-icon-width;
    height: $steps-base-icon-height;
    line-height: $steps-base-icon-line-height;
    font-size: $steps-base-icon-font-size;
    background-color: $steps-wait-icon-bg-color;
    border-color: $steps-wait-icon-bg-color;
    color: $steps-wait-icon-color;
    z-index: 1;

    .nut-icon {
      width: 100%;
      height: 100%;
    }

    &.is-text {
      border-radius: 50%;
      border-width: 1px;
      border-style: solid;
    }

    &.is-icon {
      border-radius: 50%;
      border-width: 1px;
      border-style: solid;
    }
  }

  &-main {
    display: inline-block;
    padding-left: 10%;
    padding-right: 10%;
    text-align: center;

    .nut-step-content {
      color: $title-color;
    }
  }

  &-title {
    display: block;
    margin-bottom: $steps-base-title-margin-bottom;
    font-size: $steps-base-title-font-size;
    color: $steps-base-title-color;
  }

  &-content {
    display: block;
    font-size: $steps-base-content-font-size;
    color: $steps-base-content-color;
  }

  &:last-child {
    .nut-step-line {
      display: none;
    }
  }

  &.nut-step-process {
    .nut-step-icon {
      background-color: $steps-process-icon-bg-color;
      border-color: $steps-process-icon-bg-color;
      color: $steps-process-icon-color;
    }

    .nut-step-title {
      color: $steps-process-title-color;
      font-size: $steps-process-title-font-size;
      font-weight: $steps-process-title-font-weight;
    }

    .nut-step-content {
      // color: $steps-process-title-color;
    }
  }

  &.nut-step-wait {
    .nut-step-title {
      color: $steps-wait-title-color;
    }

    .nut-step-content {
      color: $steps-wait-content-color;
    }
  }

  &.nut-step-finish {
    .nut-step-icon {
      background-color: $steps-finish-icon-bg-color;
      border-color: $steps-finish-icon-color;
      color: $steps-finish-icon-color;
    }

    .nut-step-line {
      background: $steps-finish-line-background;
    }

    .nut-step-title {
      color: $steps-finish-title-color;
    }

    .nut-step-content {
      // color: $steps-finish-content-color;
    }
  }
}

.nut-steps-dot {
  .nut-step-head {
    margin-top: 7px;
    margin-bottom: 0;
  }

  .nut-step-line {
    top: 7px;
  }

  .nut-step-icon {
    width: $steps-dot-icon-width;
    height: $steps-dot-icon-height;
    border: $steps-dot-icon-border;
    border-radius: 50%;
    box-sizing: content-box;
  }

  .nut-step-wait {
    .nut-step-title {
      color: $steps-wait-title-color;
    }

    .nut-step-content {
      color: $steps-wait-content-color;
    }
  }

  .nut-step-finish {
    .nut-step-icon {
      background-color: $steps-finish-icon-bg-color;
      border-color: $steps-finish-icon-color;
    }
  }

  .nut-step-process {
    .nut-step-icon {
      position: relative;
      background-color: $steps-process-icon-bg-color;

      &:before {
        content: '';
        display: inline-block;
        position: absolute;
        left: 50%;
        top: 50%;
        margin-left: -7px;
        margin-top: -7px;
        width: 14px;
        height: 14px;
        background-color: $primary-color-end;
        border-radius: 50%;
        opacity: 0.23;
      }
    }
  }
}

.nut-steps-horizontal {
  &.nut-steps-dot {
    .nut-step-line {
      top: 50%;
      bottom: -50%;
    }
  }
}

.nut-steps-vertical {
  .nut-step {
    display: flex;
    height: 33.34%;
  }

  .nut-step-line {
    position: absolute;
    display: inline-block;
    width: 1px;
    height: 100%;
    background: #909ca4;
  }

  .nut-step-main {
    display: inline-block;
    padding-left: 6%;
    text-align: left;

    .nut-step-content {
      color: $steps-base-content-color;
    }
  }
}
