@import 'modules/app/viewports';

.cmf-feed-edit {
  @include viewport-mobile {
    flex-direction: column;
  }

  position: relative;
  display: flex;
  min-height: calc(100vh - 101px);

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

    width: 350px;
    min-width: 350px;
    height: fit-content;
    margin-top: 69px;

    border-left: 1px solid var(--color-gray-eee);

    .settings-buttons {
      position: relative;
      top: -16px;

      float: right;
      display: flex;
      flex-direction: row;

      padding-right: 25px;
    }

    .settings-wrapper {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      width: 100%;

      .settings {
        cursor: pointer;
        margin-top: 20px;
        color: var(--crud-ui-group-color);

        .settings-icon {
          position: relative;
          top: 2px;
          margin-right: 3px;
        }

        .settings-button {
          font-weight: 400;
        }
      }
    }
  }

  .left {
    @include viewport-mobile {
      max-width: initial;
    }

    flex-grow: 1;
    max-width: calc(100% - 335px);
    padding: 14px 14px 0 0;
  }
}

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

.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 {
    @include viewport-laptop {
      padding: 0 20px 0 30px;
    }

    @include viewport-mobile {
      padding: 0;
    }

    flex: 1;
    max-width: 100%;
    padding: 0 2px 60px 60px;
  }

  .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;
    }

    .field-alarm_date .right-col {
      /* color:#E74C3C; */
    }

    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 {
    // animation: show 0.3s 1;
    // animation-fill-mode: forwards;
    // animation-delay: 0.2s;
    padding-top: 10px;
    // opacity:0;
    transition: 0.3s;

    // @keyframes show{
    //   0%{
    //   opacity:0;
    //   }
    //   100% {
    //   opacity:1;
    //   }
    // }
  }

  .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;
  }
}

.responsible-container {
  display: flex;

  &:hover .edit-menu-trigger {
    visibility: visible;
  }
}

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

  /* display: flex;
    flex-direction: row; */

  .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;
      }

      .list-release-hidden {
        opacity: 0;
      }

      &:hover {
        .list-release-hidden {
          opacity: 1;
        }
      }
    }
  }

  .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,
.inline-pencil-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;
  }

  &:hover .inline-pencil-icon {
    max-width: fit-content;
    visibility: visible;
  }
}

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

.task-top {
  position: relative;

  .task-name-edit {
    display: block;

    width: 100%;

    font-size: 24px;
    line-height: var(--default-line-height);
    color: #2b2b2b;

    &.not-editing {
      margin-bottom: 26px;
    }
  }

  .app-task-text-wrapper {
    position: relative;
    overflow: hidden;

    .action-viewform {
      position: absolute;
      top: 5px;
      right: 5px;

      display: flex;
      gap: 7px;

      &__close {
        cursor: pointer;
      }
    }
  }

  .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;
    }
  }
}

.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;
}

.task-details {
  .block > strong {
    display: block;
    margin-bottom: 15px;
    color: #2b2b2b;
  }

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

    margin-top: 14px;
    margin-right: 14px;
  }
}

.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;

  // opacity:0;
  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;
  }

  // animation: show 0.3s 1;
  // animation-fill-mode: forwards;
  // animation-delay: 0.2s;

  // @keyframes show{
  //   0%{
  //     opacity:0;
  //   }
  //   100% {
  //     opacity:1;
  //   }
  // }
}

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

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

  margin-bottom: 20px;
  padding-top: 0;
  padding-left: 19px;

  color: #2b2b2b;

  // animation: show 0.3s 1;
  // animation-fill-mode: forwards;
  // animation-delay: 0.2s;
  background-color: var(--app-bg-color-l3);
  border-radius: 7px;

  // opacity:0;
  transition: 0.3s;

  // @keyframes show{
  //   0%{
  //     opacity:0;
  //   }
  //   100% {
  //     opacity:1;
  //   }
  // }
}

.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-details {
    @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;
  }
}

.edit-menu-trigger {
  cursor: pointer;

  margin-right: 5px;

  font-size: 16px;
  color: var(--color-gray-888);

  visibility: hidden;

  &.show {
    visibility: visible;
  }
}

.edit-menu-container {
  margin: -18px -3px 0;
  background: var(--color-gray-fff);

  .edit-menu-waiting-for-container {
    display: flex;
    gap: 10px;

    .label {
      font-weight: 500;
    }
  }
}

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

  // fixme
  .app-task-text-wrapper .pencil,
  .app-task-name-wrapper .pencil {
    position: relative;
    top: -2px;
  }

  .app-task-text-wrapper .filled .pencil {
    top: 11px;
    right: 1px;
  }

  .app-task-name-wrapper {
    display: inline-flex;

    width: 100%;
    min-height: 60px;

    font-family: var(--header-font);
    font-weight: var(--font-header-weight);
    color: var(--font-header-color);

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

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

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

.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);

    .uwork-code {
      display: flex;

      &:hover {
        .uwork-code-icon {
          visibility: visible;
        }
      }

      .uwork-code-icon {
        cursor: pointer;
        margin-left: 5px;
        visibility: hidden;
      }
    }
  }

  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%;
}

.deleted-obj-msg {
  color: #e31e24;
}

.app-change-audit-button {
  display: flex;

  app-cmf-doodle-icon {
    display: flex;
    margin-left: 5px;
  }
}

:ng-deep {
  .feed-edit-menu-overlay {
    background: transparent;
  }
}

::ng-deep {
  .grid-table {
    display: grid;
    gap: 15px;

    margin-top: 50px;
    margin-bottom: 20px;
    padding-bottom: 5px;

    color: #a0a0a0;

    border-bottom: 1px solid #d5d5d5;
  }

  [grid-area='code'] {
    grid-area: code;
  }

  [grid-area='name'] {
    grid-area: name;
  }

  [grid-area='priority'] {
    grid-area: priority;
  }

  [grid-area='sp'] {
    grid-area: sp;
  }

  [grid-area='responsible'] {
    grid-area: responsible;
  }

  [grid-area='status'] {
    grid-area: status;
  }
}
