@use '@zywave/zui-base-styles/src/variables' as *;
@use '@zywave/zui-app-styles/src/shared/mixin-layout-padding' as *;

$wrapper-padding: 15px;
$wrapper-padding-bp-s: 30px;
$wrapper-padding-bp-m: 60px;

zui-step-flow {
  @include undefined-element {
    position: relative;
    display: flex;
    flex-flow: row wrap;
    align-items: stretch;
    margin: 0 auto;
    background: #f5f5f5;
    @include layout-padding;

    [slot='title'] {
      display: flex;
      width: 100%;
      min-height: 44px;
      justify-content: center;
      align-items: center;
      margin-bottom: 15px;
      font-size: rem(16);
      font-weight: 300;
      color: var(--zui-gray-800);

      @media (min-width: $bp-s) {
        margin-bottom: 30px;
      }
    }

    [slot='close'] {
      position: absolute;
      top: $wrapper-padding;
      right: calc(24px - #{$wrapper-padding});
      display: flex;
      width: 44px;
      height: 44px;
      z-index: z(default);
      justify-content: center;
      align-items: center;
      padding: 0;
      background-color: transparent;
      border: 0;
      cursor: pointer;
      color: var(--zui-gray-800);
      transition: color 250ms ease-in-out;
    }

    &[orientation='vertical'] {
      [slot='title'] {
        justify-content: flex-start;
        margin-bottom: 0;
        margin-left: calc(20% + 20px);
      }

      zui-step-flow-indicator {
        width: calc(24px + 15px);
        flex-direction: column;
        flex-grow: 0;
        justify-content: flex-start;
        align-self: flex-start;
        margin-top: 30px;
        margin-bottom: 0;
        box-sizing: border-box;

        @media (min-width: $bp-s) {
          width: 20%;
          min-width: 200px;
          margin-right: 20px;
        }
      }

      zui-step-flow-indicator-item {
        display: flex;
        flex: 0 1 auto;
        justify-content: flex-start;
        padding: 0 0 30px 34px;
        text-align: left;

        &::before {
          left: 0;
          margin-right: 10px;
          margin-bottom: 0;
        }
      }

      zui-step-flow-content {
        width: calc(80% - 20px);
      }
    }
  }
}

zui-step-flow-indicator {
  @include undefined-element {
    position: relative;
    display: flex;
    width: 100%;
    flex-direction: row;
    flex-grow: 1;
    justify-content: space-between;
    margin: 0 auto 15px;
    font-size: 0;
    color: transparent;
    transition: width 100ms ease-in-out, font-size 100ms ease-in-out, color 50ms ease-in-out, margin 100ms ease-in-out;

    @media (min-width: $bp-xs) {
      margin-bottom: 30px;
    }

    @media (min-width: $bp-s) {
      justify-content: space-around;
      box-shadow: none;
      font-size: inherit;
      color: inherit;
    }
  }

  &.hide {
    @include undefined-element {
      display: none;
    }
  }
}

zui-step-flow-indicator-item {
  @include undefined-element {
    position: relative;
    display: flex;
    flex: 1 1 0;
    justify-content: center;
    padding: 19px 0 0;
    text-align: center;
    cursor: not-allowed;
    pointer-events: none;

    &::before {
      position: absolute;
      top: 0;
      left: calc(50% - 7.5px);
      display: flex;
      content: '';
      width: 15px;
      height: 15px;
      z-index: z(default);
      flex-shrink: 0;
      justify-content: center;
      align-items: center;
      background-color: #f4f4f4;
      border: 2px solid var(--zui-gray-300);
      border-radius: 100%;

      @media (min-width: $bp-s) {
        width: 20px;
        height: 20px;
        margin-bottom: 10px;
      }
    }

    @media (min-width: $bp-s) {
      padding-top: 30px;
    }
  }
}

zui-step-flow-content {
  @include undefined-element {
    display: inline-flex;
    width: 100%;
    flex-direction: column;
    flex-grow: 1;
    margin: 0 auto;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0 1px 1px 0 #999;

    @media (min-width: $bp-s) {
      padding: 20px;
    }

    @media (min-width: $bp-m) {
      padding: 30px;
    }
  }
}

zui-step-flow-content-item {
  @include undefined-element {
    display: none;
    flex-grow: 1;

    &:first-of-type {
      display: block;
    }
  }
}

zui-step-flow-footer {
  @include undefined-element {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    margin-top: 20px;

    zui-button + zui-button {
      margin-left: 10px;
    }

    @media (min-width: $bp-m) {
      margin-top: 40px;
    }

    @media (min-width: $bp-l) {
      margin-top: 60px;
    }
  }
}
