@import 'modules/app/viewports';

.drawer-header {
  max-height: var(--main-menu-height);
  box-shadow: none;
}

.app-body {
  display: flex;
  flex-direction: row;

  & .app__name {
    display: none;
  }

  &.gray-theme .app__name {
    position: absolute;
    bottom: -4px;

    display: block;

    font-size: 12px;
    font-weight: 400;
    color: var(--color-gray-222);
  }
}

.cmf-time-tracker-widget {
  position: fixed;
  z-index: 1000;
  right: 75px;
  bottom: 12px;

  background-color: var(--app-bg-color-l1);
}

.admin-alarm-button {
  position: absolute;
  z-index: 9999;
  bottom: 5px;
  left: 50%;
  transform: translateX(calc(-50% - 160px));

  color: #fff;

  background: var(--default-color-red);
}

.hidden {
  display: none;
}

app-cmf-navigate-panel {
  width: 100%;
}

.acl-admin-mode-state {
  display: flex;
  align-items: center;

  &.disabled {
    pointer-events: none;
    opacity: 0.6;
  }
}

.hidden {
  visibility: hidden;
}

.app-body,
.app-navbar-container {
  min-height: 100% !important;
}

.drawer-container {
  width: 100%;
  max-height: 100vh;
  background: transparent;

  .drawer {
    @include viewport-mobile {
      width: 100%;
    }

    @include viewport-laptop {
      width: 100%;
    }

    width: 19%;
    min-width: 250px;
    border-right: 0;
  }

  .drawer-content {
    @include viewport-mobile {
      overflow: auto;
    }

    @include viewport-laptop {
      overflow: auto;
    }

    overflow: hidden;
    display: flex;
    flex-direction: row;

    height: 100vh;

    background-color: var(--user-content-bg-color, var(--color-gray-fff));

    &.displaced {
      height: calc(100vh - 50px);
      margin-top: 50px;
    }
  }
}

.avatar__main,
.app-person-status {
  cursor: pointer;

  position: absolute;
  z-index: 1;
  top: 11px;
  right: 30px;
}

// Sticky чтобы при scrollIntoView меню не смещалось вверх
// TODO: разобраться почему съезжает
.main__menu {
  position: sticky;
  top: 0;
}

.logo {
  user-select: none;

  position: relative;
  left: 10px;

  display: flex;
  align-items: center;
  margin-left: 13px;
  padding: 10px;
  padding-right: 12px;
  padding-left: 0;

  font-size: 17px;
  font-weight: 500;
  color: var(--menu-logo-color);
  text-decoration: none;

  .logo-wrapper {
    transform: scale(-1, 1);

    display: block;

    width: 41px;
    height: 35px;

    background-image: var(--app-logo);
    background-repeat: no-repeat;
    background-size: var(--app-bg-logo-size);
  }
}

.logo-text {
  //
  position: relative;
  top: 7px;
  left: -10px;

  font-size: 22px;
  font-weight: 600;
  color: #e04200;
  letter-spacing: 2px;
}

.left {
  @include viewport-mobile {
    width: auto;
    margin-left: auto;
  }

  @include viewport-laptop {
    width: 100%;

    // margin-left: auto;
  }

  display: flex;
  align-items: center;
  justify-content: flex-end;

  width: 100%;
  height: 48px;
  padding-top: 10px;

  &.height-null {
    height: 0;
    padding-top: 0;
  }

  /* Фикс для кнопок тулбара документа "Опубликовать", "Сохранить черновик", "Отмена" */

  @media screen and (width <= 1640px) {
    width: 100%;

    // margin-left: auto;
  }
}

.right {
  @include viewport-mobile {
    padding-right: 0;
  }

  @include viewport-laptop {
    margin-right: 10px;
    padding-right: 0;
  }

  display: flex;
  align-items: center;
  justify-content: flex-end;

  padding-top: 10px;
  padding-right: 25px;

  /* Фикс для кнопок тулбара документа "Опубликовать", "Сохранить черновик", "Отмена" */

  @media screen and (width <= 1640px) {
    margin-right: 10px;
    padding-right: 0;
  }
}

.toolbar {
  display: flex;
  align-items: center;
  margin-right: 0;
}

.add-button-task {
  cursor: pointer;
  display: block;
  margin-left: auto;
  border-radius: 50%;

  .add-button-icon {
    cursor: pointer;
    display: flex;
  }
}

