/* helper class css */

:root {
    --chat-secondary: #b8b8b8;
    --chat-background: #61593d;
    --chat-dark-text: #2c2c2c;
    --chat-light-text: #ffffff;
}

.chat-hidden {
    display: none !important;
}

.chat-flex {
    display: flex !important;
}

.m-0 {
    margin: 0 !important;
}

/* helper class css ends */

.chat-parent-container {
    position: fixed;
    right: 0px;
    bottom: 0px;
    width: 40%;
    display: flex;
    justify-content: end;
    z-index: 30;
    pointer-events: none;
}
.chat-toggle-container, .chat-view-container {
    pointer-events: all;
}
@media only screen and (max-width:768px) and (min-width:280px){
    .chat-parent-container {
        width: 100%;
    }
}
@media only screen and (max-width:1270px) and (min-width:769px){
    .chat-parent-container {
        width: 60%;
    }
}
.chat-view-close-button {
    padding: 5px;
}

/* chat box toggle button */
.chat-toggle-container {
    padding: 10px;
    padding-bottom: 0;
}

.chat-toggle-button {
    background: #D00B15;
    padding: 10px 20px;
    color: white !important;
    display: flex;
    align-items: center;
    position: relative;
    width: 150px;
    font-weight: 600;
    border: 1px solid white;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
}

.chat-unread-count {
    background: #c8191c;
    color: var(--chat-light-text) !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px !important;
    width: 20px !important;
    position: absolute;
    right: 5px;
    top: -10px;
}

.chat-message-icon {
    max-width: 20px;
    max-height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

/* chat box toggle button ends */

/* chat box container */

.chat-view-body {
    height: 50vh;
}

.chat-view-container {
    width: 90%;
    height: 100%;
    max-height: 600px;
    border-radius: 10px 10px 0 0;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #2c2c2c14;
    border-bottom: none;
    margin-right: 10px;
    background: var(--chat-light-text);
}

.chat-view-header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid var(--chat-dark-text);
    background: #D00B15;
}

