@use "../../libs/css/mixin.scss" as *;
@use "../../theme.scss" as *;


/* 主样式 */
@include b(calendar){
  /* 确认按钮 */
  &__confirm {
    padding: 7px 18px;
  }

  /* 头部样式 */
  &-header {
    display: flex;
    flex-direction: column;
    padding-bottom: 4px;

    &__title {
      font-size: 16px;
      text-align: center;
      height: 42px;
      line-height: 42px;
      font-weight: bold;
    }

    &__subtitle {
      font-size: 14px;
      color: $hy-text-color--2;
      height: 40px;
      text-align: center;
      line-height: 40px;
      font-weight: bold;
    }

    &__weekdays {
      @include flex;
      justify-content: space-between;

      &__weekday {
        font-size: 13px;
        color: $hy-text-color--grey;
        line-height: 30px;
        flex: 1;
        text-align: center;
      }
    }
  }


  &-month {
    &__title {
      display: flex;
      flex-direction: column;
      font-size: 14px;
      line-height: 42px;
      height: 42px;
      color: $hy-text-color--2;
      text-align: center;
      font-weight: bold;
    }

    /* 内容样式 */
    &-wrapper {
      margin-top: 4px;
    }

    &__days {
      position: relative;
      @include flex;
      flex-wrap: wrap;

      &__month-mark-wrapper {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        @include flex;
        justify-content: center;
        align-items: center;

        &__text {
          font-size: 155px;
          color: $hy-text-color--4;
        }
      }

      &__day {
        @include flex;
        padding: 2px;
        /* #ifndef APP-NVUE */
        // vue下使用css进行宽度计算，因为某些安卓机会无法进行js获取父元素宽度进行计算得出，会有偏移
        width: calc(100% / 7);
        box-sizing: border-box;
        /* #endif */

        &__select {
          flex: 1;
          @include flex;
          align-items: center;
          justify-content: center;
          position: relative;
          &--selected {
            background-color: $hy-primary;
            @include flex;
            justify-content: center;
            align-items: center;
            flex: 1;
            border-radius: 3px;
            @include m(center) {
              border-radius: 0;
              background-color: $hy-primary-light;
              color: $hy-primary;
            }
          }

          &__dot {
            width: 7px;
            height: 7px;
            border-radius: 100px;
            background-color: $hy-error;
            position: absolute;
            top: 12px;
            right: 7px;
          }

          &__buttom-info {
            color: $hy-text-color--2;
            text-align: center;
            position: absolute;
            bottom: 5px;
            font-size: 10px;
            left: 0;
            right: 0;

            &--selected {
              color: #ffffff;
            }

            &--disabled {
              background-color: $hy-primary-disabled;
            }
          }

          &__info {
            text-align: center;
            font-size: 16px;

            &--selected {
              color: #ffffff;
              background-color: $hy-primary;
            }

            &--disabled {
              color: $hy-text-color--disabled;
            }
          }

          &--range-selected {
            opacity: 0.3;
            border-radius: 0;
          }

          &--range-start-selected {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
          }

          &--range-end-selected {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
          }
        }
      }
    }
  }
}