@import '../variable';

.cdk-overlay-container,
.cdk-global-overlay-wrapper {
  pointer-events: none;

  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}

.cdk-overlay-container {
  position: fixed;
  z-index: $cdk-z-index-overlay-container;

  &:empty {
    display: none;
  }
}

.cdk-global-overlay-wrapper {
  display: flex;
  position: absolute;
  z-index: $cdk-z-index-overlay;
}

.cdk-overlay-pane {
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  z-index: $cdk-z-index-overlay;

  display: flex;
  max-width: 100%;
  max-height: 100%;
}

.cdk-overlay-backdrop {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;

  z-index: $cdk-z-index-overlay-backdrop;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  transition: opacity $backdrop-animation-duration $backdrop-animation-timing-function;
  opacity: 0;

  &.cdk-overlay-backdrop-showing {
    opacity: 1;

    @media screen and (-ms-high-contrast: active) {
      opacity: 0.6;
    }
  }
}

.cdk-overlay-dark-backdrop {
  background: $cdk-overlay-dark-backdrop-background;
}

.cdk-overlay-transparent-backdrop {
  &,
  &.cdk-overlay-backdrop-showing {
    opacity: 0;
  }
}

.cdk-overlay-connected-position-bounding-box {
  position: absolute;
  z-index: $cdk-z-index-overlay;

  display: flex;

  flex-direction: column;

  min-width: 1px;
  min-height: 1px;
}

.cdk-global-scrollblock {
  position: fixed;

  width: 100%;

  overflow-y: scroll;
}

.app-datepicker-dialog-container {
  position: relative;
  pointer-events: auto;
  box-sizing: border-box;
  display: block;
  padding: 1.5em;
  box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  overflow: hidden;
  background: #fff;
  color: rgba(0, 0, 0, 0.87);
  width: 100%;
  height: 100%;
  outline: none;
}

$theme-color: #3f51b5;

.datepicker-dt-container,
.datepicker-dt-container * {
  box-sizing: border-box;
}

.datepicker-dt-container {
  display: block;
  font-size: 1rem;
  background: #ffffff;
  pointer-events: auto;
  z-index: 1051;
}

.datepicker-dt-container-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);

  &:last-child {
    border-bottom: none;
  }
}

.datepicker-dt-calendar {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.datepicker-dt-calendar-control {
  display: flex;
  align-items: center;
  font-size: 1em;
  width: 100%;
  padding: 0.5em;
  color: #000000;

  .datepicker-dt-calendar-control-content {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;

    .datepicker-dt-calendar-control-button {
      padding: 0 0.8em;

      &:hover {
        background-color: rgba(0, 0, 0, 0.12);
      }
    }
  }
}

.datepicker-dt-calendar-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 0 0.5em 0.5em;
  outline: 0;
}

.datepicker-dt-calendar-view {
  display: block;
  flex: 1 1 auto;
}

.datepicker-dt-calendar-multi-year-view {
  display: flex;
  align-items: center;

  .datepicker-dt-calendar-table {
    width: calc(100% - 3em);

    .datepicker-dt-calendar-header th {
      padding-bottom: 0.25em;
    }
  }
}

