@import "../common/var";
@import "../mixins/mixins";
@import "./picker-panel.scss";

@include b(date-picker) {
  width: 280px;
  box-sizing: border-box;

  &.has-sidebar.has-time {
    width: 400px;
  }

  &.has-sidebar {
    width: 400px;
  }

  &.has-time .el-picker-panel__body-wrapper {
    position: relative;
  }

  table {
    table-layout: fixed;
    width: 100%;
  }

  @include e(editor-wrap) {
    position: relative;
    display: table-cell;
    padding: 0 5px;
  }

  @include e(time-header) {
    position: relative;
    border-bottom: 1px solid $--datepicker-inner-border-color;
    font-size: 12px;
    padding: 8px 5px 5px 5px;
    display: table;
    width: 100%;
    box-sizing: border-box;
  }

  @include e(header) {
    margin: 16px 6px;
    text-align: center;

    @include m(bordered) {
      margin-bottom: 0;
      padding-bottom: 12px;
      // border-bottom: solid 1px $--border-color-lighter;

      &+.el-picker-panel__content {
        margin-top: 0;
      }
    }
  }

  &.has-separate {
    width: auto;

    .el-date-picker__separate-left {
      width: 280px;
    }
  }

  @include e(separate) {
    display: flex;

    &-left {
      border-right: 1px solid $--border-color-light;
    }

    &-right {
      width: 256px;
      height: auto;
      background-color: $--color-white;
      border-top-right-radius: 4px;

      .el-date-picker__separate-time {
        width: 100%;
        height: 28px;
        line-height: 28px;
        padding-top: 14px;
        text-align: center;
        font-size: 16px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;

        &--separate {
          display: inline-block;
          width: 60px;
          height: 28px;
          line-height: 28px;
          cursor: pointer;

          &:hover {
            background: #F5F7FE;
            border-radius: 4px;
          }
        }
      }

      .time-unfold {
        transform: unset;

        &-popper {
          width: 256px;
          box-shadow: none;
          border: none;
          margin-top: -5px;

          .el-scrollbar__wrap {
            width: 100%;
            overflow: hidden;
          }

          .el-scrollbar__bar {
            width: 0;
            height: 0;
          }
        }
      }

      .el-time-spinner {
        width: calc(100% - 32px);
        padding-top: 16px;
        margin-left: 16px;
        margin-right: 16px;
        padding-bottom: 16px;

        &__wrapper {
          height: 220px;
          max-height: 220px;

          .el-time-spinner__list {

            &::after,
            &::before {
              content: '';
              display: block;
              width: 100%;
              height: 108px;
            }

            &-block {
              width: calc(100% - 14px);
              height: 20px;
              left: 7px;
              top: calc(50% + 14px);
              z-index: 0;
              border-radius: 2px;
              cursor: pointer;
            }

            .el-time-spinner__item {
              position: relative;
              z-index: 1;
            }
          }
        }
      }
    }

    .el-date-picker__separate-second-right {
      width: 185px;
    }
  }

  @include e(header-label) {
    font-family: PingFangSC-Medium, PingFang SC;
    font-size: 16px;
    font-weight: 500;
    padding: 0 5px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    color: $--color-text-regular;

    &:hover {
      color: $--datepicker-hover-font-color;
    }

    &.active {
      color: $--datepicker-active-color;
    }
  }

  @include e(prev-btn) {
    float: left;
  }

  @include e(next-btn) {
    float: right;
  }

  @include e(time-wrap) {
    padding: 10px;
    text-align: center;
  }

  @include e(time-label) {
    float: left;
    cursor: pointer;
    line-height: 24px;
    margin-left: 10px;
  }
}