.chat-view-header-text {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.chat-view-body {
    display: flex;
}

.chat-view-sidebar {
    overflow-x: hidden;
    width: 225px;
    background: var(--chat-dark-text);
    scrollbar-color: var(--primary-color) transparent;
    position: relative;
}

.chat-inbox-sidebar-toggle {
    display: none;
}

.chat-sidebar-img {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    transition: 0.1s all;
    max-width: unset;
}

.chat-sidebar-user {
    display: flex;
    gap: 10px;
    padding: 10px;
    color: var(--chat-light-text) !important;
    cursor: pointer;
}

.chat-sidebar-user-details {
    width: 100%;
}

.chat-sidebar-user-name {
    color: var(--chat-light-text) !important;
}

.chat-view-inbox {
    flex-grow: 1;
}

.chat-inbox-header {
    display: flex;
    gap: 5px;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    background: var(--chat-secondary);
    height: 10%;
}

.chat-inbox-body {
    padding: 0 10px;
    height: 80%;
    overflow-y: auto;
    scrollbar-color: var(--primary-color) transparent;
    position: relative;
}

.chat-inbox-refreshing {
    overflow-y: hidden;
}

.chat-inbox-refreshing .chat-inbox-loader-overlay {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
    cursor: wait;
}

.chat-inbox-loader-overlay {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    height: 100%;
    right: 0;
    left: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-inbox-footer {
    height: 10%;
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    align-items: center;
    background: #f1f1f1;
    border-top: 1px solid #2c2c2c14;
    position: relative;
}

.chat-inbox-input-group {
    display: block;
}

.chat-inbox-single-item {
    margin: 10px 0;
    display: flex;
    gap: 5px;
    align-items: end;
}

.chat-inbox-single-avatar {
    margin-bottom: 25px;
}

.chat-inbox-input-group {
    display: flex;
    width: 90%;
}

.chat-inbox-send-attachment-icon {
    fill: var(--primary-color);
    color: var(--chat-dark-text);
    max-height: 30px;
    max-width: 30px;
}

.chat-inbox-send-button {
    width: 10%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-inbox-attachment-input {
    padding: 0 10px;
    position: relative;
    border-right: 1px solid #2c2c2c14;
    display: flex;
    align-items: center;
}

.chat-attachment {
    align-items: center;
}

span.attachment {
    overflow-wrap: anywhere;
}

.chat-inbox-text-input textarea {
    width: 100%;
    border: none;
    padding: 7px 20px;
    resize: none;
}

.chat-sidebar-user-text {
    color: var(--chat-secondary) !important;
    margin-top: -2px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    max-width: 140px;
}

.chat-inbox-unread .chat-sidebar-user-text {
    color: var(--primary-color) !important;
}

.chat-inbox-text-input {
    flex-grow: 1;
    display: flex;
    align-items: center;
}

li.chat-inbox-single-item.chat-inbox-sent {
    flex-direction: row-reverse;
}

.chat-inbox-message-list {
    padding: 0;
}

.chat-inbox-single-content {
    overflow: hidden;
    max-width: 300px;
    background-color: #f3f3f3;
    color: var(--chat-dark-text);
    padding: 9px 13px;
    border-radius: 10px 10px 10px 0px;
}

.chat-inbox-single-content img {
    max-height: 100%;
    max-width: 100%;
    border-radius: 10px;
    object-fit: contain;
    cursor: pointer;
}

.chat-inbox-sent .chat-inbox-single-content {
    border-radius: 10px 10px 0px 10px;
    background: var(--primary-color);
    color: var(--chat-dark-text);
}

.chat-inbox-single-avatar {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.chat-inbox-single-avatar img {
    width: 25%;
    height: 25%;
    object-fit: cover;
    border-radius: 50%;
}

.circle-background {
    width: 35px; /* Lebar lingkaran */
    height: 35px; /* Tinggi lingkaran */
    background-color: #FFF; /* Warna latar belakang */
    border-radius: 50%; /* Membuat bentuk lingkaran */
    display: flex; /* Agar konten di dalam lingkaran bisa diatur */
    align-items: center; /* Konten di tengah secara vertikal */
    justify-content: center; /* Konten di tengah secara horizontal */
    color: white; /* Warna teks */
    font-size: 16px; /* Ukuran teks */
    text-align: center; /* Teks di tengah */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Menambahkan bayangan */
}


.chat-sidebar-user:hover,
.chat-sidebar-user.chat-user-active {
    background: #3d3d3d;
}

.chat-inbox-single-message {
    display: flex;
    flex-direction: column;
    align-items: self-end;
}

.chat-inbox-header-button {
    display: flex;
    gap: 10px;
}

.chat-sidebar-topbar {
    padding: 10px;
    width: 100%;
}

.chat-sidebar-topbar-input:focus-visible,
input.chat-sidebar-topbar-input:active {
    outline: none;
    border-bottom-color: #2c2c2c14;
}

.chat-sidebar-topbar-input {
    height: 30px;
    border: none;
    border-bottom: 1px solid #2c2c2c14;
    background: transparent;
    padding: 5px;
    color: var(--chat-light-text) !important;
    width: 100%;
}

small.chat-chat-inbox-time {
    color: #a4a4a4 !important;
    margin-top: 3px;
}

.chat-attachment {
    display: flex;
    cursor: pointer;
}

.chat-inbox-single-content a {
    text-decoration: none;
    color: inherit;
}

.chat-attachment svg {
    fill: var(--chat-dark-text);
}

.secondary-chat-sidebar-toggle-button svg {
    padding: 10px;
    box-sizing: content-box;
}

.chat-parent-container * {
    box-sizing: border-box;
}

.chat-inbox-attachment-input input {
    display: none;
}

.chat-inbox-attachment-input label {
    margin: 0;
}

/* from old css code */
.no-message-svg {
    display: flex;
    gap: 20px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.login-chat-message-design {
    display: flex;
    justify-content: center;
    align-items: center;
}

.no-msg-container {
    height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.no-msg-container .no-msg {
    font-family: DM Sans;
    font-style: normal;
    font-weight: bold;
    font-size: 16px;
    line-height: 21px;
    text-transform: uppercase;
    color: #2c2c2c;
}
.no-msg-container .new-conv {
    font-family: Roboto;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #b0b0b0;
}

.no-msg-style {
    display: flex;
    margin-left: 75px;
    margin-top: 7px;
}
.no-msg-style-icon {
    width: 36px;
    height: 36px;
    fill: #b0b0b0;
}

.msg-header-icon {
    width: 18px;
    height: 19px;
}

.chat-error-message {
    position: absolute;
    width: 100%;
    bottom: 0;
    padding: 10px;
    list-style: none;
    color: red;
    box-shadow: 0px -10px 10px -15px #000000;
    transition: 0.1s ease-out;
    opacity: 0;
    pointer-events: none;
    background: #f1f1f1;
    visibility: hidden;
    z-index: 0;
}

.chat-error-message li {
    list-style: none !important;
    color: red !important;
}

.chat-error-show {
    opacity: 1;
    bottom: 100%;
    visibility: visible;
    z-index: 10;
}

.chat-error-message.chat-error-show ul {
    font-size: 14px;
    padding: 0px 20px;
    list-style: disc;
}

.chat-inbox-refreshing .chat-inbox-sidebar-reload svg {
    animation: spinner 1.5s linear infinite;
}
/* from old css code */


.chat-inbox-single-content .item-footer a{
    background: var(--chat-background);
    color: white;
    padding: 5px;
    display: inline-block;
    margin: 10px 0 5px 0;
}

/* chat box container ends */

/* media queries */

@media (max-width: 650px) {
    .chat-inbox-sidebar-toggle {
        display: block;
    }

    .chat-header-sidebar-mobile .chat-sidebar-user-details {
        display: none;
    }

    .chat-header-sidebar-mobile .chat-sidebar-topbar {
        display: none;
    }

    .chat-view-sidebar {
        width: 380px !important;
    }

    .chat-header-sidebar-mobile {
        width: 55px !important;
    }

    .chat-sidebar-img {
        height: 35px;
        width: 35px;
    }

    .chat-header-sidebar-mobile .chat-sidebar-img {
        height: 30px;
        width: 30px;
    }

    .chat-inbox-single-content {
        max-width: 200px !important;
    }

    .secondary-chat-sidebar-toggle-button {
        display: flex;
        flex-direction: row-reverse;
        width: auto;
    }
}

/** Customize Scrollbar **/

.chat-view-sidebar::-webkit-scrollbar,
.chat-inbox-body::-webkit-scrollbar {
    width: 3px;
    background: transparent;
}

.chat-view-sidebar::-webkit-scrollbar-track,
.chat-inbox-body::--webkit-scrollbar-track {
    box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
}

.chat-view-sidebar::-webkit-scrollbar-thumb,
.chat-inbox-body::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    outline: 1px solid var(--chat-light-text);
}

/* loader */

.icon-spinner {
    width: 25px;
    height: 25px;
    display: none;
    padding: 0px;
    border-radius: 100%;
    border: 4px solid;
    border-top-color: var(--primary-color);
    border-bottom-color: rgba(255, 255, 255, 0.3);
    border-left-color: var(--primary-color);
    border-right-color: var(--primary-color);
    -webkit-animation: spinner 0.8s linear infinite;
    animation: spinner 0.8s linear infinite;
}

.message-state-loading .icon-spinner {
    display: block;
}

@keyframes spinner {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.message-state-loading .loader-container {
    display: block;
}

.message-state-loading .has-loader-effect {
    display: none;
}
.chat-inbox-refreshing .chat-view-sidebar {
    display: block;
}


/* rtl implementation */

html[dir="rtl"] .chat-parent-container {
    right: unset;
    left:0px;
    bottom: 0px;
}

html[dir="rtl"] .chat-unread-count {
    right: unset;
    left: 5px;
}
html[dir="rtl"] .chat-message-icon {
    margin-left: 10px;
    margin-right: unset;
}
html[dir="rtl"] .chat-view-container {
    margin-left: 10px;
    margin-right: unset;
}
html[dir="rtl"] .no-msg-style {
    margin-right: 75px;
    margin-left: unset;
}
html[dir="rtl"] .chat-inbox-single-content {
    border-radius: 10px 10px 0px 10px;
}
html[dir="rtl"] .chat-inbox-sent .chat-inbox-single-content {
    border-radius: 10px 10px 10px 0px;
}
