.chat-button {
    position: fixed;
    bottom: 80px;
    inset-inline-end: 10px;
    color: white;
    padding: 15px;
    border-radius: 50px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    gap: 8px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    z-index: 9999;
}

.chat-popup {
    display: none;
    flex-direction: column;
    position: fixed;
    bottom: 10px;
    inset-inline-end: 10px;
    width: 320px;
    height: 450px;
    background-color: white;
    z-index: 1001;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.chat-header {
    color: #fff;
    background: linear-gradient(226.1deg, rgb(43, 164, 251) 0%, rgb(0, 88, 191) 101.24%);
    box-shadow: 0 1px 6.4px 0 rgba(33,33,33,.13);
    padding: 14px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .chat-header .chat-header__info {
        display: flex;
        align-items: center;
        gap: 8px;
    }

.chat-close {
    cursor: pointer;
    display: flex;
    align-items: center;
}

.chat-body {
    flex: 1;
    padding: 10px;
    /* height: calc(100% - 110px); */
    overflow-y: auto;
    background-color: #dedede;
    display: flex;
    flex-direction: column;
}

.message-link {
    text-decoration: underline;
}

.chat-message {
    margin: 5px;
    padding: 10px;
    border-radius: 10px;
    max-width: 70%;
    position: relative;
    clear: both;
    word-break: break-word;
}

.chat-message::after {
    display: block;
    width: 0;
    content: "";
    border: 15px solid transparent;
    position: absolute;
}


.chat-message.my-message::after {
    border-left-color: inherit;
    border-right: 0;
    right: -10px;
    top: calc(50% - 15px);
}

.chat-message.other-message::after {
    border-right-color: #f1f1f1;
    border-left: 0;
    left: -10px;
    top: calc(50% - 15px);
}

.chat-message .chat-img-container {
  max-width: 165px;
  margin-bottom: 10px;
}

.chat-message .chat-img-container img {
    border-radius: 10px;
    width: 100%;
    background-color: #fff;
}

.chat-message p {
    margin-bottom: 10px;
}

.my-message {
    background-color: #007bff;
    color: white;
    margin-left: auto; /* Aligns to the right */
    align-self: flex-end;
}

    .my-message .message-date {
        color: #E7E9EB;
        text-align: right;
    }

.other-message {
    background-color: #f1f1f1;
    color: black;
    margin-right: auto; /* Aligns to the left */
    text-align: start;
    align-self: flex-start;
}

    .other-message .message-date {
        color: #777;
        text-align: end;
    }

.message-date {
    display: block;
    font-size: 10px;
    margin-top: 10px;
}

.image-preview {
    max-width: 100%;
    border-radius: 10px;
    margin-top: 5px;
}

.file-preview {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

    .file-preview .download-btn {
        position: absolute;
    }

.my-message .file-preview .download-btn {
    top: 10px;
    inset-inline-end: 5px;
}

.other-message .file-preview .download-btn {
    top: 10px;
    inset-inline-end: 5px;
}

.file-preview .file-name {
    font-size: 12px;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.other-message .file-preview .file-name {
    color: #fff;
}

.clear-file-button {
    position: absolute;
    top: 5px;
    inset-inline-end: 5px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    color: red;
    z-index: 10;
}

.file-preview-container {
    display: flex;
    align-items: center;
    position: relative;
}

.file-preview-container .file-preview-container-error {
  color: red;
  padding: 12px 36px 12px 12px;
  background-color: #dedede;
  border-radius: 30px;
}

/* Input and send button */
.chat-input-container {
    display: flex;
    align-items: center;
    padding: 14px;
    gap: 8px;
    border-top: 1px solid #ddd;
}

.chat-input {
    width: 100%;
    min-height: auto;
    max-height: 154px;
    height: auto;
    border: none;
    resize: none;
    outline: none;
    padding: 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
    font-size: 14px;
}

.chat-send-button, #triggerFileInput {
    border: none;
    fill: #007bff;
    background-color: transparent;
    cursor: pointer;
}

.file-name-display {
    font-size: 12px;
    padding: 14px;
    display: none;
    flex-wrap: wrap;
}

.preview__file {
    min-width: 100px;
    background-color: #007bff;
    border-radius: 10px;
    padding: 14px;
}

.preview__file p {
    color: #fff;
    margin-top: 5px;
}

.chat-message--file {
    position: relative;
}

.chat-message--file .file-preview {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
    min-width: 125px;
    max-width: 190px;
}

.online-status {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-inline-start: 5px;
    margin-bottom: 9px;
}

.online-status--active {
    background-color: #06d115;
}

.online-status--deactive {
    display: none;
    background-color: #c5c5c5;
}

.chat-icon {
    fill: #007bff;
}

.chat-icon--white {
    fill: #fff;
}
.message-edited {
  font-size: 11px;
  color: #888;
  margin-left: 5px;
}

/*================ Medium devices (tablets, 768px and up) ================*/
@media only screen and (min-width: 768px) {
    .chat-button {
        bottom: 80px;
        inset-inline-end: 20px;
    }

    .chat-popup {
        width: 420px;
        height: 550px;
        bottom: 20px;
        inset-inline-end: 20px;
    }
}

/*================ XX-Large devices (larger desktops, 1400px and up) ================*/
@media only screen and (min-width: 1400px) {
    .chat-popup {
        width: 420px;
    }
}


/*================ XX-Large devices (larger desktops, 1680px and up) ================*/
@media only screen and (min-width: 1680px) {
    .chat-popup {
        width: 460px;
    }
}
