
@import "../../scss/theme/config";

.cd-date-picker, .cd-date-picker * {
  box-sizing: border-box;
}

.cd-date-picker {
  position: absolute;
  top: 0;
  left: 0;
  color: #606266;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .2);
  background: #fff;
  border-radius: 4px;
  margin: 5px 0;
  z-index: 66666666;
  font-size: 12px;

  .cd-date-picker-main {
    width: 272px;

    .cd-date-picker-input {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 5px 5px;
      font-size: 12px;
      box-sizing: border-box;
      border-bottom: 1px solid #e4e4e4;
      input {
        width: 50%;
        height: 32px;
        line-height: 32px;
        border-radius: 4px;
        border: 1px solid #dcdfe6;
        box-sizing: border-box;
        color: #606266;
        display: inline-block;
        outline: none;
        padding: 0 15px;
      }
      input:first-child {
        margin-right: 5px;
      }
    }

    .cd-date-picker-header {
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 30px;
      padding: 5px 22px;
      text-align: center;
      border-bottom: 1px solid #eeeeee;

      i {
        cursor: pointer;
      }

      .cd-date-picker-prev-m {
        margin-left: 20px;
      }
      .cd-date-picker-next-m {
        margin-right: 20px;
      }
      .cd-date-picker-set-ym {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        span:hover {
          color: $colorBtn;
        }
      }

    }
  }

  .cd-date-picker-content {
    position: relative;
    padding: 10px;
    border-top: none 0;
    border-bottom: none 0;

    .hide {
      display: none;
    }

    table {
      border-collapse: collapse;
      border-spacing: 0;
    }

    th {
      width: 36px;
      padding: 5px;
      color: #606266;
      font-weight: 400;
      border-bottom: 1px solid #eeeeee;
      text-align: center;
    }

    td {
      position: relative;
      cursor: pointer;
      width: 32px;
      height: 30px;
      padding: 4px 0;
      box-sizing: border-box;
      text-align: center;
      color: #666;
      div {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 33px;
        padding: 3px 0;
        text-align: center;
        box-sizing: border-box;
      }
      span {
        width: 24px;
        height: 24px;
        display: block;
        line-height: 24px;
        border-radius: 50%;
      }
      &:hover {
        color: $colorBtn;
      }
      &.cd-date-picker-selected {
        div {
          background-color: #fff6f0;
          border-radius: 0;
        }
      }

      &.end-date {
        div {
          border-radius: 0;
          background-color: #fff6f0;
          border-top-right-radius: 15px;
          border-bottom-right-radius: 15px;
        }
      }
      &.start-date {
        div {
          border-radius: 0;
          background-color: #fff6f0;
          border-top-left-radius: 15px;
          border-bottom-left-radius: 15px;
        }
      }
      &.current-date {
        span:hover {
          background-color: $colorBtn;
        }
      }
    }

    .cd-date-picker-tody {
      color: $colorBtn;
    }
    .cd-date-picker-day-prev,
    .cd-date-picker-day-next {
      color: #c0c4cc !important;
      div {
        background-color: #FFFFFF !important;
        border-radius: 0 !important;
      }
    }

    .cd-disable,
    .cd-disable:hover {
      background: none !important;
      color: #d2d2d2 !important;
      cursor: not-allowed !important;
      -moz-user-select: none;
      -webkit-user-select: none;
      -ms-user-select: none;
    }
  }

  .cd-date-picker-footer {
    position: relative;
    height: 46px;
    line-height: 26px;
    padding: 10px 20px;

    .cd-date-picker-footer-btns {
      position: absolute;
      right: 10px;
      top: 10px;

      .cd-date-picker-btns-clear {
        color: $colorBase;
        border: 0;
        &:hover {
          color: #dd2222;
        }
      }

      .cd-date-picker-btns-confirm {
        @include middleRedBtn();
      }
      span {
        margin-left: 10px;
      }
    }
  }

  .current-date {
    span {
      background-color: $colorBtn;
      color: #fff;
      border-radius: 50%;
    }
  }

  .cd-date-picker-list {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-color: #fff;
  }

  .cd-date-picker-list > li {
    position: relative;
    display: inline-block;
    width: 33.3%;
    height: 36px;
    line-height: 36px;
    margin: 3px 0;
    vertical-align: middle;
    text-align: center;
    cursor: pointer;
  }

  .cd-date-picker-list {
    transition-duration: .3s;
    &.cd-date-picker-year-list {
      li {
        margin: 10px 0;
      }
      li:hover {
        color: $colorBtn;
      }
    }
    &.cd-date-picker-month-list {
      li {
        //width: 25%; //一行四个
        margin: 17px 0;
      }
      li:hover {
        color: $colorBtn;
      }
    }

    &.cd-date-picker-time-list > li {
      width: 60px;
      height: 181px;
      margin-top: 1px;
      line-height: normal;
      cursor: default;
    }

    &.cd-date-picker-time-list > li:hover ol {
      overflow-y: auto;
    }

    .cd-date-picker-time-list > li:hover {
      background: none;
    }
    &.cd-date-picker-time-list {
      left: 84px;
      top: -46px;
      width: 182px;
      height: 210px;
      z-index: 999;
      background-color: #fff;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .2);
      border-radius: 2px;
      user-select: none;
      border-bottom: 0;
      .cd-date-picker-time-title {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 24px;
        border-bottom: 1px solid #eeeeee;
        .cd-item-title {
          display: flex;
          flex: 1;
          align-items: center;
          justify-content: center;
        }
      }
      li {
        &:first-child ol {
          border-left-width: 1px;
        }
        ol {
          margin: 0;
          padding: 0;
        }
      }
      ol {
        height: 181px;
        overflow: hidden;
        li {
          width: 130%;
          padding-left: 23px;
          line-height: 30px;
          text-align: left;
          cursor: pointer;
          &:hover {
            color: $colorBtn;
          }
          &.current-date {
            background-color: #fff6f0;
            color: $colorBtn;
          }
        }
      }
    }

    .cd-date-picker-list-footer {
      height: 45px;
      line-height: 45px;
      text-align: right;
      background-color: #fff;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.2);
      border-radius: 2px;
      .cd-date-picker-btns-confirm {
        display: inline-block;
        line-height: 25px;
        height: 25px;
        padding: 0 10px;
        margin: 0 10px;
        cursor: pointer;
        background-color: #f44336;
        border: 1px solid #f44336;
        border-radius: 2px;
        outline: none;
        font-size: 12px;
        color: #ffffff;
        &:hover {
          background-color: #dd2222;
          border: 1px solid #dd2222;
        }
      }

      .cd-date-picker-btns-clear {
        display: inline-block;
        border: none;
        line-height: 25px;
        height: 25px;
        padding: 0 5px;
        cursor: pointer;
        background-color: transparent;
        outline: none;
        font-size: 12px;
        color: #333333;
        &:hover {
          color: #dd2222;
        }
      }
    }
  }

}

