@import "../common/var";
@import "../mixins/mixins";

@include b(date-table) {
  font-size: 12px;
  user-select: none;

  @include when(week-mode) {
    .yk-date-table__row {
      &:hover {
        > td > .yk-date-table__cell {
          background-color: $--datepicker-inrange-background-color;
        }
        td.available:hover {
          color: $--datepicker-font-color;
        }
        // td:first-child div {
        //   margin-left: 5px;
        //   border-top-left-radius: 15px;
        //   border-bottom-left-radius: 15px;
        // }
        // td:last-child div {
        //   margin-right: 5px;
        //   border-top-right-radius: 15px;
        //   border-bottom-right-radius: 15px;
        // }
      }

      &.current > td > .yk-date-table__cell {
        background-color: $--datepicker-inrange-background-color;
      }
    }
  }

  td {
    width: 40px;
    height: auto;
    // padding: 4px 0;
    box-sizing: border-box;
    text-align: center;
    vertical-align: top;
    cursor: pointer;
    position: relative;

    > .yk-date-table__cell {
      width: 40px;
      min-height: 40px;
      // padding: 3px 0;
      box-sizing: border-box;
      display: flex;
      flex-flow: column nowrap;
      justify-content: flex-start;
      align-items: center;
    }

    .yk-date-table__day {
      width: 40px;
      height: 40px;
      line-height: 40px;
      flex: 0 0 40px;
      box-sizing: border-box;
      border-radius: 4px;
      position: relative;
    }

    .yk-date-table__extra {
      width: 100%;
      height: auto;
      flex: 0 0 auto;
      box-sizing: border-box;
      overflow-wrap: anywhere;
      line-height: normal;
    }

    &.next-month,
    &.prev-month {
      color: $--datepicker-off-font-color;
    }

    &.today {
      position: relative;
      .yk-date-table__day {
        &::after {
          content: '';
          display: inline-block;
          height: 4px;
          width: 4px;
          border-radius: 50%;
          background-color: #3366FF;
          position: absolute;
          bottom: 6px;
          left: 50%;
          transform: translate(-50%,0); 
          // color: $--color-primary;
          // font-weight: bold;
        }
      }
      &.start-date .yk-date-table__day,
      &.end-date .yk-date-table__day {
        color: $--datepicker-font-color;
      }
    }

    &.available:hover {
      color: $--datepicker-hover-font-color;
    }

    &.in-range > .yk-date-table__cell {
      background-color: $--datepicker-inrange-background-color;
      &:hover {
        background-color: $--datepicker-inrange-hover-background-color;
      }
    }

    &.current:not(.disabled) {
      color: $--datepicker-font-color;
      border: 1px solid #2E63FD;
      background-color: $--datepicker-inrange-background-color;
    }
    &.start-date > .yk-date-table__cell,
    &.end-date > .yk-date-table__cell {
      color: $--datepicker-font-color;
    }

    &.start-date .yk-date-table__day,
    &.end-date .yk-date-table__day {
      color: $--datepicker-font-color;
      border: 1px solid #2E63FD;
      background-color:$--datepicker-inrange-background-color;
    }

    // &.start-date div {
    //   margin-left: 5px;
    //   border-top-left-radius: 15px;
    //   border-bottom-left-radius: 15px;
    // }

    // &.end-date div {
    //   margin-right: 5px;
    //   border-top-right-radius: 15px;
    //   border-bottom-right-radius: 15px;
    // }

    &.disabled {
      background-color: $--background-color-base;
      opacity: 1;
      cursor: not-allowed;
      color: $--color-text-placeholder;

      > .yk-date-table__cell {
        background-color: transparent;
        cursor: inherit;
      }
    }

    &.selected > .yk-date-table__cell {
      margin-left: 5px;
      margin-right: 5px;
      background-color: $--datepicker-inrange-background-color;
      // border-radius: 15px;
      &:hover {
        background-color: $--datepicker-inrange-hover-background-color;
      }
    }

    &.selected .yk-date-table__day {
      border: 1px solid #2E63FD;
      background-color:$--datepicker-inrange-background-color;
      // color: $--color-white;
      // border-radius: 15px;
    }

    &.week {
      font-size: 80%;
      color: $--datepicker-header-font-color;
    }
  }

  th {
    padding: 5px;
    color: rgba($color: $--datepicker-header-font-color, $alpha: 0.56) ;
    font-weight: 400;
    border-top: solid 1px $--border-color-lighter;
    border-bottom: solid 1px $--border-color-lighter;
  }
}