.datepicker-dt-calendar-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;

  .datepicker-dt-calendar-header {
    color: rgba(0, 0, 0, 0.4);

    .datepicker-dt-weekdays {
      th {
        font-size: 0.7em;
        font-weight: 400;
        text-align: center;
        padding-bottom: 1em;
      }
    }

    .datepicker-dt-calendar-table-divider {
      position: relative;
      height: 1px;
      padding-bottom: 0.5em;

      &:after {
        content: '';
        position: absolute;
        top: 0;
        left: -0.5em;
        right: -0.5em;
        height: 1px;
        background: rgba(0, 0, 0, 0.12);
      }
    }
  }

  .datepicker-dt-calendar-cell {
    position: relative;
    height: 0;
    line-height: 0;
    text-align: center;
    outline: 0;
    color: rgba(0, 0, 0, 0.85);
    -webkit-appearance: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-tap-highlight-color: transparent;
  }

  .datepicker-dt-calendar-cell-content {
    position: absolute;
    top: 5%;
    left: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 90%;
    height: 90%;
    font-size: 0.8em;
    line-height: 1;
    border: 1px solid transparent;
    border-radius: 999px;
    color: inherit;
    cursor: pointer;
  }

  .datepicker-dt-calendar-cell-out {
    opacity: 0.2;
  }

  .datepicker-dt-calendar-cell-today:not(.datepicker-dt-calendar-cell-selected) {
    border-color: rgba(0, 0, 0, 0.4);
  }

  .datepicker-dt-calendar-cell-selected {
    color: hsla(0, 0%, 100%, 0.85);
    background-color: $theme-color;

    &.datepicker-dt-calendar-cell-today {
      box-shadow: inset 0 0 0 1px hsla(0, 0%, 100%, 0.85);
    }
  }

  .datepicker-dt-calendar-cell-disabled {
    cursor: default;

    & > .datepicker-dt-calendar-cell-content:not(.datepicker-dt-calendar-cell-selected) {
      color: rgba(0, 0, 0, 0.4);
    }

    & > .datepicker-dt-calendar-cell-content.datepicker-dt-calendar-cell-selected {
      opacity: 0.4;
    }

    & > .datepicker-dt-calendar-cell-today:not(.datepicker-dt-calendar-cell-selected) {
      border-color: rgba(0, 0, 0, 0.2);
    }
  }

  .datepicker-dt-calendar-cell-active:focus > .datepicker-dt-calendar-cell-content:not(.datepicker-dt-calendar-cell-selected),
  :not(.datepicker-dt-calendar-cell-disabled):hover > .datepicker-dt-calendar-cell-content:not(.datepicker-dt-calendar-cell-selected) {
    background-color: rgba(0, 0, 0, 0.04);
  }

  .datepicker-dt-calendar-cell-in-range {
    background: rgba($theme-color, 0.2);

    &.datepicker-dt-calendar-cell-range-from {
      border-top-left-radius: 999px;
      border-bottom-left-radius: 999px;
    }

    &.datepicker-dt-calendar-cell-range-to {
      border-top-right-radius: 999px;
      border-bottom-right-radius: 999px;
    }
  }
}

.datepicker-dt-timer {
  display: flex;
  justify-content: center;
  width: 100%;
  height: 7em;
  padding: 0.5em;
  outline: none;
}

.datepicker-dt-timer-box {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  width: 50%;
}

.datepicker-dt-timer-content {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0.2em 0;

  .datepicker-dt-timer-input {
    display: block;
    width: 2em;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    outline: medium none;
    font-size: 1.2em;
    padding: 0.2em;
  }
}

.datepicker-dt-timer-divider {
  display: inline-block;
  align-self: flex-end;
  position: absolute;
  width: 0.6em;
  height: 100%;
  left: -0.3em;

  &:before,
  &:after {
    content: '';
    display: inline-block;
    width: 0.35em;
    height: 0.35em;
    position: absolute;
    left: 50%;
    border-radius: 50%;
    transform: translateX(-50%);
    background-color: currentColor;
  }

  &:before {
    top: 35%;
  }

  &:after {
    bottom: 35%;
  }
}

.datepicker-dt-control-button {
  user-select: none;
  cursor: pointer;
  outline: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: baseline;
  margin: 0;
  padding: 0;
  background-color: transparent;
  font-size: 1em;
  color: inherit;

  .datepicker-dt-control-button-content {
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    outline: none;
  }
}

.datepicker-dt-control-period-button {
  .datepicker-dt-control-button-content {
    height: 1.5em;
    padding: 0 0.5em;
    border-radius: 3px;
    transition: background-color 100ms linear;
  }

  &:hover > .datepicker-dt-control-button-content {
    background-color: rgba(0, 0, 0, 0.12);
  }

  .datepicker-dt-control-button-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1em;
    height: 1em;
    margin: 0.1em;
    transition: transform 200ms ease;
  }
}

.datepicker-dt-control-arrow-button {
  .datepicker-dt-control-button-content {
    padding: 0;
    border-radius: 50%;
    width: 1.5em;
    height: 1.5em;
  }

  &[disabled] {
    color: rgba(0, 0, 0, 0.4);
    cursor: default;
  }

  svg {
    width: 50%;
    height: 50%;
    fill: currentColor;
  }
}

.datepicker-dt-inline-container {
  width: 100%;
}

.datepicker-dt-popup-container {
  box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);
  width: 100%;
}

.datepicker-dt-inline-container,
.datepicker-dt-popup-container {
  position: relative;

  & .datepicker-dt-calendar {
    height: 100%;
  }

  .datepicker-dt-calendar,
  .datepicker-dt-timer {
    width: 100%;
  }
}

