%date-pick-selected {
  color: $white !important;
  background-color: $brand-primary;
}

%date-pick-disabled {
  color: $disabled-bg !important;
}

//日期框
.#{$date-pick-prefix-cls}er {
  // position: relative;
  font-size: $input-font-size;
  width: $date-panel-width;

  .input-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    vertical-align: middle;

    .input-icon {
      position: absolute;
      top: 50%;
      right: $input-padding-x;
      font-size: 1.3em;
      line-height: 1;
      color: $gray-light-25;
      user-select: none;
      transition: all .3s;
      transform: translate(0, -50%);

      .#{$icon-prefix}-close-circle {
        display: none;
      }
    }

    input.#{$input-prefix-cls} {
      padding-right: ($input-padding-x * 2 + 1.06);
    }
  }

  //clear
  &--clear {
    @include hover {
      .input-icon {
        @extend %input-icon;

        .#{$icon-prefix}-close-circle {
          display: inline;
        }
      }
    }
  }
}

//下拉面板
.#{$date-pick-prefix-cls} {
  $root: #{&};
  position: absolute;
  top: auto;
  left: 0;
  z-index: $zindex-dropdown;
  min-width: auto !important;
  padding: $dropdown-padding-y 0;
  margin: $dropdown-margin-top 0 0; // override default ul
  font-size: inherit;
  color: $body-color;
  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
  list-style: none;
  background-color: $dropdown-bg;
  background-clip: padding-box;
  border: $dropdown-border-width solid $dropdown-border-color;
  @include border-radius($border-radius);
  @include box-shadow($dropdown-box-shadow);
  //content
  &-content {
    display: flex;
  }
  //panel
  &__panel {
    @include clearfix();
    display: flex;
    flex-direction: column;
    background: $white;
  }

  //row
  &__row {
    display: flex;
    height: $date-panel-height;
    overflow: hidden;

    &--start,
    &--end {
      width: $date-panel-width;
      height: 100%;
    }

    &--start {
      #{$root}-range & {
        float: left;

        #{$root}__header {
          @include border-right-radius(0);
        }
      }
    }

    &--end {
      height: 100%;

      #{$root}-range & {
        float: left;
      }

      #{$root}__header {
        @include active-primary(true);
        border-left: 1px solid rgba($white, .18);

        #{$root}-range & {
          @include border-left-radius(0);
        }
      }

      #{$root}__body {
        border-left: 1px solid $divider-bg;
      }
    }
  }

  table {
    width: 100%;
    max-width: 100%;
    text-align: center;
    vertical-align: middle;
    border-spacing: 0 nth($datePicker-date-spacer, 2);
    border-collapse: separate;
    background-color: transparent;

    th {
      height: 18px;
      padding: 5px nth($datePicker-date-spacer, 1) 3px 0;
      font-size: $datePicker-weekDays-font-size;
      font-weight: 400;
      line-height: 1;
      color: $gray-light-45;
      text-align: center;

      &:last-child {
        padding-right: 0;
      }
    }

    td {
      padding: 5px nth($datePicker-date-spacer, 1) 0 0;
      font-size: $datePicker-date-font-size;
      cursor: pointer;

      &:last-child {
        padding-right: 0;
      }

      > a {
        height: $datePicker-date-height;
        line-height: $datePicker-date-height - 2;
        border: 1px solid transparent;
      }
      //same day,month,year
      &#{$root}__today {
        color: $brand-primary;

        & > a {
          border-color: $brand-primary;
        }
      }

      //增加 解决bug 日期组件点击区域和事件响应区域不一致
      &:not(#{$root}--selected):not(#{$root}--in-selected):not(#{$root}__other-month) {
        > a {
          &:hover {
            background: rgba($brand-primary, .1);
          }
        }
      }

      //删除 解决bug 日期组件点击区域和事件响应区域不一致
      /*@include hover {
        outline: none;
        &:not(#{$root}--selected):not(#{$root}--in-selected):not(#{$root}__other-month) {
          a{
            background: rgba($brand-primary, 0.1);
          }
        }
      }*/
    }
  }

  //header
  &__header {
    @include border-top-radius($border-radius);
    @include active-primary;
    height: $datePicker-header-height;
    padding: 0 $datePicker-padding-x;
    font-size: $datePicker-header-font-size;
    font-weight: 400;
    line-height: $datePicker-header-height;
    color: $datePicker-header-color;
    text-align: center;
    &-label {
      color: $datePicker-header-color;
    }
    //cmd
    #{$root}__cmd {
      font-size: 24px;
      cursor: pointer;

      &--prev {
        float: left;
      }

      &--next {
        float: right;
      }
    }
    //标题
    &-label {
      cursor: pointer;
      justify-self: center;
      color: inherit;
    }
  }

  &__body {
    padding: 0 $datePicker-padding-x;
  }

  //footer
  &__footer {
    padding: $datePicker-footer-padding;
    text-align: right;
    border-top: 1px solid $divider-bg;
  }



  //日期选择
  &__date {
    & > a {
      display: inline-block;
      width: $datePicker-date-width;
      color: inherit;
      vertical-align: middle;
      border-radius: $datePicker-date-border-radius;
    }
  }

  //other month
  &__other-month {
    color: $disabled-bg !important;
  }


  //日期范围选择
  &-range {
    table tr td:first-child {
      @include border-left-radius($border-radius);
    }

    table tr td:last-child {
      @include border-right-radius($border-radius);
    }
  }

  //checked
  &--selected {
    & > a {
      @extend %date-pick-selected;
    }

    &-min {
      background: rgba($brand-primary, .1);
      border-top-left-radius: $datePicker-date-border-radius;
      border-bottom-left-radius: $datePicker-date-border-radius;
    }

    &-max {
      background: rgba($brand-primary, .1);
      background: linear-gradient(to right, rgba($brand-primary, .1) 40%, #fff 0);
      border-top-right-radius: $datePicker-date-border-radius;
      border-bottom-right-radius: $datePicker-date-border-radius;
    }
  }

  &--in-selected {
    background: rgba($brand-primary, .1);
  }

  // disabled
  &--disabled {
    cursor: not-allowed !important;

    > a {
      @extend %date-pick-disabled;
      cursor: not-allowed;
    }

    & + #{$root}--disabled {
      position: relative;

      > a {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
      }
    }
  }

  a.date-pick--disabled {
    @extend %date-pick-disabled;
  }

  //快捷选项
  &__sidebar {
    @include border-right-radius($border-radius);
    @extend %thin-scroll;
    flex-grow: 1;
    max-height: $date-panel-height;
    padding: 14px;
    overflow-y: auto;
    background: $gray-light-2;
  }


  //月份选择，年份选择
  &__month-panel,
  &__year-panel {
    display: flex;
    flex-direction: column;
    height: 100%;

    #{$root}__body {
      flex: 1;
    }

    table {
      height: 100%;

      tbody td {
        padding: $datePicker-other-panel-date-padding;

        a {
          display: inline-block;
          width: $datePicker-other-panel-date-width;
          border-radius: $datePicker-other-panel-date-border-radius;
        }
      }
    }
  }

  //时间选择
  &__time-panel {
    position: relative;
    height: 100%;

    .#{$date-pick-prefix-cls}__header, .#{$date-pick-prefix-cls}__body {
      padding-right: $datePicker-padding-x;
      padding-left: $datePicker-padding-x;
    }

    .#{$date-pick-prefix-cls}__body {
      position: relative;
      padding: 0;
    }

    &::after {
      position: absolute;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 10;
      width: 100%;
      height: 28px;
      content: " ";
      background: linear-gradient(#fff, #f5f5f5);
      background-color: #fff;
      filter: alpha(opacity=70);
      opacity: .7;
    }

    .#{$date-pick-prefix-cls}-time-spinner {
      height: 100%;
      overflow: hidden;
      text-align: center;

      &__title {
        padding: 0;
        margin: 0;
        overflow: hidden;

        li {
          float: left;
          width: 33.3333%;
          height: 18px;
          padding: 0;
          margin: 8px 0 14px;
          font-size: $datePicker-date-font-size;
          font-weight: 500;
          line-height: 18px;
          color: $gray-light-45;
          text-align: center;
          list-style: none;
        }
      }

      &__select {
        position: relative;
        float: left;
        width: 33.3333%;
        margin-left: -1px;
        overflow: hidden;
        font-size: $font-size-sm;
        font-size: $datePicker-date-font-size;
        border: 1px solid #e9e9e9;
        border-width: 0 1px;

        &:last-child {
          border: none;
        }

        ul {
          @extend %transparent-scroll;
          width: 100%;
          max-height: $time-spinner-height;
          padding: 0;
          margin: 0;
          overflow-y: auto;
          list-style: none;

          li {
            margin: 0;
            margin-bottom: nth($datePicker-date-spacer, 2);
            cursor: pointer;

            a {
              @include hover {
                outline: none;

                &:not(.#{$date-pick-prefix-cls}-time-spinner--selected) {
                  background: rgba($brand-primary, .1);
                }
              }
              display: inline-block;
              width: $datePicker-date-width;
              height: $datePicker-date-height;
              line-height: $datePicker-date-height;
              border-radius: $datePicker-date-border-radius;
            }

            &.blank {
              height: $datePicker-date-height;
              margin-top: -4px;
              margin-bottom: 0;
            }
          }
        }
      }
      //checked
      &--selected {
        @extend %date-pick-selected;
      }
    }
  }
}

