$message-view-container-wrapper-max-height: 800px;
$message-view-container-wrapper-min-width: 720px;
$message-view-container-header-min-height: 64px;
$message-view-container-chat-input-min-height: 54px;
$message-view-container-information-min-height: 16px;
$message-view-container-information-background-color: var(--color-background-info);
$message-view-container-background-color: var(--secondary-background);
$message-view-container-sender-message-background-color: var(--incoming-background);
$message-view-container-outgoing-message-background-color: var(--outgoing-background);
$message-view-container-message-text-color: var(--main-text);
$message-view-container-date-time-text-color: var(--secondary-text);
$message-view-container-ai-translate-text-color: var(--tertiary-elements);
.message-view-container{
  // min-height: $message-view-container-wrapper-max-height;
  // max-height: $message-view-container-wrapper-max-height;
  display: flex;
  flex-flow: column nowrap;

  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  gap: 3px;
  // min-width: var(--max-width-message-view-container);


  &--header{
    min-height: $message-view-container-header-min-height;
    max-height: $message-view-container-header-min-height;
    width: 100%;

    .dialog-header{
      &__title {
        font: var(--title-title-medium);
      }
    }
  }
  &--information{
    background-color: $message-view-container-information-background-color;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 3px;

    max-height: $message-view-container-information-min-height;
    min-height: $message-view-container-information-min-height;
    width: 100%;
    padding-bottom: 2px;
    padding-top: 2px;
    border-radius: 4px;
    margin-left: 20px;
    margin-right: 20px;
    line-height: $message-view-container-information-min-height;
    font-size: 11px;
  }
  &--messages{
    background-color: $message-view-container-background-color;
    width: 100%;
    //max-height: calc(800px - 128px - 16px);
    max-height: calc(800px - 128px - 64px);

    display: flex;
    flex-flow: column nowrap;
    justify-content: flex-end;

  }
  &--system-message-wrapper{
    justify-content: center;
    align-items: center;
    justify-items: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    margin: 0 auto;
    gap: 3px;
    padding: 20px 0px 10px 0px;
    &__date_container{
      // background-color: var(--disabled-elements);
      border-radius: 30px;
      // width: 72px;
      height: 20px;

      font-family: 'Roboto';
      font-style: normal;
      font-weight: 500;
      font-size: 11px;
      line-height: 16px;

      text-align: center;
      letter-spacing: 0.5px;
      justify-content: center;
      align-items: center;
      justify-items: center;
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      margin: 0 auto;
      gap: 3px;
    }
  }
  &--incoming-message-wrapper{
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-top: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    gap: 8px;

    &__message{
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: flex-start;
      gap: 8px;
    }

    &__avatar{
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      align-items: center;
    }
  }
  &__sender-avatar{
    min-height: 36px;
    min-width: 36px;
    max-height: 36px;
    max-width: 36px;
    height: 36px;
    width: 36px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    display: flex;
    background-color: var(--disabled-elements);
  }
  &--incoming-message-container{
    display: flex;
    flex-flow: column nowrap;
    gap: 3px;
    height: 100%;
    max-width: 504px;
  }
  &__sender-name{
    color: $message-view-container-date-time-text-color;
    padding-left: 16px;
  }
  &__sender-message{
    background: $message-view-container-sender-message-background-color;
    border-radius: 22px 22px 22px 0px;
    padding: 8px 12px;
    color: $message-view-container-message-text-color;
  }
  &__widget-ai-translate{
    text-align: left;
    margin-left: 46px;
    font-family: Roboto;
    font-size: 11px;
    font-style: normal;
    font-weight: 500;
    line-height: 16px; /* 145.455% */
    letter-spacing: 0.5px;
    color: $message-view-container-ai-translate-text-color;
    align-self: self-start;
    white-space: nowrap;
    cursor: pointer;
  }
  &__incoming-time{
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font: var(--label-label-small, 500 11px/16px "Roboto", sans-serif);
    color: $message-view-container-message-text-color;
  }
  &__status-message {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    gap: 2px;
  }
  &--outgoing-message-wrapper{
    margin-right: 20px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
    margin-top: 10px;
    min-height: 52px;
  }
  &__outgoing-message{
    background: $message-view-container-outgoing-message-background-color;
    border-radius: 22px 22px 0px 22px;
    padding: 8px 12px;
    height: 100%;
    max-width: 504px;
    color: $message-view-container-message-text-color;
  }
  &--message-content-wrapper{
    max-width: 300px;
    max-height: 160px;
    // min-width: 300px;
    // width: 300px;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    // justify-content: center;
    align-items: center;
    margin: 0 auto;
    padding: 0;

    border-radius: 4px;
  }
  &--file-message-content-wrapper{
    max-width: 85px;
    max-height: 32px;
    min-width: 85px;
    min-height: 32px;
    width: 85px;
    height: 32px;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    gap: 12px;

  }
  &__file-message-icon{
    min-height: 32px;
    min-width: 32px;
    max-height: 32px;
    max-width: 32px;
    height: 32px;
    width: 32px;
    border-radius: 4px;
    background: var(--caption);
  }
  &--warning-error{
    min-height: 11px;
    max-height: 11px;
    height: 11px;
    justify-content: flex-start;
    align-items: flex-start;
    justify-items: flex-start;
    text-align: left;
    vertical-align: middle;
    line-height: 11px;
    font-size: 10px;
    color: var(--main-elements);
    font-weight: bold;

    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    margin: 0 auto;
    gap: 3px;
  }
  &--chat-input{
    &:disabled{
      background-color: dimgrey;
      color: linen;
      opacity: 1;
      cursor: not-allowed;
    }
    min-height: $message-view-container-chat-input-min-height;
    max-height: calc(2 * $message-view-container-header-min-height + $message-view-container-chat-input-min-height);
    height: $message-view-container-chat-input-min-height;

    width: 100%;
    display: flex;
    //
    flex-direction: row;
    flex-wrap: nowrap;

    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding-left: 12px;
    padding-right: 12px;
    padding-bottom: 2px;

    gap: 6px;

    textarea{
      width: 100%;
      height: 44px;
      min-Height: 44px;
      max-Height: calc(2 * $message-view-container-header-min-height);
      background-Color: var(--chat-input);
      border-Radius: 4px;
      padding-left: 16px;
      padding-top: 8px;
      line-height: 24px;
      font-size: 16px;
      margin: 0 auto;
      resize: none;
    }

  }
  &__loader{
    fill: var(--color-background-info);

    svg path{
      fill: var(--color-background-info);
    }
  }
}

.input-text-message * {
  box-sizing: border-box;
}
.input-text-message {
  background: var(--chat-input);
  border-radius: 4px;
  //padding: 10px 8px 10px 16px;
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-end;
  justify-content: flex-start;
  flex: 1;
  position: relative;
}

.type-message {
  color: var(--field-border);
  text-align: left;
  font: var(--body-body-large);
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.type-message textarea{
  color: var(--input-elements);
  font: var(--body-body-large);
  border: none;
  outline: none;
}
.right {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  position: relative;
  margin-bottom: 5px;
}
.ai-assist-icon {
  border-radius: 4px;
  display: flex;
  flex-direction: row;
  gap: 0px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  position: relative;
}

