﻿/* Utility */
.round-circle {
    border-radius: 50%;
}

/* Avatars */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    position: relative;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 11px;
}

.online-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #22c55e;
    bottom: 0;
    right: 0;
}

/* Main Page Grid */
.page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.messages-container {
    flex-grow: 1;
    overflow: hidden;
    padding: 30px;
}

@media (max-width: 991px) {
    .messages-container {
        padding: 15px;
    }
}

/* Column heights and scrolling */
.col-left,
.col-right {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.scrollable-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 10px; /* Space for scrollbar */
}

    /* Custom Scrollbar */
    .scrollable-content::-webkit-scrollbar {
        width: 6px;
    }

    .scrollable-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .scrollable-content::-webkit-scrollbar-thumb {
        background: #dee2e6;
        border-radius: 10px;
    }

/* LEFT COLUMN - Message List */
.col-left {
    background-color: white;
    border-radius: 16px;
    border: 1px solid #e9ecef;
    padding: 24px;
}

.search-wrapper {
    position: relative;
    margin-bottom: 24px;
}

    .search-wrapper i {
        position: absolute;
        left: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: #adb5bd;
    }

    .search-wrapper .form-control {
        padding-left: 42px;
        border-radius: 8px;
        background-color: #f4f5f7;
        border: 1px solid transparent;
        font-size: 14px;
    }

        .search-wrapper .form-control::placeholder {
            color: #adb5bd;
        }

        .search-wrapper .form-control:focus {
            background-color: white;
            border-color: #dee2e6;
            box-shadow: none;
        }

.message-list-item {
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    transition: background-color 0.2s ease;
}

    .message-list-item:hover {
        background-color: #f8f9fa;
    }

    .message-list-item.active {
        background-color: #f4f5f7;
    }

.mli-content {
    flex-grow: 1;
    min-width: 0; /* Important for text truncation */
}

.mli-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.mli-name {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.mli-property {
    font-size: 13px;
    color: #adb5bd;
    margin-bottom: 3px;
    font-weight: 500;
}

.mli-time {
    font-size: 11px;
    color: #adb5bd;
    font-weight: 600;
}

.mli-preview {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-truncate: true; /* Bootstrap text-truncate class */
}

.message-list-item.active .mli-preview {
    font-weight: 600;
    color: #1a1a1a;
}

.unread-badge {
    width: 18px;
    height: 18px;
    background-color: #0c1d37;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 15px;
    right: 15px;
}

/* RIGHT COLUMN - Chat Area */
.col-right {
    background-color: white;
    border-radius: 16px;
    border: 1px solid #e9ecef;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ch-content {
    flex-grow: 1;
}

.ch-name {
    font-weight: 700;
    font-size: 15px;
    margin: 0;
}

.ch-meta {
    font-size: 13px;
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .ch-meta .bi-star-fill {
        color: #ff9f00;
        font-size: 11px;
    }

.online-status {
    color: #22c55e;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: 16px; /* 133.333% */
}

.chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

    /* Custom scrollbar for chat body too */
    .chat-body::-webkit-scrollbar {
        width: 6px;
    }

    .chat-body::-webkit-scrollbar-thumb {
        background: #dee2e6;
        border-radius: 10px;
    }

.message-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 75%;
}

    .message-group.incoming {
        align-self: flex-start;
    }

    .message-group.outgoing {
        align-self: flex-end;
        flex-direction: row-reverse;
    }

.msg-avatar-placeholder {
    width: 28px;
    flex-shrink: 0;
}

.bubble-wrapper {
    display: flex;
    flex-direction: column;
}

.incoming .bubble-wrapper {
    align-items: flex-start;
}

.outgoing .bubble-wrapper {
    align-items: flex-end;
}

.msg-bubble {
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.incoming .msg-bubble {
    background-color: #f4f5f7;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
}

.outgoing .msg-bubble {
    background-color: #0c1d37;
    color: white;
    border-bottom-right-radius: 4px;
}

.msg-meta {
    font-size: 11px;
    color: #adb5bd;
    margin-top: 5px;
    font-weight: 500;
}

.outgoing .msg-meta {
    text-align: right;
}

.read-status {
    margin-left: 5px;
}

.chat-input-area {
    padding: 16px 24px 20px 24px;
    border-top: 1px solid #e9ecef;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 14px;
    gap: 6px;
}

    .input-wrapper .form-control {
        border: none;
        padding: 6px 10px;
        font-size: 14px;
    }

        .input-wrapper .form-control:focus {
            box-shadow: none;
        }

.icon-btn {
    background: none;
    border: none;
    color: #adb5bd;
    font-size: 16px;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.2s;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icon-btn:hover {
        color: #1a1a1a;
        background-color: #f4f5f7;
    }

.btn-send {
    background-color: #0c1d37;
    color: white;
    border: none;
    border-radius: 40%;
    width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    margin-left: auto;
}

    .btn-send:hover {
        background-color: #071221dc;
    }

/* Responsive Adjustments */
@media (max-width: 991px) {
    .page-wrapper {
        height: auto;
    }

    .scrollable-content,
    .chat-body {
        max-height: 400px;
    }

    .col-left {
        margin-bottom: 20px;
    }

    .chat-body {
        height: 400px;
    }
}
.avatar {
    overflow: hidden;
    position: relative;
}

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }

    .avatar span {
        position: relative;
        z-index: 2;
    }
.chat-unit-img {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 8px;
}

#chatMeta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.msg-sender-name {
    font-size: 12px;
    color: #6A7282;
    margin-bottom: 4px;
}

.chat-notice {
    width: fit-content;
    max-width: 80%;
    margin: 12px auto;
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff3cd;
    color: #664d03;
    font-size: 14px;
    text-align: center;
}

.avatar {
    overflow: hidden;
    position: relative;
}

    .avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
.chat-meta-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.chat-unit-title {
    font-size: 13px;
    color: #6A7282;
    font-weight: 500;
}