%customscrollbar {
  overflow-y: auto;

  &::-webkit-scrollbar-thumb {
    background-color: transparent;

    &:hover {
      border-radius: 9px;
      background-clip: initial;
    }
  }

  &:hover {
    &::-webkit-scrollbar-thumb {
      border-radius: 9px;
      border: solid 6px transparent;
      background-clip: content-box;
      background-color: rgba(#98a3a6, 0.8);
    }
  }

  &::-webkit-scrollbar {
    width: $scrollbar-width;
  }

  &::-webkit-scrollbar-track {
    box-shadow: none !important;
    background-color: transparent;
  }
}

ui-scheduler {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.scheduler {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  &-layout {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    overflow: hidden;
  }

  &-content,
  &-header,
  &-toolbar-container {
    display: flex;
    flex-grow: 0;
  }

  &-content {
    flex-grow: 1;
    overflow-x: visible;
    @extend %customscrollbar;
  }

  &-container {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  &-column {
    border-width: 0 1px 0 1px;
    border-style: solid;
    overflow-y: visible;
    display: block;
    height: fit-content;
    border-right: none;
    min-width: 25px;
    flex-basis: 25px;
    flex-grow: 1;
    padding: 0;
    margin: 0;

    [class*="Timeline"] &:first-child {
      display: none;
    }

    [class*="Timeline"] &-header {
      width: 70px;
      min-width: 70px;
      justify-content: center;
      padding: 0;

      &:first-child {
        display: none;
      }
    }

    &:first-child {
      min-width: initial;
      flex-grow: 0;
    }

    &:nth-last-child(1) {
      margin-right: calc(20px - #{$scrollbar-width});
      border-right-width: 1px;
      border-right-style: solid;
    }

    &-header {
      padding-top: 5px;
      padding-bottom: 5px;
      border-width: 1px 0 1px 1px;
      border-style: solid;
      min-width: 25px;
      flex-basis: 25px;
      flex-grow: 1;
      display: inline-flex;
      align-items: center;
      flex-direction: column;

      span {
        font-weight: 700;
      }

      &:first-child {
        flex-grow: 0;
        min-width: initial;
      }

      &:nth-last-child(1) {
        margin-right: 20px;
        border-right-width: 1px;
        border-right-style: solid;
      }
    }

    &,
    &-header {
      &.last-day-for-week {
        border-right: 2px solid;
      }
    }
  }

  &-cell {
    width: 100%;
    height: $scheduler-cell-height;
    border-style: solid;
    border-width: 0px 0 1px 0;

    [class*="TimelineMonth"] &,
    [class*="TimelineMonth"] &:nth-child(odd) {
      border-width: 0 0 0 0;
    }

    &:nth-child(odd) {
      border-bottom-style: dotted;
      border-bottom-width: 2px;
    }
  }

  &-unplanned {
    &-container {
      @extend %customscrollbar;
      width: auto;
      min-width: fit-content;

      ui-sidebar {
        height: 100%;

        .ui-sidebar__body {
          padding-top: 15px;
        }
      }
    }

    &-events {
      padding-top: 15px;
      padding-right: 15px;
      padding-bottom: 15px;
      overflow-y: auto;
      @extend %customscrollbar;
    }
  }

  &-event {
    text-align: center;
    display: grid;
    width: 100%;
    height: $scheduler-cell-height;
    position: relative;
    border-left: solid 5px;
    margin-bottom: 6px;
    border-radius: 3px;
    padding: 2px;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    font-size: 13px;
    overflow: visible;
    z-index: 1;

    >* {
      overflow: hidden;
    }

    div.row {
      margin: 0 !important;

      div.col {
        padding: 0 !important;
      }
    }

    .btn-floating {
      position: absolute;
      top: 3px;
      right: 3px;
      opacity: 0;
      height: 25px;
      width: 25px;
      line-height: 25px;
      border-radius: 25%;

      >i {
        line-height: 25px;
        font-size: 25px;
      }
    }

    .intervention-menu {
      >li {
        min-height: 30px;

        >a {
          padding: 7px 8px;
        }
      }
    }

    &:last-child {
      margin-bottom: 0;
    }

    &:hover {
      .btn-floating {
        opacity: 1;
      }
    }

    &.draggable {
      cursor: grab;
    }
  }

  &-draggable {
    position: relative;

    &[data-open="true"] {
      z-index: 2;
      overflow-y: visible;
      max-height: none !important;
      height: fit-content !important;

      .scheduler-show-more {
        position: relative;
      }
    }

    &[data-open="false"] {
      overflow-y: clip;

      .scheduler-show-more {
        position: absolute;
        bottom: 0;
      }
    }

    .scheduler-show-more {
      height: 20px;
      width: 100%;
      z-index: 1;
    }

    .scheduler-show-more-btn {
      cursor: pointer;
      border: solid 1px;
      text-align: center;
      border-radius: 3px;
      margin: 2px;
      font-size: small;
      line-height: 14px;
      height: -webkit-fill-available;
      overflow: hidden;
    }
  }

  &-toolbar {
    &-container {
      border-width: 1px;
      border-style: solid;
      margin-right: 20px;
      padding-right: 10px;

      ui-toolbar {
        display: flex;
        align-items: center;
        flex-grow: 1;

        .toolbar-datepicker {
          &-wrapper {
            display: flex;

            ui-input {
              min-width: 90px;
            }

            ui-button {
              min-width: 110px;
            }
          }
        }
      }
    }
  }
}

[class*="Timeline"] {
  &.scheduler {
    overflow-x: auto;

    .scheduler-column,
    .scheduler-column-header {
      min-width: 25px;
      flex-basis: 25px;
      flex-grow: 1;

      &.group {
        min-width: 200px;
      }
    }

    .scheduler-content {
      overflow: scroll;
    }

    .scheduler-container {
      overflow: hidden;
      min-height: 400px;
    }

    .scheduler-cell {
      height: $scheduler-cell-height + 40px;
    }
  }
}

[class*="TimelineMonth"] {
  &.scheduler {
    .scheduler-container {
      margin-right: 20px;
    }
  }
}

.scheduler-unplanned-events .scheduler-event {
  height: 85px;
}

.TimelineWeek {
  .scheduler-content {
    height: 100%;
  }

  .draggable {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    height: inherit;
    @extend %customscrollbar;
  }
}

.TimelineDay {
  .scheduler-column:not(.group) {
    .scheduler-cell>div {
      display: flex;
      flex-direction: column;
      height: 100%;
    }
  }
}

.Week {
  .scheduler-event {
    position: absolute;
    left: 0;
    right: 0;
  }
}

.gu-mirror {
  position: fixed !important;
  margin: 0 !important;
  z-index: 9999 !important;
  opacity: 0.8;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
  filter: alpha(opacity=80);
  cursor: grabbing;

  &.gu-copy {
    cursor: copy;
  }
}

.gu-hide {
  display: none !important;
}

.gu-unselectable {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

.gu-transit {
  opacity: 0.2;
  margin-left: 0 !important;
  width: 100% !important;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
  filter: alpha(opacity=20);
}