.message-thread-container {
  padding: 24px 24px 24px 24px;
  border-radius: 4px;
  background-color: white;
  display: block;
  border: 2px solid $light-mint;

  &.active {
    border-color: $honey;
    border-width: 3px;
  }

  .listing-name {
    font-size: 14px;
    color: $grey;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding-left: 11px;
    position: relative;
    display: block;
    @include breakpoint(small only) {
      max-width: 50%;
    }
    @include breakpoint(br-768 up) {
      display: inline-block;
      vertical-align: middle;
    }

    &::before {
      position: absolute;
      content: "";
      width: 2px;
      height: 2px;
      border-radius: 50%;
      background-color: $grey;
      top: 50%;
      left: 2px;
      transform: translateY(-50%);
    }
  }

  .user-image-with-side-details {
    .avatar {
      width: 60px;
      height: 60px;
      margin-bottom: 0;
      margin-right: 12px;

      &.empty {
        .height-100 {
          line-height: 55px !important;
        }
      }
    }
  }

  color: $charcoal;

  &:hover {
    text-decoration: none;
  }

  &:not(:first-child) {
    margin-top: 24px;
  }

  .divider {
    background: $off-white;
    height: 1px;
    width: 100%;
    margin-top: 24px;
    margin-bottom: 24px;
    border: none;
  }

  .timestamp {
    position: absolute;
    right: 0;
    bottom: 7px;
    @include breakpoint(br-768 up) {
      top: 0;
      bottom: unset;
    }
    font-size: 14px;
    color: $grey;
    font-weight: 600;
  }
}

.recent-message {
  font-size: 16px;
  font-weight: 600;
  color: $charcoal;
}

.unread-notifier {
  position: absolute;
  top: -12px;
  right: -12px;
  @include breakpoint(br-768 up) {
    top: unset;
    bottom: 0;
    right: 0;
  }

  .message-text {
    display: none;
    font-size: 9px;
    line-height: 11px;
    font-weight: 700;
    margin-right: 6px;
    @include breakpoint(br-768 up) {
      display: inline-block;
    }
  }

  .number {
    display: inline-block;
    padding: 2px 9px;
    font-size: 14px;
    text-align: center;
    border-radius: 50%;
  }
}

.message {
  position: relative;
  margin-bottom: 44px;

  &.padding-left {
    padding-left: 34px;
  }

  &.padding-right {
    padding-right: 34px;
  }

  .avatar {
    border-radius: 50%;
    border: none;
    width: 24px;
    height: 24px;
  }

  &.green-message {
    .speech-bubble {
      border-radius: 16px 16px 0 16px;
      background-color: $dark-mint;
      color: white;

      .timestamp {
        right: 0;
        left: unset;
      }

      .avatar {
        left: calc(100% + 8px);;
      }
    }
  }
}

.speech-bubble {
  display: inline-block;
  position: relative;
  text-align: left;
  width: 80%;
  padding: 12px 24px;
  border-radius: 16px 16px 16px 0;
  background-color: $off-white;
  color: $charcoal;
  font-size: 14px;
  line-height: 21px;
  font-weight: 600;
  word-break: break-word;
  white-space: pre-line;

  .timestamp {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    color: $light-grey;
    font-size: 12px;
    line-height: 12px;
    display: inline-block;
  }

  .avatar {
    position: absolute;
    margin-bottom: 0;
    left: -30px;
    bottom: 0;

    &.empty {
      .height-100 {
        line-height: 24px !important;
        font-size: 11px;
      }
    }
  }
}

.message-thread-fee-amend-form {
  background: white;
  @include breakpoint(br-768 up) {
    background-color: $off-white;
    margin-top: 28px;
  }
  @include breakpoint(large up) {
    max-width: 384px;
    margin: auto;
  }

  .title {
    text-align: center;
    font-size: 22px;
    line-height: 28px;
    font-weight: 600;
    color: $charcoal;
    margin-bottom: 12px;
  }

  .subtitle {
    text-align: center;
    font-size: 16px;
    line-height: 20px;
    font-weight: 600;
    color: $grey;
    margin-bottom: 20px;
  }
}

.send-message-form {
  position: fixed;
  z-index: 302;
  left: 16px;
  bottom: 82px;
  right: 0;
  border-bottom-left-radius: 36px;
  @include breakpoint(br-768 up) {
    left: 109px;
    bottom: 0;
    right: 46%;
  }
  @include breakpoint(large up) {
    right: 40%;
  }
  @include breakpoint(br-1280 up) {
    left: 402px;
    width: calc(100vw - 324px - 39%);
    //position: unset;
    //width: auto;
  }
}

.custom-fee-prompt {
  padding: 24px;
  border-radius: 12px;
  border: dashed 1px #ffc21d;
  background-color: rgba(255, 194, 29, 0.12);
  text-rendering: optimizeLegibility;
  font-weight: 400;

  h2 {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    color: #252729;
    line-height: 28px;
    margin-bottom: 6px;
  }

  p {
    margin-bottom: 0;
    text-align: center;
    font-size: 14px;
    line-height: 21px;
    font-weight: 600;
    text-rendering: optimizeLegibility;
  }
}

.send-message-wrapper {
  box-shadow: 0 -8px 30px 0 rgba(0, 0, 0, 0.05);
  background-color: #ffffff;
  padding: 12px 80px 18px 12px;

  position: relative;

  textarea {
    padding: 13px 50px 6px 24px !important;
    z-index: 2;
    margin-bottom: 0;
    color: $charcoal;
    font-size: 16px !important;
    line-height: 22px !important;
    font-weight: 600 !important;
    border-radius: 4px;
    border-width: 0 !important;
    border-color: transparent !important;
    background-color: $jaredgrey !important;
    max-height: 82px;
    height: 54px;
    resize: none;
  }

  button {
    position: absolute;
    right: 10px;
    bottom: 18px;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    z-index: 3;
    margin-bottom: 0;
    box-shadow: 0 6px 24px 0 rgba(0, 0, 0, 0.18);

    i {
      font-size: 22px;
      @include absolute-center();
    }
  }
}

.adhere-to-line-breaks {
  word-break: break-word;
  white-space: pre-line;
}