.#{$date-pick-prefix-cls}-time-scroll {
  display: flex;
  height: 100%;
  overflow: hidden;
  text-align: center;
  &__title {
    display: flex;
    padding: 0;
    margin: 0;
    overflow: hidden;
    li {
      flex: 1;
      height: 40px;
      padding: 0;
      margin-left: -1px;
      font-size: 12px;
      line-height: 40px;
      color: #666;
      text-align: center;
      list-style: none;
    }
  }
  &__select {
    flex: 1;
    margin-left: -1px;
    overflow: hidden;
    font-size: 12px;
    border: 1px solid $gray-light-9;
    border-width: 0 1px;
    ul {
      @extend %transparent-scroll;
      width: 100%;
      max-height: $time-spinner-height;
      padding: 0;
      margin: 0;
      overflow-y: auto;
      list-style: none;

      li {
        margin: 0;
        margin-bottom: nth($datePicker-date-spacer, 2);
        cursor: pointer;

        a {
          @include hover {
            outline: none;

            &:not(.#{$date-pick-prefix-cls}-time-scroll--selected) {
              background: rgba($brand-primary, .1);
            }
          }
          display: inline-block;
          width: $datePicker-date-width;
          height: $datePicker-date-height;
          line-height: $datePicker-date-height;
          border-radius: $datePicker-date-border-radius;
        }

        &.blank {
          height: $datePicker-date-height;
          margin-top: -4px;
          margin-bottom: 0;
        }
      }
    }
  }
  &--selected {
    @extend %date-pick-selected;
  }
}
.#{$date-pick-prefix-cls}-parent-input{
  position: relative;
}
.#{$date-pick-prefix-cls}-suspension{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height: 100%;
  z-index: 2;
}


