@import '../common/abstracts/variable';
@import '../common/abstracts/mixin';

.wot-theme-dark {
  @include b(tabs) {
    background: $-dark-background2;

    @include e(nav) {
      background: $-dark-background2;
    }

    @include e(nav-item) {
      color: $-dark-color3;

      @include when(active) {
        font-weight: 600;
        color: $-dark-color;
      }

      @include when(disabled) {
        color: $-dark-color-gray;
      }
    }

    @include e(map-nav-btn) {
      color: $-dark-color3;
      background-color: $-dark-background4;

      @include when(active) {
        color: $-dark-color;
        background-color: $-dark-background;
        border: 1px solid $-tabs-nav-active-color;
      }

      @include when(disabled) {
        color: $-dark-color-gray;
        border-color: #f4f4f4;
      }
    }

    @include e(map-btn) {
      color: $-dark-color3;
      background: $-dark-background2;
    }

    @include e(map-header) {
      color: $-dark-color;
      background: $-dark-background2;

      &::after {
        background: $-dark-background4;
      }
    }

    @include e(map-body) {
      background: $-dark-background2;
    }
  }
}

@include b(tabs) {
  position: relative;
  width: 100%;
  background: #fff;

  @include e(nav) {
    position: relative;
    right: 0;
    left: 0;
    width: 100%;
    height: $-tabs-nav-height;

    @include m(wrap) {
      height: 100%;
      overflow: hidden;
    }

    @include m(sticky) {
      width: 100vw;
    }
  }

  @include e(nav-container) {
    position: relative;
    display: flex;
    user-select: none;
  }

  @include e(nav-item) {
    flex: 1;
    min-width: 0;
    height: $-tabs-nav-height;
    font-size: $-tabs-nav-fs;
    line-height: $-tabs-nav-height;
    color: $-tabs-nav-color;
    text-align: center;
    transition: color 0.3s;
    @include lineEllipsis();

    @include when(active) {
      color: $-tabs-nav-active-color;
      font-weight: 600;
    }

    @include when(disabled) {
      color: $-tabs-nav-disabled-color;
    }
  }

  @include e(line) {
    position: absolute;
    bottom: 4px;
    left: 0;
    z-index: 1;
    width: $-tabs-nav-line-width;
    height: $-tabs-nav-line-height;
    background: $-tabs-nav-line-bg-color;
    border-radius: calc($-tabs-nav-line-height / 2);
  }

  @include e(semicircle) {
    background-color: transparent;
    height: 8rpx;
    width: 36rpx;
    background-image: url("./semicircle.svg");
    background-size: cover 100%;
    background-repeat: no-repeat;
  }


  @include e(container) {
    overflow: hidden;
  }

  @include e(body) {
    position: relative;
    width: 100%;
    height: 100%;

    @include when(animated) {
      display: flex;
      transition-property: left;
    }
  }

  @include e(map) {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
  }

  @include e(map-btn) {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    width: $-tabs-nav-height;
    height: $-tabs-nav-height;
    line-height: $-tabs-nav-height;
    color: $-tabs-nav-map-arrow-color;
    text-align: center;
    background: $-tabs-nav-bg;
    -webkit-tap-highlight-color: transparent;

    &::before {
      position: absolute;
      top: 0;
      left: -24px;
      width: 24px;
      height: $-tabs-nav-height - 1;
      content: '';
      background: $-tabs-nav-map-btn-before-bg;
    }
  }

  @include e(map-arrow) {
    display: block;
    transition: transform 0.3s;

    @include when(open) {
      transform: rotate(180deg);
    }
  }

  @include e(map-header) {
    position: relative;
    height: $-tabs-nav-height;
    padding-left: 17px;
    font-size: $-tabs-nav-map-fs;
    line-height: $-tabs-nav-height;
    color: $-tabs-nav-map-color;
    background: #fff;
    opacity: 0;
    transition: opacity 0.3s;

    @include halfPixelBorder;

    &::after {
      z-index: 3;
    }
  }

  @include e(map-body) {
    display: flex;
    flex-wrap: wrap;
    padding: 20px 15px 10px;
    background: #fff;
    transition: transform 0.3s;
    transform: scaleY(0);
    transform-origin: center top;

    @include when(open) {
      transform: scaleY(1);
    }
  }

  @include e(map-nav-item) {
    flex-basis: 33%;

    &:nth-child(3n + 2) {
      text-align: center;
    }

    &:nth-child(3n + 3) {
      text-align: right;
    }
  }

  @include e(map-nav-btn) {
    @include buttonClear;
    @include lineEllipsis;
    display: inline-block;
    width: 107px;
    height: 32px;
    margin-bottom: 10px;
    font-size: $-tabs-nav-map-fs;
    line-height: 32px;
    color: $-tabs-nav-map-color;
    text-align: center;
    background-color: $-tabs-nav-map-button-back-color;
    border-color: transparent;
    border-radius: $-tabs-nav-map-button-radius;
    transition:
      color 0.3s,
      border-color 0.3s;

    @include when(active) {
      color: $-tabs-nav-active-color;
      background-color: $-tabs-nav-bg;
      border: 1px solid $-tabs-nav-active-color;
    }

    @include when(disabled) {
      color: $-tabs-nav-disabled-color;
      border-color: #f4f4f4;
    }
  }

  @include e(mask) {
    position: absolute;
    top: $-tabs-nav-height;
    right: 0;
    bottom: 0;
    left: 0;
    background: $-tabs-nav-map-modal-bg;
    opacity: 0;
    transition: opacity 0.3s;
  }

  @include when(slide) {
    .wd-tabs__nav-item {
      flex: 0 0 auto;
      padding: 0 17px;
    }
  }

  @include when(map) {
    .wd-tabs__nav--wrap {
      padding-right: 40px;
    }
  }
}

@media screen and (max-width: 330px) {
  .wd-tabs__map-nav-btn {
    width: 90px;
  }
}