@import 'press-ui/common/style/smoba/layout.scss';
@import 'press-ui/common/style/smoba/mixin.scss';
@import './tree-mixin.scss';


.press-schedule-tree {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: scroll;


  &-tab-mask {
    position: absolute;
    left: 0;
    top: 16px;
    content: '';
    width: 40px;
    height: 22px;
    background-image: linear-gradient(270deg, rgba(248, 249, 252, 0) 0%, #f8f9fc 100%);
    z-index: 6;
  }

  &-tabs {
    position: sticky;
    top: 0;
    display: flex;
    padding-top: 40px;
    padding-left: 16px;
    padding-bottom: 8px;
    user-select: none;
    transition: all .45s;
    z-index: 5;
    cursor: grab;
  }

  &-tab {
    position: relative;
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
    // width: 164px;
    transition: all .45s;

    &--clickable {
      .press-schedule-tree-tab-title,
      .press-schedule-tree-tab-desc,
      .press-schedule-tree-tab-desc-icon.icon-back {
        cursor: pointer;
      }
    }

    &::after {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      top: -12px;
      height: 2px;
      background: $color-gray-3;
      transition: all .45s;
    }

    &:first-child {
      &-icon {
        top: -20px;
      }

      &::after {
        background: $color-blue-1;
      }
    }

    &:last-child {
      padding-right: 16px;

      &::after {
        display: none;
      }
    }

    &-icon {
      position: absolute;
      left: -3px;
      top: -21px;
      width: 17px;
      height: 17px;
      background: url(https://image-1251917893.file.myqcloud.com/Esports/new/user/sch-border-icon.png) no-repeat center;
      background-size: contain;
      transition: all .45s;
      z-index: 1;
    }

    &-title {
      color: $color-black;
      font-size: 16px;
      line-height: 23px;
    }

    &-desc {
      position: relative;
      color: $color-gray;
      font-size: 14px;
      padding-left: 5px;
      line-height: 22px;

      &-icon {
        position: relative;
        top: -5px;
        font-size: 12px;
        color: $color-gray;
        transform: rotate(180deg);
      }
    }
  }

  &-layout {
    display: flex;
    height: 100%;
    padding-top: 4px;

    &--err-tip {
      padding-top: 8px;

      .press-schedule-team-main {
        position: relative;
      }
    }

    &--shadow {
      height: fit-content;
    }
  }

  &-main {
    position: relative;
    // display: flex;
    flex: 1;
    padding-left: 16px;
    user-select: none;
    z-index: 6;
    overflow-x: hidden;
    overflow-y: scroll;
    transition: all .45s;
    cursor: grab;
  }

  &-column {
    transition: all .45s;
    position: relative;

    &:first-child {
      .press-schedule-tree-pair {
        padding-left: 0;
      }
    }

    &--shadow {
      &::after {
        content: '';
        z-index: -1;
        background: linear-gradient(180deg, rgba(223, 226, 234, 0), #dfe2ea);
        position: absolute;
        top: 0;
        bottom: 16px;
        right: 0;
        left: 0;
      }
    }
  }

  &-pair {
    position: relative;
    padding: 0 8px;

    &--hidden {
      display: none;
    }
  }

  &-pair-border {
    position: absolute;
    top: 40px;
    right: 0px;
    // bottom: 59px;
    bottom: calc(50% - 40px);
    bottom: max(76px, calc(50% - 40px));
    width: 9px;
    border: 1px solid $color-gray-3;
    border-left: 0;

    &::after {
      content: '';
      position: absolute;
      top: 50%;
      right: -7px;
      transform: translateY(-50%);
      display: block;
      width: 7px;
      height: 1px;
      background: $color-gray-3;
      z-index: -1;
    }

    // 双败赛败者组平行线
    &--parallel {
      width: 18px;
      right: -9px;
      border-right: 0;

      &::after {
        display: none;
      }

    }

    &--no-bottom {
      border-bottom: 0;
    }

    // &:last-child {
    //   display: none;
    // }
  }
}

.press-schedule-tree {
  &__loading,
  &__finished {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #969799;
    font-size: 14px;
  }
}



@include sch-item-margin-bottom(10);



.press-schedule-tree:not(.press-schedule-tree--swiss) {
  @include sche-tab-highlight(-3, $background-image: url('https://image-1251917893.file.myqcloud.com/Esports/new/user/sch-border-r-icon.png'));
}