@import '../themes';

@include themify() {
  .message {
    display: flex;
    flex-direction: column;
    animation: showMessage 0.3s forwards;
  }

  @keyframes showMessage {
    from {
      transform: translateY(10%);
      opacity: 0.5;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }

  .message .timestamp {
    display: flex;
    justify-content: center;
    color: themed('secondaryForegroundColor');
    font-weight: 600;
    font-size: 12px;
    margin: 10px 0px;
    text-transform: uppercase;
  }

  .message .bubble-container {
    font-size: 14px;
    display: flex;
    word-wrap: break-word;
  }

  .message.mine .bubble-container {
    justify-content: flex-end;
  }

  .message.start .bubble-container .bubble {
    /* margin-top: 10px; */
    border-top-left-radius: 20px;
  }

  .message.end .bubble-container .bubble {
    border-bottom-left-radius: 20px;
    /* margin-bottom: 10px; */
  }

  .message.mine.start .bubble-container .bubble {
    margin-top: 10px;
    border-top-right-radius: 20px;
  }

  .message.mine.end .bubble-container .bubble {
    border-bottom-right-radius: 20px;
    margin-bottom: 10px;
  }

  .message .bubble-container .bubble {
    margin: 1px 0px;
    background: themed('backgroundColor');
    padding: 10px 15px;
    border-radius: 20px;
    max-width: 75%;
    border-top-left-radius: 2px;
    border-bottom-left-radius: 2px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
  }

  .message .bubble-container .bubble.file {
    background: none !important;
    border: 2px solid themed('backgroundColor');
    color: themed('primaryForegroundColor') !important;
    padding: 20px;
    text-align: center;
    width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
  }

  .message .bubble-container .bubble.file > i {
    font-size: 35px;
  }

  .message .bubble-container img.bubble {
    padding: 0px !important;
    object-fit: contain;
  }

  .message.mine .bubble-container .bubble {
    background: themed('primaryColor');
    color: themed('primaryColorForegroundColor');
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
    border-top-right-radius: 2px;
    border-bottom-right-radius: 2px;
    user-select: text;
  }
}
