@import '../style/theme/color';
@import '../style/theme/shadow';
@import '../style/theme/corner';
@import '../style/core/_font';

:host.devui-step-item {
  width: 400px;
  min-height: 160px;
  background: $devui-brand;
  box-shadow: $devui-shadow-length-feedback-overlay $devui-light-shadow;
  border-radius: $devui-border-radius-feedback;
  font-size: $devui-font-size;
  color: $devui-light-text;
  padding: 20px;
  position: absolute;

  .devui-title {
    font-size: $devui-font-size-page-title;
    opacity: 1;
    margin: 0 0 20px 0;
    padding: 0;
  }

  > .devui-arrow,
  > .devui-arrow::after {
    position: absolute;
    display: block;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
  }

  > .devui-arrow {
    border-width: 8px;
  }

  &.left > .devui-arrow {
    top: 23px;
    right: -6px;
    margin-top: -3px;
    border-right-width: 0;
    transform: rotate(-135deg);
    border-left-color: $devui-brand;
  }

  &.top > .devui-arrow,
  &.top-left > .devui-arrow,
  &.top-right > .devui-arrow {
    bottom: -6px;
    border-bottom-width: 0;
    border-top-color: $devui-brand;
    transform: rotate(135deg);
  }

  &.top > .devui-arrow {
    left: calc(50% - 4px);
  }

  &.top-left > .devui-arrow {
    left: 23px;
  }

  &.top-right > .devui-arrow {
    right: 23px;
    transform: rotate(-135deg);
  }

  &.right > .devui-arrow {
    top: 23px;
    left: -6px;
    margin-top: -3px;
    border-left-width: 0;
    transform: rotate(135deg);
    border-right-color: $devui-brand;
  }

  &.bottom > .devui-arrow,
  &.bottom-left > .devui-arrow,
  &.bottom-right > .devui-arrow {
    top: -6px;
    margin-left: 3px;
    border-top-width: 0;
    border-bottom-color: $devui-brand;
  }

  &.bottom > .devui-arrow {
    left: calc(50% - 4px);
    transform: rotate(-135deg);
  }

  &.bottom-right > .devui-arrow {
    right: 23px;
    transform: rotate(135deg);
  }

  &.bottom-left > .devui-arrow {
    left: 23px;
    transform: rotate(-135deg);
  }

  > .devui-shining-dot,
  .devui-shining-plus {
    position: absolute;
    background: $devui-brand;
    width: 6px;
    height: 6px;
    border-radius: $devui-border-radius-feedback;
  }

  &.left > .devui-shining-dot,
  &.left > .devui-shining-plus {
    top: 21px;
    right: -30px;
  }

  &.right > .devui-shining-dot,
  &.right > .devui-shining-plus {
    top: 21px;
    left: -30px;
  }

  &.top > .devui-shining-dot,
  &.top > .devui-shining-plus {
    left: calc(50% - 3px);
    bottom: -30px;
  }

  &.top-left > .devui-shining-dot,
  &.top-left > .devui-shining-plus {
    left: 21px;
    bottom: -30px;
  }

  &.top-right > .devui-shining-dot,
  &.top-right > .devui-shining-plus {
    right: 21px;
    bottom: -30px;
  }

  &.bottom > .devui-shining-dot,
  &.bottom > .devui-shining-plus {
    left: calc(50% - 3px);
    top: -30px;
  }

  &.bottom-right > .devui-shining-dot,
  &.bottom-right > .devui-shining-plus {
    top: -30px;
    right: 21px;
  }

  &.bottom-left > .devui-shining-dot,
  &.bottom-left > .devui-shining-plus {
    top: -30px;
    left: 21px;
  }

  .devui-shining-plus {
    animation: devui-glow 2s 0s infinite;
  }

  .devui-guide-container {
    position: relative;

    > .icon-close {
      position: absolute;
      top: 0;
      right: 0;
      cursor: pointer;
    }

    .devui-ctrl {
      display: flex;
      flex-wrap: wrap;

      .devui-dots {
        color: $devui-light-text;
        position: relative;
        top: 25px;
        font-size: $devui-font-size;
        height: 30px;

        > em {
          opacity: 0.2;
          margin: 0 5px 0 2px;

          &.devui-active {
            opacity: 1;
          }
        }
      }

      .devui-guide-btn {
        display: flex;
        flex-flow: row nowrap;
        flex-grow: 1;
        justify-content: flex-end;
        padding: 20px 0 0 0;
        white-space: nowrap;

        > div {
          color: $devui-light-text;
          background: rgba(255, 255, 255, 0.1);
          border-radius: $devui-border-radius;
          padding: 5px 15px;
          cursor: pointer;
          margin-left: 10px;

          &.devui-prev-step {
            background: none;
            border: solid 1px rgba(255, 255, 255, 0.1);
          }
        }
      }
    }
  }
}

/* 以下定义动画帧 */
@keyframes devui-glow {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }

  25% {
    transform: scale(2);
    opacity: 0.3;
  }

  50% {
    transform: scale(3);
    opacity: 0.1;
  }

  75% {
    transform: scale(2);
    opacity: 0.3;
  }

  100% {
    transform: scale(1);
    opacity: 0.5;
  }
}
