@import 'modules/app/viewports';

.app-cmf-uwork {
  @include viewport-mobile {
    width: 100%;
    margin: 0;
    padding: 12px;
    border: none;
  }

  cursor: pointer;

  position: relative;

  display: flex;
  flex-direction: column;

  width: 42vw;
  max-width: 725px;
  margin-bottom: 10px;
  padding: 5px 35px;

  font-weight: 400;

  background: var(--app-bg-color-l1);
  border: 1px solid var(--task-card-border-color);
  border-radius: 4px;
  box-shadow: 0 0 4px 3px var(--box-shadow-card-color);

  .button-comments {
    align-self: end;
    visibility: hidden;
  }

  .full-body-card-wrapper {
    padding-left: 4px;

    .card-obj-name {
      display: flex;
      padding-top: 10px;
      font: var(--card-header-font);
      color: var(--font-header-color);

      .line-through-decoration {
        text-decoration: line-through;
      }

      .time-tracker-history {
        padding-right: 5px;
      }
    }
  }

  .card-obj-wrapper {
    display: grid;
    grid-template-columns: auto 1fr auto;
    margin-right: -16px;
    padding-right: 18px;

    .card-action-buttons {
      display: flex;
      grid-column: 3 / 3;
      justify-content: flex-end;

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

      button {
        height: 24px;
        padding: 0 26px;

        font: var(--card-info-status-font);
        font-size: 12px;
        line-height: 20px;
        color: #2b2b2b;

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

    .card-obj-name {
      display: flex;
      flex-flow: column wrap;

      padding-top: 5px;
      padding-bottom: 3px;

      font: var(--font-small);
      color: var(--font-header-color);

      .card-obj-name-line {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        font: var(--card-info-font);
      }

      &:hover {
        .hovered-header-card-name {
          visibility: visible;
        }
      }
    }

    .card-obj-status-and-alarm {
      display: flex;
      flex-direction: column;

      padding-top: 5px;
      padding-bottom: 3px;

      font: var(--card-info-font);
      color: #2b2b2b;

      &:hover {
        .hovered-header-card-status-and-alarm {
          visibility: visible;
        }
      }
    }
  }

  .app-cmf-uwork-inner {
    @include viewport-mobile {
      width: 100%;
      padding: 0;

      &:not(.first) {
        border-top: none;
      }

      &__erp {
        border-bottom: none;
      }
    }

    overflow: hidden;
    padding-bottom: 10px;

    &__erp {
      border-bottom: solid 1px var(--border-primary-color);
    }

    &.transparency {
      opacity: 0.7;
    }
  }

  /* transition: all 0.2s; */

  .notify-wrapper-label {
    display: flex;
    flex-direction: row;
    align-items: center;

    width: 94%;
    margin-bottom: 0;
    padding-right: 5px;
    padding-bottom: 0;
  }

  .notify-name {
    overflow: hidden;

    padding-right: 5px;

    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .info {
    color: var(--card-info-font-color);

    .info-row {
      @include viewport-mobile {
        flex-direction: column;
        margin-top: 15px;
      }

      display: flex;
      flex-direction: row;
      align-items: flex-start;
      font: var(--card-info-font);

      .info-entry {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
      }

      .hovered-header-card-name {
        visibility: hidden;
      }

      .hovered-header-card-status-and-alarm {
        visibility: hidden;
      }
    }
  }

  .information-icon {
    position: relative;
    top: 19px;
    left: -5px;
  }

  .app-wrapper-content {
    user-select: none;

    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: left;

    margin-right: 20px;
    margin-left: 30px;

    visibility: hidden;

    .app-change-text-button {
      cursor: pointer;
      padding-right: 10px;
      color: var(--card-info-font-color);
    }

    .app-change-comments-button-show {
      cursor: pointer;
      padding-left: 10px;
      color: var(--card-info-font-color);
      border-left: solid 1px var(--card-info-font-color);
    }
  }

  .notification-icon {
    position: relative;
    top: 1px;

    width: 16px;
    height: 16px;
    margin-right: 8px;

    font-family: 'Material Icons Outlined';

    /* margin-right: 15px; */
    font-size: 16px;
  }

  .notify-label {
    margin-top: 5px;
    font-size: 14px;
    font-weight: var(--font-header-weight);
    color: #2b2b2b;
  }

  .wrapper-done-button-and-change {
    @include viewport-mobile {
      margin-left: 0;
    }

    display: flex;
    align-items: baseline;
    margin-left: auto;

    .wrapper_done_and_alarm {
      display: flex;
      flex-direction: column;
      place-content: space-around space-between;
      align-items: flex-end;

      min-width: 136px;

      color: var(--color-gray-222);

      .wrapper_done_and_alarm-line {
        display: flex;
        margin-bottom: 8px;

        ctr-status-select {
          margin: 0 calc(var(--tui-padding-s) * -1);
        }
      }

      .card-obj-name-line {
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        width: 100%;

        &.hidden {
          visibility: hidden;
        }
      }
    }
  }

  .uwork-alarm-button {
    display: block;

    width: 26px;
    height: 26px;

    opacity: 1;
    background-color: var(--border-primary-color);
    border-radius: 50%;

    &:hover {
      opacity: 0.7;
    }
  }

  .uwork-done-button {
    display: flex;
    flex-direction: row;
    place-content: flex-start center;
    align-items: center;

    min-width: 50px;
    max-width: 50px;
    height: 22px;
    margin: 14px 0 0 5px;
    margin-left: auto;

    font-size: 10px;

    /* background: var(--color-gray-fff);
        border: 1px solid #afafaf; */
    color: var(--color-gray-444);

    opacity: 1;
    border-radius: 15px;

    &.disabled {
      color: #afafaf;
      opacity: 0.7;
    }
  }

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

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

  .close-icon {
    position: absolute;
    top: 7px;
    right: 8px;
    display: none;
  }

  .alarm-icon {
    position: relative;
    right: 3px;
    bottom: 1px;
  }

  .uwork-header {
    overflow: hidden;
    display: flex;
    align-items: center;
    color: var(--default-color);

    /* margin-bottom: 10px;
        margin-top: 8px; */
    .avatar,
    .details {
      float: left;
    }

    .avatar {
      height: 32px;
      margin-right: 15px;

      line-height: 32px;
      color: #333;
      text-align: center;

      mat-icon {
        font-size: 32px;
      }
    }

    .details {
      position: relative;
    }

    .details .uwork-from {
      .mat-icon {
        position: relative;
        top: 4px;
        font-size: 18px;
      }
    }
  }

  .uwork-date,
  .uwork-options {
    color: #2b2b2b;

    /* position: absolute; */
  }

  .uwork-date {
    display: inline;
    vertical-align: top;
  }

  .uwork-options {
    top: 10px;
    right: 0;
  }

  .uwork-body {
    @include viewport-mobile {
      padding: 0 !important;
    }

    // color: #9C9FA2;
    display: flex;
    flex-direction: column;

    padding-top: 15px;
    padding-bottom: 10px;
    padding-left: 0 !important; // fixme

    em {
      padding-right: 5px;
      font-weight: bold;
      font-style: normal;
    }

    .uwork-content {
      display: flex;
      flex-direction: row;
      font-size: 14px;
      color: #2b2b2b;
    }

    .text {
      font: var(--card-body-font);
      color: rgb(34 34 34);
    }

    .cmf-comments-count-mobile {
      display: flex;
      align-items: center;
      justify-content: space-between;

      min-width: 35px;
      margin-right: auto;
      padding: 2px 6px;

      font-size: 11px;
      line-height: 0;
      color: var(--card-info-font-color);

      background-color: #f8f8f8;
      border-radius: 5%;

      icon {
        padding-top: 4px;
      }
    }
  }

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

::ng-deep .uwork-body .text b {
  font-weight: 400;

  /* color: #a0a0a0; */
}

::ng-deep .deal-icon .mat-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
  color: rgb(59 155 14);
}

::ng-deep .uwork-body .text br + br {
  content: ' ';
  display: block;
  margin-bottom: 5px;
}

// .app-cmf-uwork:hover .app-cmf-uwork-inner {

/* background: linear-gradient(#F0F4F8, #fff); */
// }
.app-cmf-uwork.selected .uwork-alarm-shift-choices {
  display: inline-flex;

  /* width: 30px;
    transition: 1s all; */
}

.app-cmf-uwork-status-info {
  padding: 10px 0 10px 20px;
  color: var(--color-gray-222);
  background-color: var(--warn-bg-color);
  border-radius: 4px;
}

.app-link-container {
  .app-cmf-uwork::before {
    content: '';
    position: absolute;
    height: 100%;

    // width: 4px;
    // background-color: #b8dbe4;
  }

  &:hover .button-comments {
    visibility: visible;
  }
}

.app-cmf-uwork.selected .alert-circle-icon {
  opacity: 1;
}

.app-cmf-uwork.selected .alarm-icon {
  visibility: visible;
}

.app-cmf-uwork:hover .alarm-icon {
  visibility: visible;
}

// .app-cmf-uwork:hover .uwork-alarm-shift-choices {

/* visibility: visible; */

/* display: block;
    transition-delay: 1s; */
// }

.app-cmf-uwork.selected .app-cmf-uwork-inner,
.app-cmf-uwork.selected .app-cmf-uwork-inner:hover {
  background: #f0f4f8;
}

.uwork-toolbar {
  position: absolute;
  right: 4px;
  bottom: 6px;
  display: none;
}

.app-cmf-uwork:hover .uwork-toolbar {
  display: block;
}

.uwork-alarm-shift {
  position: absolute;
  right: 11px;
  bottom: 44px;
}

.uwork-open-in-new {
  position: absolute;
  right: 11px;
  bottom: 44px;
  display: none;
}

.app-cmf-uwork:hover .uwork-open-in-new {
  display: block;
}

.uwork-alarm-shift button {
  display: none;
}

.icon-done-alarm {
  position: relative;
  top: 5px;
  right: -5px;
}

.uwork-alarm {
  width: 18px;
  height: 18px;
  line-height: 20px;
  color: black;
}

.uwork-done {
  color: black;
}

.uwork-progress {
  position: absolute;
  z-index: 5;
  top: -4px;
  right: 10px;

  color: #2b6ed9;
}

// .uwork-alarm-shift-choices {
// }

// .uwork-alarm-shift:hover .uwork-alarm-shift-choices {
// .uwork-alarm-shift-choices {

/* display: block; */
// }

.uwork-alarm-shift-choices ul {
  /* position: absolute;
    width: 99px;
    background: #f6f9fe;
    z-index: 100;
    box-shadow: 0 1px 2px var(--card-info-font-color);
    border-radius: 2px; */
  color: #a0a0a0;
}

.uwork-alarm-shift-choices ul,
.uwork-alarm-shift-choices ul li {
  display: inline;
  margin: 0 0 0 4px;
  padding: 0;
  list-style: none;
}

// .uwork-alarm-shift-choices ul li {

/* display: inline-block;
    margin-right: 1px; */
// }

.uwork-alarm-shift-choices ul li a {
  /* width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 11px;
    text-align: center; */
  cursor: pointer;
  display: inline;
}

/*
.uwork-alarm-shift-choices ul li a:hover {
    background: #578be1;
    color: #fff;
    text-decoration: underline;
}
*/
.app-cmf-unread_cnt {
  position: absolute;
  top: 15px;
  right: 25px;

  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-grow: 0;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;

  width: 16px;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding-right: 4px;
  padding-left: 4px;

  color: white;

  background-color: rgb(0 120 212);
  border-radius: 8px;

  .app-cmf-unread_cnt-text {
    cursor: inherit;

    position: relative;

    overflow: hidden;
    display: inline;
    flex-grow: 0;
    flex-shrink: 0;

    font-size: 10px;
    font-weight: 400;
    line-height: 10px;
    color: rgb(255 255 255);
    text-align: center;
    text-overflow: ellipsis;
    white-space: pre;

    background-color: rgb(0 0 0 / 0%);
  }
}

.app-cmf-change {
  font-size: 24px;
  line-height: 14px;
  color: #3e80d7;
}

.cmf-avatar {
  width: 32px;
  height: 32px;

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

  background: var(--card-info-font-color);
  border-radius: 50%;

  mat-icon {
    display: inline-block;

    width: 24px;
    height: 24px;

    font-size: 24px !important;

    background-repeat: no-repeat;

    fill: currentcolor;
  }
}

.is-penalty:not(.is-closed) .uwork-content,
.is-penalty:not(.is-closed) .uwork-body {
  color: #d63031 !important;
}

.is-closed .uwork-content,
.is-closed .uwork-body {
  font-weight: 400;
  text-decoration: line-through !important;
}

.app-link-container {
  text-decoration: none;
}

.avatars {
  @include viewport-mobile {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;

    .avatar {
      margin: 0;
    }
  }

  display: flex;
  justify-content: flex-end;
  margin-right: 10px;

  .avatar {
    margin-top: 8px;
    margin-right: 5px;
  }
}

.app-wrapper-content-icons {
  @include viewport-mobile {
  }

  display: flex;
  flex-direction: column;

  .alert-circle-icon {
    position: absolute;
    right: 10px;
    opacity: 0;
  }
}

.deal-status {
  margin-top: 1em;
  color: var(--color-gray-222);

  span {
    padding: 3px;
    border-radius: 3px;
  }
}

.uwork-content-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
}

::ng-deep .text img {
  max-width: 500px;
  max-height: 300px;
}

.cmf-comments-preview {
  @include viewport-mobile {
    display: none;
  }

  margin-bottom: 15px;
  margin-left: 30px;
  padding: 10px 20px;

  background-color: var(--app-bg-color-l3);
  border-radius: 5px;
}

::ng-deep .cmf-task-card {
  .empty-warn {
    .inline-edit-text-placeholder {
      color: var(--card-color-alert-red) !important;
    }
  }

  .waiting-for__elipsis {
    overflow: hidden;

    .inline-edit {
      min-width: 100%;
    }

    .inline-edit-wrap .inline-edit div.inline-edit-text.prewrap .app-inline-edit-link {
      overflow: hidden;
      display: block;

      max-width: 100px;

      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}

.crypto-warning {
  cursor: pointer;
  font-style: italic;
  color: var(--color-href);
  text-decoration: underline;
}
