/* =========================================
   FLOAT BUTTON
========================================= */

.chat-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background: #0d6efd;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
	pointer-events: auto;

    z-index: 10000;

    box-shadow: 0 5px 18px rgba(0,0,0,.25);

    font-size: 24px;
}

.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;

    background: #dc3545;
    color: #fff;

    border-radius: 999px;

    min-width: 20px;
    height: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;
}

.chat-unread-badge {
    position: relative;
    top: -5px;
    right: -5px;
border-radius: 2em;
    background: #dc3545;
    color: #fff;
padding-left:.35em;
padding-right:.65em;
    min-width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

/* =========================================
   SIDEBAR USER ITEM
========================================= */

.chat-user {
    pointer-events: auto;	
	min-width: 0;	
	
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 10px 12px;

    cursor: pointer;

    transition: background .15s ease;
}

.chat-user:hover {
    background: #f5f7fb;
}

.chat-user img {
    width: 42px;
    height: 42px;

    border-radius: 50%;
    object-fit: cover;
}

/* =========================================
   POPUP CHAT WINDOWS
========================================= */

.chat-box {
    width: 320px;
    height: 420px;

    background: #fff;

    border-radius: 12px 12px 0 0;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    box-shadow: 0 5px 20px rgba(0,0,0,.2);
}


/* =========================================
   MESSAGES
========================================= */

.chat-body {
    flex: 1;

    overflow-y: auto;

    padding: 10px;

    background: #f5f7fb;
}

/* =========================================
   MESSAGE ROWS
========================================= */

.chat-message {
    display: flex;
    margin-bottom: 8px;
}

.chat-message.me {
    justify-content: flex-end;
}

.chat-message.other {
    justify-content: flex-start;
}

/* =========================================
   BUBBLES
========================================= */

.chat-bubble {
    max-width: 72%;

    padding: 8px 12px;

    border-radius: 18px;

    font-size: 13px;

    word-break: break-word;
}

.chat-message.me .chat-bubble {
    background: #0d6efd;
    color: #fff;
}

.chat-message.other .chat-bubble {
    background: #e9ecef;
}

/* =========================================
   INPUT
========================================= */

.chat-footer {
    border-top: 1px solid #ddd;

    padding: 8px;

    background: #fff;
}

/* =========================================
   ONLINE DOT
========================================= */

.online-dot {
    width: 10px;
    height: 10px;

    background: #22c55e;

    border-radius: 50%;

    display: inline-block;
}


/* =========================================
   SCROLLBARS
========================================= */

.chat-body::-webkit-scrollbar,
.chat-sidebar-list::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb,
.chat-sidebar-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 999px;
}

.chat-header {
    height: 52px;

    background: #0d6efd;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 12px;

    font-weight: 600;

    gap: 10px;
}

.chat-header button {
    flex-shrink: 0;
}

.chat-header-title {
    flex: 1;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-close-btn {
    border: none;

    background: rgba(255,255,255,.2);

    color: #fff;

    width: 28px;
    height: 28px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition: background .15s ease;
}
.chat-action-btn {
    border: none;

    background: rgba(255,255,255,.2);

    color: #fff;

    width: 60px;
    height: 28px;

    border-radius: 2em;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition: background .15s ease;
}


.chat-close-btn:hover {
    background: rgba(255,255,255,.35);
}

.chat-sidebar-header {
    height: 56px;

    background: #0d6efd;
    color: #fff;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 14px;

    border-bottom: 1px solid rgba(255,255,255,.12);

    font-weight: 600;
}

.chat-sidebar-title {
    font-size: 15px;
    font-weight: 600;
}

.chat-sidebar-list {
    position: relative;
    z-index: 2;
}



.chat-container {
    position: fixed;

    right: 360px;
    bottom: 20px;

    display: flex;
    align-items: flex-end;
    gap: 12px;

    z-index: 1050;

	pointer-events: auto;

    max-width: calc(100vw - 380px);
}

.chat-box {
    pointer-events: auto;
}



.chat-sidebar-list {
    flex: 1;

    overflow-y: auto;
    overflow-x: hidden;

    min-width: 0;
    min-height: 0;
}



.chat-user-text {
    flex: 1;
    min-width: 0;
}

#chatSidebarList {
    position: relative;

    flex: 1;

    min-width: 0;
    min-height: 0;

    width: 100%;
    max-width: 100%;

    overflow-y: auto;
    overflow-x: hidden;

    box-sizing: border-box;
}

