$primary-color: #FE7300 !default;
$target-hover-bg: #f38d30 !default;
$target-active-bg: #ea6c2d !default;
$green: #43C816 !default;
$gray: #E6E7E9 !default;
$popup-bg: #2D3644 !default;
$webpack-output-path: "/webpacks/gitee-intro/";

@function assets-url($path) {
  @return url($webpack-output-path + $path);
}

.gitee-intro {
  position: relative;
  overflow: hidden;
}

.gitee-intro__overlay {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  position: absolute;
}

.gitee-intro__hole {
  z-index: 10000;
  position: absolute;
  border-radius: 4px;
  box-shadow: 0 0 0 10000px rgba(16, 21, 39, 0.6);
}

.gitee-intro__target-cover {
  z-index: 10002;
  position: absolute;
}

.gitee-intro__modal {
  .ui.modal {
    max-width: 880px;
    border-radius:6px;

    > .content {
      padding: 24px 32px;
    }

    .content > .header {
      font-weight: 500;
      font-size: 24px;
      text-align: center;;
    }

    .ui.image {
      flex: 1;
      min-height: 290px;

      img {
        width: 100%;
      }
    }

    .box {
      display: flex;
      padding: 32px;
      background: rgba(241,241,241,1);
    }

    .description {
      flex-shrink: 0;
      width: 280px;
    }

    .actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 32px 24px 32px;
    }

    .btn-skip {
      margin-right: auto !important;
    }

    .btn-prev {
      margin-right: 0 !important;
      margin-left: auto !important;
    }
  }

  ul {
    padding-left: 1.5rem;
    margin-top: 24px;
  }

  li {
    list-style-type: disc;
    margin-bottom: 8px;
  }

  .ui.large.button {
    font-size: 16px;
    padding: 8px 24px;
    border: 1px solid $primary-color;
  }
}

.gitee-intro__guide-modal {
  .ui.modal {
    .btn-skip {
      margin-left: 16px;
      margin-right: 0 !important;

      &:first-child {
        margin-left: auto;
      }
    }

    .btn-next {
      margin-left: auto !important;
    }

    .ui.image {
      min-height: 380px;
    }
  }

  .summary {
    font-size: 16px;
    margin-bottom: 24px;
  }
}

.gitee-intro__steps-modal {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: static;

  .features {
    li {
      margin-bottom: 16px;
      list-style-type: disc;
      cursor: pointer;

      &.active {
        color: $primary-color;

        a {
          color: $primary-color;
        }
      }
    }
  }
  img.feature-img {
    display: none;;

    &.active {
      display: block;
    }
  }
}

.gitee-intro__steps-modal-content {
  display: none;

  &.active {
    display: block;
  }

  > .content {
    display: flex;
  }

  > .actions {
    padding: 24px 0 0 0 !important;
  }

  .ui.image {
    width: 580px;
    flex-shrink: 0;
    min-height: 300px;
  }

  .description {
    padding: 12px 0 0 32px;
  }

  .header {
    font-size:24px;
    font-weight:500;
    margin-bottom: 10px;;
  }
}

.gitee-intro__steps-modal-progress {
  display: flex;
  position: relative;
  justify-content: space-between;
  margin-bottom: 32px;

  .divider {
    left: 0;
    top: 50%;
    width: 100%;
    margin-top: -1px;
    position: absolute;
    border-bottom: 2px solid $gray;

    &.completed {
      border-color: $green;
    }
  }
  .step {
    width: 24px;
    height: 24px;
    border: 3px solid $gray;
    display: inline-block;
    border-radius: 50%;
    background: #fff;
    position: relative;
    z-index: 1;

    &::after {
      content: ' ';
      width: 6px;
      height: 6px;
      top: 50%;
      left: 50%;
      margin-top: -3px;
      margin-left: -3px;
      position: absolute;
      background: $gray;
      border-radius: 50%;
    }

    &.completed {
      border-color: $green;
      background: $green;

      &::after {
        content: "\f00c";
        color: #fff;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        margin: 0;
        font-family: Icons;
        text-align: center;
        background: transparent;
      }
    }

    &.current {
      border-color: $primary-color;

      &::after {
        background: $primary-color;
      }
    }
  }
}

.gitee-intro__popup.ui.popup {
  color: #fff;
  font-size: 16px;
  padding: 12px 16px;
  background: $popup-bg;

  &::before {
    background: $popup-bg;
  }
}

.gitee-intro__intro {
  position: absolute;
  display: none;
  background: #fff;
  padding: 20px 24px;
  box-shadow:0px 10px 15px 0px rgba(0,0,0,0.04),0px 7px 14px 0px rgba(0,0,0,0.08),0px 3px 12px 0px rgba(0,0,0,0.06);
  border:1px solid rgba(227,233,237,1);
  border-radius:6px;

  .footer {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .content {
    min-width: 150px;
    max-width: 320px;;
  }

  .status {
    color: #C9C9C9;
  }
}

.gitee-intro--clickable {
  .gitee-intro__target-cover {
    cursor: pointer;
  }
}

.gitee-intro--no-hole {
  .gitee-intro__overlay {
    background: rgba(16, 21, 39, 0.6);
  }

  .gitee-intro__hole,
  .gitee-intro__target-cover {
    display: none;;
  }

  .gitee-intro__modal {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
  }
}

// 自定义

.dashboard-welcome-modal {
  .box {
    padding: 0 !important;
  }
}

@keyframes gitee-intro-target-blink {
  0% {
    background: transparent;
  }
  50% {
    background: $primary-color;
  }
  100% {
    background: transparent;
  }
}

.gitee-intro__target {
  &.view-sidebar-toggle {
    position: relative;

    &::after {
      top: 6px;
      left: 15px;
      content: '';
      background: $primary-color;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      z-index: 0;
      position: absolute;
      animation: gitee-intro-target-blink 0.6s infinite;
    }

    i {
      z-index: 1;
      position: relative;
    }

    &.gitee-intro__target--hover {
      &::after {
        animation: none;
        background: $target-hover-bg;
      }
    }

    &.gitee-intro__target--active {
      &::after {
        animation: none;
        background: $target-active-bg;
      }
    }
  }
}

.ent-view-sidebar .program-list .item.gitee-intro__target {
  background: $primary-color;
  animation: gitee-intro-target-blink 0.6s infinite;

  &.gitee-intro__target--hover {
    animation: none;
    background: $target-hover-bg;
  }

  &.gitee-intro__target--active {
    animation: none;
    background: $target-active-bg;
  }
}

.attach-arrow-right::after {
  content: '';
  top: -55px;
  left: -100px;
  width: 108px;
  height: 100px;;
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: assets-url("arrow-right.svg");
}

.attach-arrow-left-top::after {
  content: '';
  top: -97px;
  left: -71px;
  width: 91px;
  height: 117px;;
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: assets-url("arrow-left-top.svg");
}

.attach-arrow-left-bottom:after {
  content: '';
  bottom: -97px;
  left: -71px;
  width: 91px;
  height: 117px;;
  position: absolute;
  transform: rotateX(180deg);
  background-size: contain;
  background-repeat: no-repeat;
  background-image: assets-url("arrow-left-top.svg");
}

.attach-arrow-left::after {
  content: '';
  top: -55px;
  right: -100px;
  width: 110px;
  height: 100px;;
  position: absolute;
  background-repeat: no-repeat;
  background-image: assets-url("arrow-left.svg");
}
