@charset "UTF-8";
@import "../../style/function";
//-----------------------------------------------------
// datepicker
//-----------------------------------------------------

// 结构注释
//-----------------------------------------------------

// 变量
//-----------------------------------------------------
$calendarWidth: 250px;
$calendarHeight: 272px;
$calendarBorder: #afafaf;
$daySize: 34px;
$greedColor: #68b30f;
$greedColorSlight: #aed588;
$weekendColor: #e75407;
$disabledColor: #a0a0a0;
$weekHoverColor: #eff1f3;
$calendarBgDefault: #fff;
$calendarIconSize: 22px;
$defaultInputWidth: 165px;

.im-datepicker {
  display: inline-block;
}

.im-dp-input--wrap {
  position: relative;

  &:hover {
    .i-close {
      visibility: visible;
    }
  }

  input {
    cursor: pointer;
    width: $defaultInputWidth;
  }

  .im-dp-input--icon {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    padding-right: 5px;
    cursor: pointer;

    .icon-font {
      vertical-align: middle;
    }

    &:before {
      content: "";
      width: 0;
      height: 100%;
      font-size: 0;
      vertical-align: middle;
      display: inline-block;
    }
  }

  .i-calendar {
    font-size: 20px;
    color: $colorPlaceholder;
  }

  .i-close {
    font-size: 14px;
    color: $colorPlaceholder;
    visibility: hidden;
    margin-right: 2px;

    &:hover {
      color: $colorText;
    }
  }

  &.disabled {
    input {
      color: map-get($colorDisabled, text);
      cursor: default;
      border-color: map-get($colorDisabled, border);
    }

    .i-close {
      visibility: hidden;
    }

    .im-dp-input--icon {
      cursor: default;
    }
  }
}

.im-dp-calendar {
  border: 1px solid $calendarBorder;
  position: absolute;
  height: $calendarHeight;
  width: $calendarWidth;
  z-index: $zIndexPopup;
  background-color: $colorBg;

  &.hide {
    display: none;
  }

  &.im-dp-calendar--inline {
    display: block;
    position: relative;
  }
}

// 周选模式下hover效果调整
.im-dp-calendar--week {
  .im-dp-day:hover {
    background: none;
    color: inherit;
  }

  .im-dp-week:hover {
    .im-dp-day {
      background-color: $weekHoverColor;

      &.selected {
        background-color: $greedColor;
      }

      &.disabled {
        background: none;
      }
    }
  }
}

.im-dp-month {
  margin-left: ($calendarWidth - 7 * $daySize) / 2;

  &-bd {
    position: relative;
    z-index: 10;
  }

  &-bg {
    font-size: 160px;
    position: absolute;
    @include opacity(0.1);
    right: -2px;
    bottom: -10px;
    line-height: 1;
    z-index: 9;
  }
}

.im-dp-week {
  width: 100%;
  height: $daySize;
}

.im-dp-day {
  display: inline-block;
  width: $daySize;
  height: $daySize;
  line-height: $daySize;
  text-align: center;
  vertical-align: middle;
  user-select: none;

  &.disabled {
    color: $disabledColor;

    &:hover,
    &.selected--range {
      cursor: default;
      color: $disabledColor;
      background: none;
    }
  }

  &.selected {
    color: $colorBg;
    background-color: $greedColor;
  }

  &.today {
    border: 1px solid $greedColor;
    line-height: 32px;
    box-sizing: border-box;

    &.selected,
    &:hover,
    &.selected--range {
      border: 0;
      line-height: 34px;
    }
  }

  &:hover,
  &.selected--range {
    cursor: pointer;
    color: $colorBg;
    background-color: $greedColorSlight;
  }

  &.selected.selected--range {
    background-color: $greedColor;
  }
}

.im-dp-day--unvisual {
  display: inline-block;
  width: $daySize;
  height: $daySize;
  line-height: $daySize;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  visibility: hidden;
}

.im-dp-wtlist {
  margin: 0 ($calendarWidth - 7 * $daySize) / 2;
  border-bottom: 1px solid $colorBorder;
}

.im-dp-wt {
  display: inline-block;
  width: $daySize;
  height: $daySize;
  line-height: $daySize;
  text-align: center;
}

.im-dp-wt--weekend {
  color: $weekendColor;
}

.im-dp-op {
  font-weight: bolder;
  text-align: center;
  position: relative;
  margin-top: 8px;

  &-icon {
    position: absolute;
    display: inline-block;
    font-size: 40px;
    font-weight: 400;
    color: $color9;
    top: -5px;
    text-align: center;
    width: 34px;
    height: 30px;
    line-height: 22px;
    user-select: none;

    &:hover {
      cursor: pointer;
      color: $greedColor;
    }
  }

  .im-dp-icon--prev {
    left: 5px;
  }

  .im-dp-icon--next {
    right: 5px;
  }
}