.chat-sidebar-dock {
    position: fixed;

    top: 80px;
    right: 10px;

    width: 340px;
    height: calc(100vh - 152px);

    z-index: 99999;

    display: none;
    flex-direction: column;
	
	color: #FFF;
	
	background-color: rgba(255, 255, 255, 0.6);

    border-left: 1px solid #ddd;

    box-shadow: -2px 0 10px rgba(0,0,0,.08);

    overflow: hidden;

    contain: layout paint size;
	pointer-events: auto;

    will-change: transform;
}

.chat-user-content {
    flex: 1;

    min-width: 0;

    overflow: hidden;
}

.chat-user-name {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.chat-user-preview {
    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;

    min-width: 0;
}

#chatOverlayRoot {
    position: fixed;

    inset: 0;

    pointer-events: none;

    z-index: 9999;
}

.chat-sidebar-dock.open {
    display: flex;
}


/* =========================================
   Messenger chat/index.php
========================================= */


.messenger-page {
    display: flex;

    height: calc(100vh - 70px);

    background: #f5f7fb;
}

/* LEFT */

.messenger-sidebar {
    width: 320px;

    background: #fff;

    border-right: 1px solid #ddd;

    display: flex;
    flex-direction: column;
}

.messenger-sidebar-header {
    padding: 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #eee;
}

.messenger-conversation-list {
    flex: 1;

    overflow-y: auto;
}

/* CENTER */

.messenger-chat-area {
    flex: 1;

    display: flex;
    flex-direction: column;

    background: #fff;
	
    min-width: 0;
	
}

/* RIGHT */

.messenger-details {
    width: 300px;

    background: #fff;

    border-left: 1px solid #ddd;
}

/* EMPTY */

.messenger-empty-state {
    flex: 1;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;

    color: #666;
}

.details-avatar {
    width: 90px;
    height: 90px;

    border-radius: 50%;

    object-fit: cover;
}

.details-member-avatar {
    width: 32px;
    height: 32px;

    border-radius: 50%;

    object-fit: cover;
}

.messenger-chat-shell {
    height: 100%;

    display: flex;
    flex-direction: column;
}

/* HEADER */

.messenger-chat-header {
    height: 72px;

    padding: 0 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #eee;

    background: #fff;

    flex-shrink: 0;
}

.messenger-chat-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    object-fit: cover;
}

/* MESSAGES */

.messenger-chat-messages {
    flex: 1;

    overflow-y: auto;

    padding: 20px;

    background: #f5f7fb;
}

/* ROW */

.message-row {
    display: flex;

    align-items: flex-end;

    gap: 8px;

    margin-bottom: 14px;
	
}

.message-row.mine {
    justify-content: flex-end;
}

/* AVATAR */

.message-avatar {
    width: 32px;
    height: 32px;

    border-radius: 50%;

    object-fit: cover;
}

/* BUBBLE */

.message-bubble {
    display: inline-flex;

    flex-direction: column;

    align-items: flex-start;

    width: fit-content;

    max-width: 70%;

    padding: 10px 14px;

    border-radius: 18px;

    background: #fff;

    box-shadow: 0 1px 3px rgba(0,0,0,.06);

    word-break: break-word;
}

.message-row.mine .message-bubble {
    background: #0d6efd;

    color: #fff;
}

/* TEXT */

.message-sender {
    font-size: 12px;

    font-weight: 600;

    margin-bottom: 4px;
}

.message-time {
    font-size: 11px;

    opacity: .7;

    margin-top: 4px;

    text-align: right;
}

/* INPUT */

.messenger-chat-input {
    display: flex;

    align-items: flex-end;

    gap: 10px;

    padding: 14px;

    border-top: 1px solid #eee;

    background: #fff;

    flex-shrink: 0;
}

.messenger-chat-input textarea {
    resize: none;

    border-radius: 18px;
}

.messenger-details {
    width: 300px;

    background: #fff;

    border-left: 1px solid #ddd;

    display: flex;
    flex-direction: column;
}

.messenger-details-header {
    padding: 16px;

    border-bottom: 1px solid #eee;

    flex-shrink: 0;
}

.conversation-details-body {
    flex: 1;

    overflow-y: auto;

    padding: 16px;
}
.messenger-empty-state {
    flex: 1;

    display: flex;

    align-items: center;
    justify-content: center;

    text-align: center;

    height: 100%;
}

.message-text {
    white-space: normal;

    word-break: break-word;
}

#chatWindowContainer {
    flex: 1;

    display: flex;
    flex-direction: column;

    min-height: 0;
}
