/* date picker input style  */
.inspect-filter-widget-date {
  position: relative;
  text-overflow: ellipsis;
  input.daterange {
    width: 100%;
    height: 44px;
    margin: 0;
    font-size: 14px;
    border: 1px solid #dfdfdf;
    border-radius: 4px;
    padding-top: 0;
    padding-bottom: 0;
    &:focus {
      outline: none;
      box-shadow: none;
      border-color: #111827;
    }
    &:hover {
      border-color: #111827;
    }
    &[type="text"] {
      padding-left: 36px;
    }
  }
  .calender_icon {
    left: 12px;
    width: 16px;
    display: inline-block;
    img {
      width: 100%;
      vertical-align: top;
    }
  }
}

//  date picker calender default style
.daterangepicker {
  &.show-calendar {
    .drp-calendar {
      display: block;
    }
    .drp-buttons {
      display: block;
    }
  }

  &.auto-apply {
    .drp-buttons {
      display: none;
    }
  }

  &.drp-calendar {
    display: none;
    max-width: 270px;
    &.left {
      padding: 8px 0 8px 8px;
      @include from-sm {
        clear: left;
        margin-right: 0;
      }
      .calendar-table {
        padding-right: 8px;
      }
    }
    &.right {
      padding: 8px;
      @include from-sm {
        margin-left: 0;
      }
      .calendar-table {
        @include from-sm {
          border-left: none;
          border-top-left-radius: 0;
          border-bottom-left-radius: 0;
        }
      }
    }
    &.single {
      .calendar-table {
        border: none;
      }
    }
  }

  .calendar-table {
    border: 1px solid #fff;
    border-radius: 4px;
    background-color: #fff;
    @include from-sm {
      border-right: none;
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    &.next,
    &.prev {
      span {
        color: #fff;
        border: solid black;
        border-width: 0 2px 2px 0;
        border-radius: 0;
        display: inline-block;
        padding: 3px;
      }
    }
    &.next {
      transform: rotate(-45deg);
    }
    &.prev {
      transform: rotate(-45deg);
    }
    table {
      width: 100%;
      margin: 0;
      border-spacing: 0;
      border-collapse: collapse;
      th,
      td {
        text-align: center;
        vertical-align: middle;
        min-width: 32px;
        height: 24px;
        line-height: 24px;
        font-size: 12px;
        border-radius: 4px;
        border: 1px solid transparent;
        white-space: nowrap;
        cursor: pointer;
        &.available:hover {
          background-color: #eee;
          border-color: transparent;
          color: inherit;
        }
        &.week {
          font-size: 80%;
          color: #ccc;
        }
      }
      td {
        &.off {
          .in-range,
          .start-date,
          .end-date {
            background-color: #fff;
            border-color: transparent;
            color: #999;
          }
        }
        &.in-range {
          background-color: #ebf4f8;
          border-color: transparent;
          color: #000;
          border-radius: 0;
        }
        &.start-date {
          border-radius: 4px 0 0 4px;
          &.end-date {
            border-radius: 4px;
          }
        }
        &.end-date {
          border-radius: 0 4px 4px 0;
        }
        &.month {
          width: auto;
        }
        &.active,
        &.active:hover {
          background-color: #111827;
          border-color: transparent;
          color: #fff;
        }
        &.disabled {
          color: #999;
          cursor: not-allowed;
          text-decoration: line-through;
        }
      }
    }
  }

  select {
    &.hourselect,
    &.minuteselect,
    &.secondselect,
    &.ampmselect {
      width: 50px;
      margin: 0 auto;
      background: #eee;
      border: 1px solid #eee;
      padding: 2px;
      outline: 0;
      font-size: 12px;
    }

    &.monthselect,
    &.yearselect {
      font-size: 12px;
      padding: 1px;
      height: auto;
      margin: 0;
      cursor: default;
    }

    &.monthselect {
      margin-right: 2%;
      width: 56%;
    }

    &.yearselect {
      width: 40%;
    }
  }

  option {
    &.disabled {
      color: #999;
      cursor: not-allowed;
      text-decoration: line-through;
    }
  }

  .calendar-time {
    text-align: center;
    margin: 4px auto 0 auto;
    line-height: 30px;
    position: relative;
    select {
      &.disabled {
        color: #ccc;
        cursor: not-allowed;
      }
    }
  }

  .drp-buttons {
    clear: both;
    text-align: right;
    padding: 8px;
    border-top: 1px solid #ddd;
    display: none;
    line-height: 12px;
    vertical-align: middle;
    .btn {
      margin-left: 8px;
      font-size: 12px;
      font-weight: bold;
      padding: 4px 8px;
    }
  }

  .drp-selected {
    display: inline-block;
    font-size: 12px;
    padding-right: 8px;
  }

  &.show-ranges {
    &.single {
      &.rtl {
        .drp-calendar {
          &.left {
            border-right: 1px solid #ddd;
          }
          &.right {
            border-right: 1px solid #ddd;
          }
        }
      }
      &ltr {
        .drp-calendar {
          &.left {
            border-left: 1px solid #ddd;
          }
          &.left {
            border-left: 1px solid #ddd;
          }
        }
      }
    }

    &.rtl {
      .drp-calendar {
        &.right {
          border-right: 1px solid #ddd;
        }
      }
    }

    &ltr {
      .drp-calendar {
        &.left {
          border-left: 1px solid #ddd;
        }
      }
    }
  }

  &.show-calendar {
    .ranges {
      margin-top: 8px;
    }
  }

  .ranges {
    float: none;
    text-align: start;
    margin: 0;
    @include from-sm {
      float: left;
    }
    ul {
      list-style: none;
      margin: 0 auto;
      padding: 0;
      width: 100%;
      @include from-sm {
        width: 140px;
      }
      li {
        font-size: 12px;
        padding: 8px 12px;
        cursor: pointer;
        &:hover {
          background-color: #eee;
        }
        &.active {
          background-color: #08c;
          color: #fff;
        }
      }
    }
  }
}

/* date picker calendar extended style  */
.daterangepicker {
  max-width: 660px;
  width: 100%;
  position: absolute;
  color: inherit;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #ddd;
  padding: 0;
  margin-top: 7px;
  top: 100px;
  left: 20px;
  z-index: 3001;
  display: none;
  font-family: arial;
  font-size: 15px;
  line-height: 1em;
  @include from-sm {
    direction: ltr;
    text-align: start;
  }

  &::before,
  &::after {
    position: absolute;
    display: inline-block;
    border-bottom-color: rgba(0, 0, 0, 0.2);
    content: "";
  }

  &::before {
    top: -7px;
    border-right: 7px solid transparent;
    border-left: 7px solid transparent;
    border-bottom: 7px solid #ccc;
  }

  &::after {
    top: -6px;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #fff;
    border-left: 6px solid transparent;
  }

  &.opensleft {
    &::before {
      right: 9px;
    }
    &::after {
      right: 10px;
    }
  }

  &.openscenter {
    &::before {
      left: 0;
      right: 0;
      width: 0;
      margin-left: auto;
      margin-right: auto;
    }
    &::after {
      left: 0;
      right: 0;
      width: 0;
      margin-left: auto;
      margin-right: auto;
    }
  }

  &.opensright {
    &::before {
      left: 9px;
    }
    &::after {
      left: 10px;
    }
  }

  &.drop-up {
    margin-top: -7px;
    &::before {
      top: initial;
      bottom: -7px;
      border-bottom: initial;
      border-top: 7px solid #ccc;
    }
    &::after {
      top: initial;
      bottom: -6px;
      border-bottom: initial;
      border-top: 6px solid #fff;
    }
  }

  &.single {
    .drp-selected {
      display: none;
    }
    .ranges,
    .drp-calendar {
      float: none;
      @include from-sm {
        float: left;
      }
    }
    .ranges {
      ul {
        @include from-sm {
          width: 100%;
        }
      }
    }
    .drp-calendar {
      &.left {
        @include from-sm {
          clear: none;
        }
      }
    }
  }

  table.table-condensed {
    thead {
      tr {
        th {
          background-color: #f3f4f6;
          border-radius: 0;
          border: none;
        }
        .month {
          color: #111827;
          font-size: 18px;
          font-weight: 700;
        }
      }
    }
    tbody {
      tr {
        td {
          padding: 0;
          padding-top: 10px;
          padding-bottom: 8px;
          &.in-range {
            background-color: #f3f4f6;
          }
          &.start-date,
          &.end-date,
          &.active {
            background-color: #111827;
          }
        }
      }
    }
  }

  .drp-calendar {
    &.right,
    &.left {
      max-width: 100%;
      width: 100%;
      padding: 0;
      @include from-sm {
        width: 50%;
      }
    }
    &.left {
      float: left;
      @include from-sm {
        width: calc(50% - 1px);
        border-right: 1px solid #dfdfdf;
      }
      .calendar-table {
        padding-right: 0;
        border-right: 0;
      }
      .table-condensed {
        border-radius: 0;
        border: 1px solid #e5e7eb;
        border-right: 0;
        thead {
          border-right: 1px solid #f3f4f6;
        }
      }
    }
    &.right {
      float: right;
      padding-left: 0;
      .calendar-table {
        border-radius: 0;
        border-left: 0;
      }
      .table-condensed {
        border-radius: 0;
        border: 1px solid #e5e7eb;
        border-left: 0;
        thead {
          border-left: 1px solid #f3f4f6;
        }
        .next {
          border: 1px solid;
          border-color: #e5e7eb #e5e7eb #f3f4f6 #f3f4f6;
        }
      }
    }
  }

  .drp-buttons {
    clear: both;
    .drp-selected {
      display: none;
      @include from-sm {
        display: inline-block;
      }
    }
    .btn {
      color: #111827;
      border-radius: 4px;
      background-color: #ffffff;
      border: none;
      border-radius: 4px;
      padding: 8px 18px;
      outline: none;
      font-size: 14px;
      font-weight: 500;
      &.applyBtn:hover {
        background-color: #111827;
        color: #ffffff;
      }
      &.cancelBtn:hover {
        background-color: #111827;
        color: #ffffff;
      }
    }
  }

  .ranges {
    display: none;
  }
}
