@import "../../styles/variables";

$novo-horizontal-stepper-header-height: 80px !default;
$novo-stepper-label-header-height: 24px !default;
$novo-stepper-label-min-width: 50px !default;
$novo-stepper-side-gap: 24px !default;
$novo-vertical-stepper-content-margin: 36px !default;
$novo-stepper-line-gap: 8px !default;
$novo-step-optional-font-size: 12px;
$novo-step-header-icon-size: 1em !default;

:host {
  overflow: visible;
  outline: none;
  cursor: pointer;
  position: relative;

  .novo-step-optional {
    font-size: $novo-step-optional-font-size;
  }

  .novo-step-icon,
  .novo-step-icon-not-touched {
    border-radius: 50%;
    height: $novo-stepper-label-header-height;
    width: $novo-stepper-label-header-height;
    align-items: center;
    justify-content: center;
    display: flex;

    .novo-step-number {
      font-size: $novo-step-header-icon-size;
      min-width: 1.6em;
      height: 1.6em;
      box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
    }
  }

  .novo-step-icon {
    .novo-step-number {
      background: $positive;
      color: $white;
    }
  }
  .novo-step-icon-not-touched {
    .novo-step-number {
      background: $submission;
      color: $white;
    }
  }

  .novo-step-label {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: $novo-stepper-label-min-width;
    vertical-align: middle;
    text-align: center;
    padding: 4px 0px;
  }

  .novo-step-text-label {
    text-align: center;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  &.novo-vertical-stepper-header {
    display: flex;
    align-items: center;
    padding: $novo-stepper-side-gap;
    max-height: $novo-stepper-label-header-height;

    .novo-step-icon,
    .novo-step-icon-not-touched {
      margin-right: $novo-vertical-stepper-content-margin - $novo-stepper-side-gap;

      [dir="rtl"] & {
        margin-right: 0;
        margin-left: $novo-vertical-stepper-content-margin - $novo-stepper-side-gap;
      }
    }
    novo-step-status {
      position: absolute;
      left: 35px;
      top: 25px;
      transform: scale(0.8);
    }
  }

  &.novo-horizontal-stepper-header {
    display: flex;
    height: $novo-horizontal-stepper-header-height;
    flex-flow: column;
    overflow: visible;
    align-items: center;
    justify-content: center;
    padding: 0 $novo-stepper-side-gap;

    ::ng-deep .novo-step-status {
      display: flex;
      width: 100%;
      justify-content: center;
      align-items: center;
      position: absolute;
      height: 1px;
      bottom: 0px;

      .novo-stepper-status-line {
        width: 100%;
        position: absolute;
        &:before {
          content: "";
          display: block;
          width: calc(50% - 8px);
          margin-right: 8px;
          border-bottom: 1px solid $light;
        }
        &:after {
          content: "";
          display: block;
          width: calc(50% - 8px);
          margin-left: calc(50% + 8px);
          margin-top: -1px;
          border-top: 1px solid $light;
        }
        &.edit {
          &:before {
            border-bottom: 1px solid $positive;
          }
        }
        &.done {
          &:before {
            border-bottom: 1px solid $positive;
          }
          &:after {
            border-top: 1px solid $positive;
          }
        }
      }
      .novo-stepper-status-icon {
        position: relative;
        &:before {
          content: "";
          display: block;
          background: $white;
          border-radius: 50%;
          position: absolute;
          z-index: 0;
          top: 1px;
          left: 1px;
          bottom: 1px;
          right: 1px;
        }
        & > * {
          position: relative;
          z-index: z(default);
        }
      }
    }
  }
}
