@import '../custom.less';

@year-table-prefix-cls: ~'@{css-prefix}year-table';

.@{year-table-prefix-cls} {
  @apply text-xs;
  @apply -m-px;
  @apply border-collapse;

  td:not(.in-range),
  td.in-range {
    @apply text-center;
    @apply cursor-pointer;
    @apply py-4 px-0;

    &.today {
      .cell {
        @apply border border-solid border-color-border-focus;
        line-height: 46px;
      }

      &.end-date,
      &.start-date {
        .cell {
          @apply text-color-text-inverse;
        }
      }
    }

    &.disabled {
      .cell {
        @apply bg-color-bg-3;
        @apply cursor-not-allowed;
        @apply text-color-text-disabled;

        &:hover {
          @apply text-color-text-disabled;
        }
      }
    }

    .cell {
      @apply w-12;
      @apply h-12;
      @apply ~'leading-[theme(spacing.12)]';
      @apply box-border;
      @apply block;
      @apply text-color-text-primary;
      @apply my-0;
      @apply rounded-form;

      &:hover {
        @apply bg-color-brand-hover-subtle;
      }
    }

    &.in-range {
      div,
      div:hover {
        @apply bg-color-brand-hover-subtle;
      }
    }

    &.end-date,
    &.start-date {
      div {
        @apply text-color-text-inverse;
      }

      .cell {
        @apply text-color-text-inverse;
        @apply bg-color-brand;
      }
    }

    &.start-date div {
      @apply rounded-tl;
      @apply rounded-bl;
    }

    &.end-date div {
      @apply rounded-tr;
      @apply rounded-br;
      @apply mr-7;
    }

    &:not(.in-range) {
      div {
        @apply h-auto;
        @apply p-0;
      }
    }

    &.current:not(.disabled) .cell {
      &,
      &:hover {
        @apply text-color-text-inverse;
        @apply bg-color-brand;
      }
    }
  }
}