@import 'src/assets/styles/responsive-base.scss';

:host {
  margin-bottom: 5px;
  &.selected {
    .one-message-content {
      background-color: rgba(249, 168, 37, 0.2);
    }
  }
}

.one-message {
  display: flex;
  align-items: flex-start;
  //padding: 4px 0 0px 16px;
  padding: 4px 0 0px 16px;
  position: relative;
  height: 100%;

  &:hover {
    .ingroup-date {
      visibility: visible;
    }
  }

  //@include screen('phone') {
  &.own-message {
    flex-direction: row-reverse;
    //padding: 4px 16px 0px 0;
    padding: 4px 16px 0px 0;
  }
  //}
}

.avatar-spaceholder {
  span {
    margin: 0px;
  }
  flex-basis: 48px;
  text-align: center;
  flex-shrink: 0;
}

.ingroup-date {
  visibility: hidden;
  cursor: default;
}

.avatar-container {
  position: sticky;
  bottom: 10px;
  align-self: flex-end;
}

app-avatar {
  width: 38px;
  height: 38px;
  margin: 0 5px 0 5px;
}

.one-message-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top-right-radius: 14px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 14px;
  border-top-left-radius: 14px;
  padding: 14px 10px 14px 10px;
  margin-right: 6px;
  max-width: 60%;
  position: relative;

  app-select-reaction {
    position: absolute;
    top: -40px;
    z-index: 2;
    left: 0;

    @include screen('desktop') {
      &.expanded-reaction {
        top: -220px;
      }
    }
    @include screen('phone') {
      &.expanded-reaction {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
      }
    }
  }

  #dialog-fix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
  }
}

.one-message {
  //@include screen('phone') {
  &.own-message {
    .one-message-content {
      border-top-right-radius: 14px;
      border-bottom-left-radius: 14px;
      border-bottom-right-radius: 0;
      border-top-left-radius: 14px;
      margin-right: 0;
      margin-left: 6px;
    }

    app-select-reaction {
      left: auto;
      right: 0;
    }
  }
  //}
}

app-markdown-editor,
.message-error {
  flex: 1 1 100%;
  width: 100%;
}

.date {
  // font-size: 11px;
  margin: 0 8px;
}

.message-header {
  display: flex;
  align-items: center;
}

.message-menu {
  display: none;
  border-radius: 4px;
  padding: 3px 4px;
}

.message-menu-cont {
  display: flex;
  flex-direction: row;
  align-self: flex-end;
  position: sticky;
  bottom: 0;

  user-select: none;
  -webkit-user-select: none;
  user-drag: none;
  -webkit-user-drag: none;
}

.reactions {
  display: flex;
  align-items: center;
  height: 100%;
  // align-items: flex-end;
  padding: 5px 2px;
  margin: 5px 0;
  box-sizing: border-box;

  img {
    cursor: pointer;
    width: 20px;
    height: 20px;
    margin: 2px;
  }

  span {
    margin: 2px;
  }
}

.message-menu mat-icon {
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.one-message:hover .message-menu {
  display: flex !important;
}

// .one-message:hover .reactions {
//   display: none;
// }

app-avatar {
  cursor: pointer;
}
.name {
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  &:hover {
    text-decoration: underline;
  }
}

.date {
  cursor: default;
}

.owner-icon {
  padding: 0px 4px 0px 0px;
}

.compact-account-name {
  font-weight: bold;
  :hover {
    text-decoration: underline;
    cursor: pointer;
  }
}