.datepicker-dt-dialog-container {
  max-height: 95vh;
  margin: -1.5em;

  .datepicker-dt-calendar {
    min-width: 250px;
    min-height: 330px;
    max-width: 750px;
    max-height: 750px;
  }

  .datepicker-dt-timer {
    min-width: 250px;
    max-width: 750px;
  }
}

@media all and (orientation: landscape) {
  .datepicker-dt-dialog-container {
    .datepicker-dt-calendar {
      width: 58vh;
      height: 62vh;
    }

    .datepicker-dt-timer {
      width: 58vh;
    }
  }
}

@media all and (orientation: portrait) {
  .datepicker-dt-dialog-container {
    .datepicker-dt-calendar {
      width: 80vw;
      height: 80vw;
    }

    .datepicker-dt-timer {
      width: 80vw;
    }
  }
}

.datepicker-dt-container-buttons {
  display: flex;
  width: 100%;
  height: 2em;
  color: $theme-color;
}

.datepicker-dt-container-control-button {
  font-size: 1em;
  width: 50%;
  height: 100%;
  border-radius: 0;

  .datepicker-dt-control-button-content {
    height: 100%;
    width: 100%;
    transition: background-color 100ms linear;
  }

  &:hover {
    .datepicker-dt-control-button-content {
      background-color: rgba(0, 0, 0, 0.1);
    }
  }
}

.datepicker-dt-container-info {
  padding: 0 0.5em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;

  .datepicker-dt-container-range {
    outline: none;

    .datepicker-dt-container-range-content {
      display: flex;
      justify-content: space-between;
      padding: 0.5em 0;
      font-size: 0.8em;

      .datepicker-dt-container-info-label {
        background-color: $color-border-grey;
      }
    }

    &:last-child {
      border-top: 1px solid rgba(0, 0, 0, 0.12);
    }
  }

  .datepicker-dt-container-info-active {
    color: $theme-color;
  }
}

.datepicker-dt-container-disabled,
.datepicker-dt-trigger-disabled {
  opacity: 0.35;
  filter: Alpha(Opacity=35);
  background-image: none;
  cursor: default !important;
}

.datepicker-dt-timer-hour12 {
  display: flex;
  justify-content: center;
  align-items: center;
  color: $theme-color;

  .datepicker-dt-timer-hour12-box {
    border: 1px solid currentColor;
    border-radius: 2px;
    transition: background 200ms ease;

    .datepicker-dt-control-button-content {
      width: 100%;
      height: 100%;
      padding: 0.5em;
    }

    &:focus,
    &:hover {
      .datepicker-dt-control-button-content {
        background: $theme-color;
        color: #ffffff;
      }
    }
  }
}

.datepicker-dt-calendar-only-current-month {
  .datepicker-dt-calendar-cell-out {
    visibility: hidden;
    cursor: default;
  }
}

.datepicker-dt-inline {
  display: inline-block;
  margin-bottom: 10px;
}

.datepicker-dt-control {
  outline: none;
  cursor: pointer;

  .datepicker-dt-control-content {
    outline: none;
  }

  &:focus > .datepicker-dt-control-content {
    background-color: rgba(0, 0, 0, 0.12);
  }

  &:not(:-moz-focusring):focus > .datepicker-dt-control-content {
    box-shadow: none;
  }
}

.datepicker-hidden-accessible {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.datepicker-dt-dialog {
  min-height: 440px;
  min-width: 365px;
}

.datepicker-dt-inline {
  & .datepicker-dt-container {
    z-index: 0 !important;
    margin: 10px !important;
    font-size: 16px !important;
  }

  & .datepicker-dt-container-row {
    border-bottom: none;
  }

  & .datepicker-dt-container-row:last-child {
    display: none;
    border-bottom: none;
  }

  & .datepicker-dt-calendar-table {
    & .datepicker-dt-calendar-cell-selected {
      background: linear-gradient(194.58deg, #a5f2ea -12.52%, #13cfb1 123.24%);
    }
    .datepicker-dt-calendar-cell-in-range {
      background: #c4f2eb;
    }
  }
}
.input-date {
  i.fa-calendar {
    color: #495057;
    cursor: pointer;
    position: absolute;
    right: 10px;
    top: 15px;
  }
}
