@import "../common/var";

@include b(month-table) {
  font-size: $--datepicker-font-size-base;
  margin: -1px;
  border-collapse: collapse;
  width: 250px;
  margin: 12px auto 24px;

  td {
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    & div {
      position: relative;
      height: 24px;
      padding: 0;
      box-sizing: border-box;
    }
    &.today {
      .cell {
        color: $--datepicker-font-color;
        border-radius: $--datepicker-border-radius;
        border: $--border-width-base $--border-style-base $--datepicker-today-border-color;
      }
      &.start-date .cell,
      &.end-date .cell {
        color: $--color-white;
      }
    }

    &.disabled .cell {
      background-color: $--background-color-base;
      cursor: not-allowed;
      color: $--color-text-placeholder;

      &:hover {
        color: $--color-text-placeholder;
      }
    }

    .cell {
      position: absolute;
      left: 12px;
      top: 0;
      display: block;
      width: 60px;
      height: 24px;
      line-height: 24px;
      color: $--datepicker-font-color;
      margin: 0 auto;
      box-sizing: content-box;
    }

    &.current:not(.disabled) {
      .cell {
        background: $--datepicker-active-color;
        color: $--color-white;
        border-radius: $--datepicker-border-radius;
      }
    }

    &.in-range div {
      background-color: $--datepicker-inrange-background-color;
      &:hover {
        background-color: $--datepicker-inrange-hover-background-color;
      }
    }
    &.start-date .cell,
    &.end-date .cell {
      color: $--color-white;
      border-radius: $--datepicker-border-radius;
      background-color: $--datepicker-active-color;
    }

    &.start-date div {
      margin-left: 24px;
      border-top-left-radius: 15px;
      border-bottom-left-radius: 15px;
      .cell {
        left: -12px;
      }
    }

    &.end-date div {
      margin-right: 24px;
      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;
    }
  }
}
