/* === Shared Styles === */
.chat-message {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    word-wrap: break-word;
    display: inline-block;
    position: relative;
    line-height: 1.4;
}

.chat-message.sent {
    background-color: #0073aa;
    color: white;
    align-self: flex-end;
    text-align: left;
    border-bottom-right-radius: 5px;
}

.chat-message.received {
    background-color: #e5e5e5;
    color: black;
    align-self: flex-start;
    text-align: left;
    border-bottom-left-radius: 5px;
}

.chat-message.sent::after,
.chat-message.received::after {
    content: "";
    display: block;
    clear: both;
}

/* === Chat Popup === */
.chat-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    border-radius: 12px;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

.chat-popup.show {
    display: flex;
}

.chat-subheader {
    background: #7031a0;
    color: white;
    font-size: 14px;
    padding: 0 14px 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    border-bottom: 1px solid #005f94;
}

.chat-subheader i.fa-calendar {
    color: white;
    font-size: 16px;
}

.chat-header {
    padding: 12px;
    background: #7031a0;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    text-align: center;
}

.chat-header .close-chat {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 12px;
    height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f9f9f9;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ccc;
    background: white;
    align-items: center;
}

.chat-input textarea {
    flex: 1;
    resize: none;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    height: 40px;
}

.chat-input button {
    margin-left: 8px;
    background: #7031a0;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.chat-input button:hover {
    background: #eaebef;
}

/* === Inbox Layout === */
#message-inbox {
    display: flex;
    width: 100%;
    max-width: 1100px;
    height: 450px;
    margin: 0 auto;
    border: 1px solid #ccc;
    font-family: "Nunito", sans-serif;
    background: white;
    overflow: hidden;
}

.inbox-sidebar {
    width: 35%;
    background: #f1f1f1;
    padding: 10px;
    border-right: 1px solid #ccc;
    overflow-y: auto;
}

#conversation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#conversation-list li {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#conversation-list li:hover {
    background: #ddd;
}

.conversation-avatar {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.conversation-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.conversation-name {
    font-weight: normal;
    font-size: 16px;
}

.conversation-message {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.inbox-chat {
    width: 65%;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
}

.inbox-chat .chat-header {
    padding: 12px;
    background: #7031a0;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
}

.inbox-chat .chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.inbox-chat .chat-input {
    display: flex;
    padding: 12px;
    border-top: 1px solid #ccc;
    background: white;
    align-items: center;
}

/* === Banners === */
.chat-banner-area {
    padding: 0px 10px 0px;
    background-color: #fff8db;
    font-size: 14px;
    font-weight: 500;
}

.chat-banner-area.hidden {
	display: none;
}

.chat-booking-banner,
.chat-warning-banner {
    display: block;
    line-height: 1.4;
	height: 36px;
    background-color: #f1f1f1;
    padding: 10px 15px 10px;
	margin: 0px;
    margin-left: -10px;
    margin-right: -10px;
	border-bottom: 1px solid #ccc;
}

.chat-warning-banner {
    background-color: #fff8db;
    color: #383838;
    font-weight: normal;
    padding: 6px 14px 0px 14px;
    font-size: 14px;
    display: none;
    align-items: center;
    gap: 8px;
	height: 50px;
}

.chat-warning-banner i {
    margin-right: 6px;
    color: black !important;
}

/* === Misc === */
.unread-message {
    font-weight: bold;
    color: #000;
}

/* === Responsive === */
@media (max-width: 600px) {
    #message-inbox {
        flex-direction: column;
        height: auto;
    }

    .inbox-sidebar,
    .inbox-chat {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 400px) {
    .chat-popup {
        width: 90%;
        right: 5%;
    }
}
