/*!
 * Datetimepicker for Bootstrap 3
 * version : 4.17.42
 * https://github.com/Eonasdan/bootstrap-datetimepicker/
 */

.bootstrap-datetimepicker-widget {
  list-style: none;

  &.dropdown-menu {
    margin: 2px 0;
    padding: 4px;
    width: 19em;

    &:before, &:after {
      content: '';
      display: inline-block;
      position: absolute;
    }

    &.bottom {
      &:before {
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-bottom: 7px solid #cccccc;
        border-bottom-color: rgba(0, 0, 0, 0.2);
        top: -7px;
        left: 7px;
      }

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

    &.top {
      &:before {
        border-left: 7px solid transparent;
        border-right: 7px solid transparent;
        border-top: 7px solid #cccccc;
        border-top-color: rgba(0, 0, 0, 0.2);
        bottom: -7px;
        left: 6px;
      }

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

    &.pull-right {
      &:before {
        left: auto;
        right: 6px;
      }

      &:after {
        left: auto;
        right: 7px;
      }
    }
  }

  .list-unstyled {
    margin: 0;
  }

  .timepicker-hour, .timepicker-minute, .timepicker-second {
    width: 4 * $fs-normal;
    font-weight: bold;
    font-size: 1.2em;
    margin: 0;
  }

  button[data-action] {
    padding: $default-gap;
  }

  .picker-switch {
    text-align: center;

    &::after {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      border: 0;
      content: "Toggle Date and Time Screens";
    }

    td {
      padding: 0;
      margin: 0;
      height: auto;
      width: auto;
      line-height: inherit;

      span {
        line-height: 2.5;
        height: 2.5em;
        width: 100%;
      }
    }
  }

  table {
    width: 100%;
    margin: 0;

    td {
      text-align: center;
      border-radius: $default-border-radius;
    }

    th {
      text-align: center;
      border-radius: $default-border-radius;
      height: 20px;
      line-height: 20px;
      width: 20px;

      &.picker-switch {
        width: 145px;
      }

      &.disabled {
        background: none;
        color: $neutral-color;
        cursor: not-allowed;

        &:hover {
          background: none;
          color: $neutral-color;
          cursor: not-allowed;
        }
      }

      &.prev::after {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
        content: "Previous Month";
      }

      &.next::after {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
        content: "Next Month";
      }
    }

    thead tr:first-child th {
      cursor: pointer;

      &:hover {
        background: background-hover($white);
      }
    }

    td {
      height: 4 * $fs-normal;
      line-height: 4 * $fs-normal;
      width: 4 * $fs-normal;

      &.separator {
        width: 2 * $fs-normal;
      }

      &.cw {
        font-size: .8em;
        height: 20px;
        line-height: 20px;
        color: $neutral-color;
      }

      &.day {
        height: 20px;
        line-height: 20px;
        width: 20px;

        &:hover {
          background: background-hover($white);
          cursor: pointer;
        }
      }

      &.hour:hover, &.minute:hover, &.second:hover {
        background: background-hover($white);
        cursor: pointer;
      }

      &.old, &.new {
        color: $neutral-color;
      }

      &.today {
        position: relative;

        &:before {
          content: '';
          display: inline-block;
          border: solid transparent;
          border-width: 0 0 7px 7px;
          border-bottom-color: $active-color;
          border-top-color: rgba(0, 0, 0, 0.2);
          position: absolute;
          bottom: 4px;
          right: 4px;
        }
      }

      &.active {
        background-color: $active-color;
        color: $white;
        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);

        &:hover {
          background-color: $active-color;
          color: $white;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
        }

        &.today:before {
          border-bottom-color: $white;
        }
      }

      &.disabled {
        background: none;
        color: $neutral-color;
        cursor: not-allowed;

        &:hover {
          background: none;
          color: $neutral-color;
          cursor: not-allowed;
        }
      }

      span {
        display: inline-block;
        height: 4 * $fs-normal;
        line-height: 4 * $fs-normal;
        width: 4 * $fs-normal;
        margin: 2px 1.5px;
        cursor: pointer;
        border-radius: $default-border-radius;

        &.active {
          background-color: $active-color;
          color: $white;
          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
        }

        &.old {
          color: $neutral-color;
        }

        &.disabled {
          background: none;
          color: $neutral-color;
          cursor: not-allowed;

          &:hover {
            background: none;
            color: $neutral-color;
            cursor: not-allowed;
          }
        }
      }
    }
  }

  &.usetwentyfour td.hour {
    height: 27px;
    line-height: 27px;
  }

  &.wider {
    width: 21em;
  }

  .datepicker-decades .decade {
    line-height: 1.8em !important;
  }
}

@media (min-width: 768px) {
  .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
    width: 38em;
  }
}

@media (min-width: 992px) {
  .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
    width: 38em;
  }
}

@media (min-width: 1200px) {
  .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
    width: 38em;
  }
}

.input-group.date .input-group-addon {
  cursor: pointer;
}

.bootstrap-datetimepicker-widget {
  .icon {
    @include is-icon;
  }
  &.timepicker-sbs {
    > .row {
      display: flex;
      flex-direction: row;
      > .timepicker {
        display: inline-flex;
        align-items: center;
        table {
          tbody {
            border: none;
            tr {
              td {
                border: none;
              }
            }
          }
        }
      }
    }
  }
}

.no-arrow-date-input::-webkit-calendar-picker-indicator, .no-arrow-date-input::-webkit-inner-spin-button, .no-arrow-date-input::-webkit-clear-button {
  display: none;
}
