@import '../../style/theme/default.less';

@picker-prefix-cls: ~'@{kui-prefix}-picker';

/* prettier-ignore */
@viewheight: 220PX;

/* prettier-ignore */
@rowHeight: 44PX;

.@{picker-prefix-cls} {
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background-color: #fff;
  border-radius: 24px 24px 0 0;

  &-body {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
  }

  &-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 34px 40px 44px 40px;
  }

  &-cancel {
    flex: 1;
    font-family: PingFangSC-Regular, PingFang SC;
    font-size: 34px;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
  }

  &-title {
    flex: 1;
    font-family: PingFangSC-Medium, PingFang SC;
    font-size: 40px;
    font-weight: 500;
    color: rgba(51, 51, 51, 1);
    text-align: center;
    white-space: nowrap;
  }

  &-right {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
  }

  &-sure {
    font-family: PingFangSC-Regular, PingFang SC;
    font-size: 34px;
    font-weight: 400;
    color: @primary-color;
  }

  &-clear {
    margin-right: 20px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-size: 34px;
    font-weight: 400;
    color: @primary-color;
  }

  &-content {
    position: relative;
  }

  &-cols {
    display: flex;

    &-time {
      .@{picker-prefix-cls}-col {
        display: flex;

        &:first-child {
          justify-content: flex-end;
        }

        &:last-child {
          justify-content: flex-start;
        }
      }

      .@{picker-prefix-cls}-scroll {
        width: 25%;
      }
    }
  }

  &-col {
    position: relative;
    flex: 1;
    height: @viewheight;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
    user-select: none;
  }

  &-grabbing {
    cursor: grabbing;
  }

  /* prettier-ignore */
  &-mask {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    width: 100%;
    height: @viewheight + 1PX;
    margin: 0 auto;
    pointer-events: none;
    background: linear-gradient(180deg, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6)), linear-gradient(0deg, hsla(0, 0%, 100%, 0.95), hsla(0, 0%, 100%, 0.6));
    background-repeat: no-repeat;
    background-position: top, bottom;
    background-size: 100% (@viewheight / 2 -  @rowHeight / 2);
    transform: translateZ(0);
  }

  &-indicator {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 3;
    width: 100%;
    height: @rowHeight;
    pointer-events: none;
    transform: translate(0, -50%);

    &::before,
    &::after {
      position: absolute;
      right: 0;
      left: 0;
      height: 1px;
      content: ' ';
      background-color: #e5e5e5;
      transform: scale(1, 0.5);
    }

    &::before {
      top: 0;
    }

    &::after {
      bottom: 0;
    }
  }

  &-scroll {
    margin-top: (@viewheight / 2 - @rowHeight / 2);
  }

  /* prettier-ignore */
  &-row {
    padding: 0;
    overflow: hidden;
    font-family: PingFangSC-Medium, PingFang SC;
    font-size: 16PX;
    font-weight: 500;
    line-height: @rowHeight;
    color: rgba(51, 51, 51, 1);
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &-date-range {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 44px;
    margin-bottom: 64px;
    font-size: 30px;
    color: #f00;
  }

  /* prettier-ignore */
  &-start-date,
  &-end-date {
    width: 240px;
    height: 82px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-size: 32px;
    font-weight: 400;
    line-height: 80px;
    color: #999;
    text-align: center;
    border-bottom: solid 2px #e6e6e6;
    transition: all 0.15s;

    &-active {
      color: @primary-color;
      border-bottom-color: @primary-color;
    }
  }

  &-delimiter {
    margin: 0 86px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-size: 28px;
    font-weight: 400;
    line-height: 36px;
    color: #666;
  }
}
