/* 
This file contains the styling specifically related to individual messages, 
including media queries that affect them.
*/

.msg {
    flex-direction: row; /* Revert to horizontal layout */
    align-items: flex-end; /* Align items to the bottom */
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;
    margin-left: 5px; /* Add this line to compensate for box-sizing: inherit */
    margin-right: 5px; /* Add this line to compensate for box-sizing: inherit */
}


.msg:last-of-type {
    margin: 0;
}

.msg-img {
    width: 40px;
    height: 40px;
    margin-right: 5px;
    background: #ddd;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 50%;
}

.msg-bubble {
    max-width: calc(100% - 45px);
    padding: 15px;
    border-radius: 15px;
    background: var(--left-msg-bg);
    flex-grow: 1; /* Add this property to make msg-bubble expand */
    word-break: break-word; /* Handle long words */
}


.msg-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.msg-info-name {
    margin-right: 10px;
    font-weight: bold;
}

.msg-info-time {
    font-size: 0.85em;
}

.left-msg .msg-bubble {
    border-bottom-left-radius: 0;
}

.right-msg {
    flex-direction: row-reverse;
}

.right-msg .msg-bubble {
    background: var(--right-msg-bg);
    color: #fff;
    border-bottom-right-radius: 0;
}

.right-msg .msg-img {
    margin: 0 0 0 10px;
}

.msg-buttons{
    margin-top: 10px;
    position: relative;
}

.thumb-up, .thumb-down,.copy-btn2 {
    /*background-color: rgb(193, 193, 193)  White background */
    border: 1px solid #2a2a2a; /* Add a border, change color as needed */
    border-radius: 50%; /* Make the border round */
    cursor: pointer;
    float: right;
    margin-left: 10px;
    padding: 2px; /* Add padding to create space around the image */
    display: flex; /* Use flex to center the image */
    align-items: center; /* Vertical alignment */
    justify-content: center; /* Horizontal alignment */
  }
  
  .thumb-up img, .thumb-down img, .copy-btn img {
    width: 20px;
    height: 20px;
  }

  .thumb-up-active {
    background-color: rgb(67, 196, 123, 0.2);
    border: 1px solid rgb(67, 196, 123);
  }
  
  .thumb-down-active {
    background-color: rgb(196, 67, 67, 0.2);
    border: 1px solid rgb(196, 67, 67);
  }
  
 
  .copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    float: right;
    margin-left: 10px;
    padding: 2px; /* Add padding to create space around the image */
    display: flex; /* Use flex to center the image */
    align-items: center; /* Vertical alignment */
    justify-content: center; /* Horizontal alignment */
  }

.copy-tooltip {
    visibility: hidden;
    background-color: #555;
    color: #fff;
    text-align: center;
    padding: 5px;
    border-radius: 5px;
    position: absolute;
    z-index: 1;
    font-size: 12px;
    top: 0;
    right: 110px; 
  }
  
  .copy-tooltip.show {
    visibility: visible;
  }
  
  

/* Media queries specific to messages */
@media (max-width: 600px) {
    .msg {
        flex-direction: row; /* Revert to horizontal layout */
        align-items: flex-end; /* Align items to the bottom */
        margin-left: 5px; /* Add this line to compensate for box-sizing: inherit */
        margin-right: 5px; /* Add this line to compensate for box-sizing: inherit */
    }

    .msg-img {
        margin-bottom: 0; /* Remove margin-bottom */
        width: 35px; /* Adjust the width as needed */
        height: 35px; /* Adjust the height as needed */
        margin-right: 5px; /* Adjust the margin as needed */
    }

    .msg-bubble {
        max-width: calc(100% - 40px); /* Adjust max-width to leave space for img */
        border-radius: 15px;
        background: var(--left-msg-bg);
        flex-grow: 1; /* Make msg-bubble take available space */
        word-break: break-word; /* Handle long words */
    }

    .left-msg .msg-bubble {
        border-bottom-left-radius: 0;
    }

    .right-msg {
        flex-direction: row-reverse;
    }

    .right-msg .msg-bubble {
        background: var(--right-msg-bg);
        color: #fff;
        border-bottom-right-radius: 0;
    }

    .right-msg .msg-img {
        margin: 0 0 0 10px;
    }
}