::ng-deep {
  .simplebar-placeholder {
    width: auto !important;
  }

  .simplebar-scrollbar::before {
    background-color: #a3a7a9 !important;
  }

  .toolbar-item {
    @include viewport-mobile {
      margin-right: 0;
    }

    cursor: pointer;
    user-select: none;

    position: relative;

    font-size: 14px;
    font-weight: 400;

    &.selected {
      text-decoration: underline;
      text-underline-position: under;
    }
  }

  .toolbar-item-filter-button {
    padding-right: 6px;
  }

  .toolbar-item-icon {
    position: relative;
    top: 5px;
    padding-right: 4px;
  }
}

.add-item-icon {
  position: relative;
  top: 5px;
  padding-right: 10px;
}

.app-toolbar {
  @include viewport-laptop {
    overflow-y: hidden;
    display: flex;
    align-items: center;
  }

  @include viewport-mobile {
    overflow-y: hidden;
    display: flex;
    align-items: center;

    padding-top: 10px;
    padding-bottom: 5px;
  }

  /* background:#365464; */
  // background: #f1f3f4;
  z-index: 10;

  display: flex;
  justify-content: space-between;

  max-width: calc(100vw - 70px);
  height: 61px;
  margin: 0 auto;
  padding: 0;

  line-height: 50px;

  // box-shadow: 0px 2px 3px -1px rgb(0 0 0 / 9%), 0px 1px 3px 0px rgb(0 0 0 / 10%), 0px 1px 1px 0px rgb(0 0 0 / 8%);
  color: #777;

  background-color: var(--app-toolbar-bg-color);
  border-bottom: 1px solid var(--border-primary-color);

  .body-event-icon-wrapper {
    cursor: pointer;
    display: flex;
    padding: 4px;
    border-radius: 50%;

    &:hover {
      background-color: #f1f3f4;
    }

    .body-event-icon {
      display: flex;
    }
  }

  .body-chat-icon-wrapper {
    cursor: pointer;
    display: flex;
    padding: 4px;
    border-radius: 50%;

    &:hover {
      background-color: #f1f3f4;
    }

    .body-chat-icon {
      display: flex;
    }
  }

  .all-counter-menu-item {
    position: relative;
    right: 4px;
    bottom: 15px;

    font-size: 14px;
    color: rgb(188 52 38);
  }

  .menu-item {
    margin-right: 20px;
  }

  .content-toolbar {
    display: inline-flex;
    flex-direction: row;
  }

  .app-current-person a {
    cursor: pointer;
    font-size: 14px;
    color: #777;
    text-decoration: none;
  }

  .app-current-person-avatar {
    position: relative;
    top: 3px;
    left: 3px;
    font-size: 20px;
  }

  app-cmf-gravatar {
    position: relative;
    top: 4px;
  }

  .search-icon {
    position: relative;
    top: 7px;
  }

  &.is-penalty {
    background: #ff3838;
  }
}

.app-cmf-navbar {
  padding-top: 64px;
}

.app-person-status {
  position: absolute;
  z-index: 20;
  top: 24px;
  left: 42px;

  width: 14px;
  min-width: 14px;
  height: 14px;

  background: #ececec;
  border: solid 2px #fff;
  border-radius: 50%;

  &.status-online {
    background: #4dd965;
  }

  &.status-dnd {
    background: #ff1414;
  }

  &.status-away {
    background: #ffe100;
  }

  &:hover {
    cursor: pointer;
  }
}

.debug-switch {
  margin-right: 15px;
}

.notify-card {
  position: absolute;
  z-index: 3060;
  right: 10px;
  bottom: 10px;

  width: 350px;
  padding: 20px;

  border: 1px solid #cecece;

  animation: show 1.75s ease-in-out;

  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;

    h4 {
      display: block;
      margin: 0;
      margin-left: 10px;
      font-size: 14px;
    }
  }

  .mat-icon.add-alert {
    color: #4b96e6;
  }

  .buttons {
    display: flex;
    align-items: center;
    justify-content: space-around;

    button:first-child {
      margin-left: 13px;
    }

    button:last-child {
      background-color: #4b96e6;
    }
  }
}

.box:hover .drop-box {
  visibility: visible;
}

.penalty-overlay {
  position: absolute;
  z-index: 9999;
  top: 0;
  left: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  color: #fff;

  background: rgb(0 0 0 / 90%);

  .message {
    margin-bottom: 20px;

    font-size: 2em;
    line-height: 1.5em;
    text-align: center;
    white-space: pre-wrap;
  }

  .close-overlay {
    position: absolute;
    top: 60px;
    right: 20px;
  }
}

