@import 'modules/app/viewports';

.cmf-feed-edit {
  @include viewport-mobile {
    grid-template-columns: 1fr;
  }

  position: relative;

  display: grid;
  grid-template-columns: 1fr 40%;

  min-height: calc(100vh - 101px);
  padding-top: 14px;

  .right {
    @include viewport-laptop {
      min-width: 270px;
    }

    height: fit-content;

    wg-cmf-inline-crud-status {
      margin-bottom: 8px;
    }
  }

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

    padding-right: 48px;
  }
}

.task-close-popup {
  cursor: pointer;
}

ctr-status-select {
  display: flex;
  margin-bottom: 8px;
}

.task-cancel {
  position: relative;
  top: -16px;
  float: right;
  padding-right: 30px;
}

.time-tracker-history {
  max-height: 25px;
  padding: 5px 5px 0 0;
}

.feed-edit {
  display: flex;
  flex-direction: row;

  .feed-edit-main {
    flex: 1;
    max-width: 100%;
  }

  .feed-edit-options {
    width: 23%;
    min-width: 420px;
    margin-top: 17px;
    padding: 20px;
    padding-top: 0;

    border-left: 1px solid #ccc;

    div {
      margin-bottom: 13px;
    }

    .field-alarm_date .mat-icon {
      position: relative;
      top: 3px;
      left: 5px;

      font-size: 18px;
      color: #777;
    }

    tr:nth-child(3) td {
      padding-bottom: 15px;
    }
  }

  .feed-edit-header {
    display: flex;
    flex-direction: row;
    align-items: center;

    h1 {
      margin-right: auto;
    }

    .buttons button:not(:last-child) {
      margin-right: 10px;
    }
  }

  .field-lists {
    margin-bottom: 26px !important;
  }

  .app-wrapper-communication-panel {
    padding-top: 30px;
  }

  .app-wrapper-planning-panel {
    padding-top: 10px;
  }

  .app-wrapper-custom-panel {
    padding-top: 10px;
  }

  .app-wrapper-panel-content {
    padding-top: 10px;
    transition: 0.3s;
  }

  .app-feed-edit-options-communication {
    cursor: pointer;
    display: contents;
    color: #777;
  }

  .app-feed-edit-options-planning {
    cursor: pointer;
    display: contents;
    color: #777;
  }

  .app-feed-edit-options-custom {
    cursor: pointer;
    display: contents;
    color: #777;
  }
}

.task-header {
  overflow: hidden;
  padding: 0 20px 20px;
  padding-left: 60px;

  .task-from-to {
    flex: 0.5;
  }

  .avatar,
  .details {
    float: left;
  }

  .avatar {
    width: 32px;
    height: 32px;
    margin-right: 10px;

    font-size: 32px;
    line-height: 32px;
    color: #fff;
    text-align: center;

    background: #777;
    border-radius: 50%;
  }

  .details {
    position: relative;
  }

  .details .from {
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--color-gray-222);
  }

  .details .to {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-gray-222);

    .responsible-title-wrapper {
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
    }
  }

  .details {
    .detail {
      @include viewport-mobile {
        grid-template-columns: max-content;
      }

      display: grid;
      grid-template-columns: repeat(1, max-content);

      font-size: 14px;
      font-weight: 400;
      color: #777;

      .detail-item {
        position: relative;
        display: flex;
        align-items: flex-start;
        margin-right: 20px;
      }
    }
  }

  .row {
    margin-bottom: 8px;
  }

  .details .row:nth-child(2) {
    margin-top: -5px;
  }

  .from-owner-title {
    font-size: 14px;
    font-weight: 400;
    color: #777;
  }

  .editable-field {
    position: relative;
    display: inline-block;
  }

  .task-status {
    flex: 0.5;
  }

  .task-status .row:nth-child(2) {
    margin-top: -5px;
  }

  .app-feed-executor-link {
    color: inherit;
    text-decoration: none;
  }
}

.inline-launch-icon {
  position: relative;
  top: 1px;

  width: 18px;
  max-width: 0;
  height: 18px;
  margin-left: 4px;

  visibility: hidden;
}

.cmf-interactive-item {
  display: flex;
  align-items: center;

  &:hover .inline-launch-icon {
    max-width: fit-content;
    visibility: visible;
    transition-delay: 1s;
  }
}

.min-inline-launch-icon {
  top: -14px;
  right: 5px;
  width: 0;
  height: 0;
}

.task-top {
  position: relative;

  .task-name-wrapper {
    display: flex;

    min-height: 60px;
    margin-bottom: 26px;

    font-family: var(--header-font);
    font-size: 24px;
    font-weight: var(--font-header-weight);
    line-height: var(--default-line-height);
    color: var(--font-header-color);

    .fire-icon {
      margin-right: 5px;
    }
  }

  .task-text {
    position: relative;
    overflow: hidden;
  }
}

.date {
  position: absolute;
  top: 15px;
  right: 35px;

  width: 210px;

  font-size: 14px;

  mat-icon {
    width: 18px;
    height: 18px;
    font-size: 18px;
    vertical-align: baseline;
  }
}

.date span {
  position: relative;
  top: -22px;
  left: 26px;
  display: block;
}

.date .mat-icon {
  color: #777;
}