.cd-date-picker-static {
  position: relative;
  z-index: 0;
  display: inline-block;
  margin: 0;
  -webkit-animation: none;
  animation: none;
}

.cd-date-picker-ym-show {
  .cd-date-picker-prev-m {
    margin-left: 20px;
    visibility: hidden !important;
  }
  .cd-date-picker-next-m {
    margin-right: 20px;
    visibility: hidden !important;
  }
  .cd-date-picker-prev-y,
  .cd-date-picker-next-y {
    display: inline-block !important;
  }

  .cd-date-picker-set-ym {
    span[date-type="month"] {
      display: none !important;
    }
  }
}

.cd-date-picker-day-mark {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  line-height: 30px;
  font-size: 12px;
  overflow: hidden;
}

.cd-date-picker-day-mark::after {
  position: absolute;
  content: '';
  right: 2px;
  top: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}


.cd-date-picker-hint {
  position: absolute;
  top: 115px;
  left: 30%;
  width: 250px;
  margin-left: -125px;
  line-height: 20px;
  padding: 15px;
  text-align: center;
  font-size: 12px;
  color: #FF5722;
}

.cd-date-picker-range {
  width: 546px;
  .cd-date-picker-main {
    display: inline-block;
    vertical-align: middle;
  }

  .cd-date-picker-main-list-0 {
    .cd-date-picker-next-m,
    .cd-date-picker-next-y {
      visibility: hidden;
    }
  }
  .cd-date-picker-main-list-1 {
    .cd-date-picker-prev-y,
    .cd-date-picker-prev-m {
      visibility: hidden;
    }

    .cd-date-picker-header {
      border-left: 1px solid #eeeeee;
    }
    .cd-date-picker-content {
      border-left: 1px solid #eeeeee;
    }
  }
}

.cd-date-picker-hint {
  color: #606266;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .2);
  background: #fff;
  border-radius: 4px;
  margin: 5px 0;
}

.cd-date-picker-footer {
  border-top: 1px solid #eeeeee;
}

.cd-date-picker-hint {
  color: #FF5722;
}