.notify-card-none-label {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;

  font-size: 15px;
}

.event-dropmenu-bar .menu-bar {
  height: 100%;
  padding-top: 10px;
  padding-right: 5px;
  padding-left: 5px;
}

.hide-menu-drop-bar {
  float: right;
  display: flex;
  align-items: center;

  height: 30px !important;
  margin-top: 10px;
  margin-right: 20px;
  margin-bottom: 16px;

  background: var(--color-gray-fff);
}

.menu__footer {
  position: absolute;
  z-index: 1;
  bottom: 0;
  width: 100%;

  .menu__avatar__main,
  .actions {
    padding: 10px 0 10px 18px;
  }

  .actions {
    display: flex;
    padding-top: 15px;
    padding-left: 6px;
    border-top: var(--menu-border-color);
  }
}

.menu__icon__hidden {
  position: absolute;
  z-index: 1;
  right: 0;
  bottom: 13px;
}

.read-all-notify-button {
  float: left;
  display: flex;
  align-items: center;

  height: 30px !important;
  margin-top: 10px;
  margin-bottom: 16px;
  margin-left: 20px;

  background: var(--color-gray-fff);
}

.menu-item-wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  margin-right: 10px;
  margin-bottom: 10px;
  margin-left: 10px;
  padding: 11px 17px;

  background: var(--color-gray-fff);
  border-bottom: 1px solid var(--border-primary-color);
  border-radius: 10px;

  .menu-item-dropmenu-bar {
    cursor: pointer;

    display: flex;

    width: 100%;
    padding-top: 5px;
    padding-bottom: 5px;

    .notify-card-item {
      position: relative;
      bottom: 8px;

      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;

      padding-left: 5px;

      -webkit-line-clamp: 3;
    }
  }

  .menu-item-event-dropmenu-icon-close {
    cursor: pointer;

    position: relative;
    right: 3px;
    bottom: 2px;

    display: flex;

    height: min-content;
    padding: 1px;

    border-radius: 50%;
  }
}

#events-scroll-container {
  max-height: 80vh;
}

::ng-deep .mat-menu-panel.event-dropmenu {
  @include viewport-mobile {
    min-width: 375px;
  }

  min-width: 475px;
  background-color: #fafbfb;
  box-shadow:
    0 1px 1px 0 rgb(0 0 0 / 20%),
    0 1px 1px 0 rgb(0 0 0 / 14%),
    1px 1px 7px 0 rgb(0 0 0 / 12%);

  .mat-menu-content {
    padding-top: 6px;
    padding-bottom: 6px;
  }
}

.doodle-wrap {
  cursor: pointer;
  position: relative;
  top: 1px;
}

::ng-deep .mat-menu-panel.person-dropmenu {
  width: 240px;
  box-shadow:
    0 1px 1px 0 rgb(0 0 0 / 20%),
    0 1px 1px 0 rgb(0 0 0 / 14%),
    1px 1px 7px 0 rgb(0 0 0 / 12%);
}

::ng-deep .app-body {
  .add-button-fab {
    .plus-toolbar-icon {
      position: relative;
      top: 9px;
      margin-left: 15px;
      color: rgb(26 61 96);
    }
  }
}

.menu-icon {
  cursor: pointer;

  position: absolute;
  z-index: 1;
  bottom: 10px;
  left: 20px;

  height: 20px;
}

.demo-alarm {
  cursor: pointer;

  position: relative;
  top: -3px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-right: 18px;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1;
  color: #e04201;
  text-align: center;
  white-space: break-spaces;

  border-radius: 5px;

  .demo-alarm-text-hovered {
    display: none;
  }

  .alarm-text {
    display: flex;
    width: 85px;
  }

  &:hover {
    background: #f7f7f7;

    .demo-alarm-text-hovered {
      display: flex;
    }

    .demo-alarm-text {
      display: none;
    }
  }
}

.menu__smart__trigger {
  position: absolute;
  z-index: 1;
  width: 10px;
  height: 100vh;
}

.menu__smart {
  position: absolute;
  z-index: 1;
  top: 80px;
  left: 0;

  display: flex;
  flex-direction: column;

  background-color: whitesmoke;
  border: 1px solid #dfe4e9;

  &.opened {
    left: 0;
    animation: menu-open 0.3s ease-in-out;
  }

  a.menu-item {
    margin-bottom: 10px;
    padding: 10px 5px;

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

    &.active {
      background-color: #ebebeb;
    }

    &:hover {
      position: relative;
      top: -3px;
      animation: alya-windows 0.3s ease-in-out;
    }
  }
}