.app-wrapper-content {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: left;

  .add-related-task,
  .app-add-subtask-button,
  .app-change-audit-button,
  .app-add-attachment-button {
    cursor: pointer;

    padding-left: 10px;

    font-size: 12px;
    line-height: 1.2;
    color: #777;

    border-left: solid 1px #777;
  }

  .app-add-attachment-button {
    padding-right: 10px;
    padding-left: 0;
    border: none;
  }

  .app-add-subtask-button,
  .add-related-task,
  .app-change-audit-button {
    padding-right: 10px;
  }

  .add-related-task {
    display: flex;

    &__add-btn {
    }

    &__more-btn {
      display: flex;
      align-items: center;
      margin-left: 5px;
    }
  }
}

.backdrop {
  opacity: 0;
}

.add-related-task__more-menu {
  max-width: 400px;
  padding: 5px 0;

  background-color: var(--app-bg-color-l1);
  border: 1px solid rgb(220 220 220);
  border-radius: 4px;
  box-shadow: 1px 1px 3px 0 rgb(25 25 25 / 40%);

  .more-menu-item {
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 10px 15px;

    &:hover {
      background-color: var(--color-gray-eee);
    }

    &__icon {
      display: flex;
      align-items: center;
    }
  }
}

.app-wrapper-panel-instructions {
  display: table;

  width: 100%;
  margin-bottom: 3px;

  background-color: #faf9e8;
  border-radius: 5px;

  transition: 0.3s;

  .panel-instructions-icon {
    position: relative;
    top: 1px;
    bottom: 7px;

    padding-right: 5px;
    padding-left: 5px;
  }

  .panel-instructions-text {
    position: relative;
    bottom: 3px;
    padding-right: 5px;
    font-size: 12px;
  }
}

.task-attachments {
  margin-top: 55px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #a0a0a0;
}

.task-comments {
  @include viewport-mobile {
    margin-top: 0;
    margin-right: 0;
  }

  margin-top: 14px;
  margin-bottom: 20px;
}

.left-col {
  width: 140px;
  vertical-align: top;
}

.vertical-top {
  vertical-align: top;
}

.task-status .status-marker {
  display: inline-block;

  width: 10px;
  height: 10px;
  margin-right: 5px;
  margin-left: 5px;

  background: #3498db;
  border-radius: 2px;
}

.task-status .status-marker-open,
.task-status .status-marker-opened {
  background: #e74c3c;
}

.task-status .status-marker-close,
.task-status .status-marker-closed {
  background: #2ecc71;
}

.embedded {
  .task-header {
    justify-content: space-between;

    margin-top: 3.5%;
    margin-left: 5.7%;
    padding: 0;
    padding-bottom: 20px;
  }

  .feed-edit-main {
    padding-left: 0;
  }

  .feed-edit-options {
    padding-right: 0;
  }

  .task-status {
    flex: 0.25;
    margin-left: 6%;
  }

  .task-comments {
    @include viewport-mobile {
      margin-left: 0;
    }

    margin-left: 6%;
  }

  .task-top {
    @include viewport-mobile {
      margin-left: 0;
    }

    margin-left: 6%;
  }
}

.cmf-locked {
  color: #e74c3c;
}

.from__wrapper {
  display: flex;

  .from__owner {
    margin-right: 5px;
  }

  .from__responsible {
    margin-left: 5px;
  }
}

:host ::ng-deep .cmf-feed-edit {
  .tinymce-editor {
    @include viewport-mobile {
      width: 100%;
      max-width: 330px;
    }
  }

  // В режиме просмотра не должно быть элементов и поведения редактирования
  .readonly {
    // выкл. кликабельность чекбоксов
    .tox-checklist {
      pointer-events: none;
    }

    // прячем кнопку редактирования вложения у проевью вложений
    .preview-action.edit-preview {
      display: none;
    }
  }

  .empty-warn {
    .inline-edit-text-placeholder {
      color: #c52a00 !important;
    }
  }

  span.right .crud-column {
    @include viewport-mobile {
      margin-top: 0;
      margin-bottom: 10px;
    }
  }

  // Блок подмешивается в поле "text"
  .task-result {
    width: 100%;
    margin-bottom: 20px;

    &::before {
      content: '';

      display: block;

      width: 80%;
      height: 2px;

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

    .task-result__title {
      margin-top: 25px;
      font-size: 18px;
      font-weight: 600;
    }
  }
}

.subtasks {
  margin-bottom: 40px;
}

.fields-settings-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;

  max-height: 60vh;
  margin-top: 69px;
  padding-top: 20px;
  padding-right: 20px;
  padding-left: 20px;

  border-left: 1px solid #f1f3f4;
}

.buttons {
  display: flex;
  justify-content: flex-end;
}

.uwork__hint {
  position: relative;
  top: 2px;
}

.uwork__mark {
  position: absolute;
  top: -16px;
  left: 10px;

  width: 10px;
  height: 34px;
}

.cmf-feed-edit__header {
  position: absolute;
  left: 25px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  width: calc(100% - 28px);

  &__info {
    display: flex;
    align-items: flex-start;
    margin-left: 25px;
    color: var(--color-gray-888);
  }

  a.breadcrumbs {
    overflow: hidden;
    display: block;

    max-width: 200px;

    color: var(--color-gray-888);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__actions {
    display: flex;

    .open-settings-button {
      cursor: pointer;

      position: relative;
      top: 3px;

      display: flex;

      margin-right: 2px;
    }
  }
}

.separator {
  padding: 0 8px;
}

.flex-wrap {
  flex-wrap: wrap;
  margin-right: 7%;
}
