@import "../common/var";
@import "../mixins/mixins";

@include b(date-table) {
  font-size: 12px;
  user-select: none;

  @include when(week-mode) {
    .el-date-table__row {
      &:hover {
        div {
          background-color: $--datepicker-inrange-background-color;
        }
        td.available:hover {
          color: $--datepicker-font-color;
        }
        td:first-child div {
          margin-left: 5px;
        }
        td:last-child div {
          margin-right: 5px;
        }
      }

      &.current div {
        background-color: $--datepicker-inrange-background-color;
      }
    }
  }

  td {
    width: 32px;
    height: 30px;
    padding: 4px 0;
    box-sizing: border-box;
    text-align: center;
    cursor: pointer;
    position: relative;

    & div {
      height: 27px;
      // padding: 0;
      box-sizing: border-box;
    }

    & span {
      width: 24px;
      height: 24px;
      display: block;
      margin: 0 auto;
      line-height: 24px;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      border-radius: 2px;
      border: 1px solid transparent;
      // &:hover{
      //   border: 1px solid $--color-primary;
      //   color: $--color-text-regular;
      // }
    }

    &.next-month,
    &.prev-month {
      color: $--datepicker-off-font-color;
    }

    &.today:not(.disabled) {
      position: relative;
      span {
        border: 1px solid $--color-primary;
      }
      &.start-date span,
      &.end-date span {
        color: $--color-white;
      }
    }

    &.in-range div {
      background-color: $--datepicker-inrange-background-color;
    }

    &.current:not(.disabled) span {
      color: $--color-white;
      background-color: $--datepicker-active-color;
    }
    &.start-date div,
    &.end-date div {
      color: $--color-white;
    }

    &.start-date span,
    &.end-date span {
      background-color: $--datepicker-active-color;
    }

    &.start-date div {
      margin-left: 7px;
      // border-top-left-radius: 15px;
      // border-bottom-left-radius: 15px;
    }

    &.end-date div {
      margin-right: 7px;
      // border-top-right-radius: 15px;
      // border-bottom-right-radius: 15px;
    }

    &.disabled div {
      background-color: $--background-color-base;
      opacity: 1;
      cursor: not-allowed;
      color: $--color-text-placeholder;
    }

    &.selected div {
      margin-left: 5px;
      margin-right: 5px;
      background-color: $--datepicker-inrange-background-color;
    }

    &.selected span {
      background-color: $--datepicker-active-color;
      color: $--color-white;
    }

    &.week {
      font-size: 80%;
      color: $--datepicker-header-font-color;
    }
  }
  td:not(.in-range):not(.current):not(.disabled):not(.selected) {
    & div{
      &:hover span{
        background-color: $--background-color-hover;
      }
      // & span{
      //   &:hover{
      //     border: 1px solid $--color-primary;
      //     color: $--color-text-regular;
      //   }
      // }
    }
  }

  th {
    padding: 5px;
    color: $--datepicker-header-font-color;
    font-weight: 400;
    border-bottom: solid 1px $--table-border-color;
  }
}