.icon-chevron-left {
  cursor: pointer;

  position: relative;
  top: 4px;
  right: -2px;

  margin-left: auto;
}

.wrapper {
  &__right {
    // Ломало
    // @include viewport-laptop {
    //     margin-left: 0;
    // }

    @include viewport-mobile {
      min-width: 100%;
      margin-left: 0;
    }

    position: sticky;
    top: 0;

    overflow: hidden;

    width: 100%;
    height: 100vh;
    margin-left: 30px;

    &.displaced {
      height: calc(100vh - 50px);
    }
  }

  &__left {
    display: flex;
  }

  &__left {
    position: sticky;
    top: 0;

    height: 100vh;

    background-color: var(--user-sidebar-bg-color, var(--menu-bg-color));
    border-right: var(--menu-border-color);

    &:hover {
      .trigger-drop:not(.lock) {
        opacity: 1;
        animation: 5s ease 0s normal forwards 1 fadein;
        animation: 5s ease 0s normal forwards 1 fadein;
      }
    }

    &.displaced {
      height: calc(100vh - 50px);
    }

    .trigger-drop {
      cursor: ew-resize;

      position: absolute;
      z-index: 999999;
      top: 0;

      display: flex;
      align-items: center;
      justify-content: center;

      width: 15px;
      height: 100vh;

      opacity: 0;

      &.lock {
        opacity: 1;
      }
    }
  }
}

/*
    Абсолютное меню над всеми лейэоутами, логический лэйоут 1
*/
.page__navigate {
  position: fixed;
  z-index: 9998; // всегда, выше всех! вконце восьмёрка, для онбординга, когда нужно будет выпячивать верхний лэйлоут с тёмнотой везде, кроме нужного

  &.rounded {
    left: 56px;
  }

  .hamburger {
    position: sticky;
    top: 0;

    display: flex;
    align-items: center;

    padding: 3px 38px 3px 0;

    &.displaced {
      margin-top: 11px;

      &.minify {
        margin-top: 18px;
      }
    }

    &.rounded {
      margin-left: 15px;

      &.minify {
        margin-left: 2px;
      }
    }

    .logo-sub-text {
      position: absolute;
      bottom: 6px;
      left: 24px;

      font-size: 12px;
      font-weight: 500;
    }

    .cmf-navigate-panel {
      position: relative;
      top: 1px;
      display: block;
      margin-left: 13px;
    }

    .logo-sub-text {
      position: absolute;
      bottom: 6px;
      left: 24px;

      font-size: 12px;
      font-weight: 500;
    }

    .cmf-navigate-panel {
      position: relative;
      top: 1px;
      display: block;
      margin-left: 13px;
    }
  }
}

.sub__menu {
  position: sticky;
  top: 51px;
  height: calc(100vh - 50px);
  background-color: var(--user-sidebar-bg-color, var(--menu-bg-color));

  // margin-top: 51px;

  &.displaced {
    height: calc(100vh - 100px);
  }

  &:hover {
    .trigger-drop:not(.lock) {
      opacity: 1;
      animation: 5s ease 0s normal forwards 1 fadein;
      animation: 5s ease 0s normal forwards 1 fadein;
    }
  }

  .trigger-drop {
    cursor: ew-resize;

    position: absolute;
    z-index: 999999;
    top: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 15px;
    height: 100vh;

    opacity: 0;

    &.lock {
      opacity: 1;
    }
  }
}

@keyframes menu-closed {
  0% {
    left: 0;
  }

  100% {
    left: -200px;
  }
}

@keyframes menu-open {
  0% {
    left: -200px;
  }

  100% {
    left: 0;
  }
}

@keyframes fadein {
  0% {
    opacity: 0;
  }

  66% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadein {
  0% {
    opacity: 0;
  }

  66% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.person-button.mat-menu-item {
  display: flex;
}

.input-person-button {
  display: flex;
  align-items: center;

  width: min-content;
  margin-right: 18px;
  margin-left: 5px;
}

@media print {
  #section-to-print {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
  }

  #section-to-print .toolbar {
    margin: 0;
    padding: 0;
  }
}

app-cmf-wiki-comments {
  position: absolute;

  // bottom: 100px;
  right: 50px;
}

.noselect {
  cursor: ew-resize;
  user-select: none;
}
