﻿/* ========== Layout and Header ========== */
.chat-wrapper {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
}

.chat-content {
    width: 100%;
    transition: margin-left 0.3s ease;
    overflow: hidden;
}

/*.chat-container {
    display: flex;
    flex-direction: row;
    gap: 10px;*/ /* 10px space from main nav */
    /*height: 100%;
    padding-left: 10px;*/ /* Ensure chat starts away from main nav */
    /*box-sizing: border-box;
}

.main-chat-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}*/

.chat-header {
    background-color: #0278d7;
    color: white;
    padding: 12px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    border-bottom: 5px solid #ccc;
}

.chat-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
}

/* ========== ChatUI Body ========== */
.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ========== ChatUI Styling ========== */
.template-chatui .e-chat-ui .e-footer {
    margin: unset;
    align-self: auto;
}

.template-chatui .e-right .message-items {
    border-radius: 16px 16px 2px 16px;
    background-color: #7b61ff;
    color: white;
}

.template-chatui .e-left .message-items {
    border-radius: 16px 16px 16px 2px;
    background-color: #f5f5f5;
}

.template-chatui .message-items {
    padding: 5px;
}

.e-chat-ui .e-message-icon.custom-user {
    background-color: #416fbd;
    color: white;
    border-radius: 5px;
}

.typing-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    font-style: italic;
}

.typing-dots {
    height: 18px;
}

/* ========== Footer Styling ========== */
.custom-footer {
    display: flex;
    gap: 10px;
    padding: 10px;
    width: 100%; /* ⬅️ Make it span full width */
    box-sizing: border-box;
}

#textArea {
    flex-grow: 1;
    border-radius: 5px;
    border: 1px solid #ccc;
    padding: 6px 10px;
}

/* ========== Toolbar and Dropdown ========== */
.custom-dropdown.e-dropdown-popup ul {
    min-width: 100px;
}

/* ========== Time Break & Empty Chat ========== */
.timebreak-wrapper {
    background-color: #6495ed;
    color: white;
    border-radius: 5px;
    padding: 2px 6px;
    margin: 10px 0;
    display: inline-block;
}

.empty-chat-text {
    font-size: 15px;
    text-align: center;
    margin-top: 90px;
    color: #666;
}

/* ========== Sidebar ========== */
.chat-sidebar {
    height: 100%;
    background-color: #f4f4f4;
    border-right: 1px solid #ccc;
}

/* Sidebar should not overlay main nav */
body .e-sidebar.e-left.chat-sidebar {
    z-index: 0 !important;
}

/* Prevent initial content shift */
.e-sidebar.e-left.chat-sidebar + .chat-content {
    margin-left: 250px; /* equal to sidebar width */
}

/* ========== Toggle Button ========== */
.toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    margin-right: 10px;
    cursor: pointer;
}

/* ========== TreeView Styling ========== */
.treeview-chat {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    padding: 10px;
    background-color: #f4f4f4;
    box-sizing: border-box;
    overflow-y: auto;
    border-right: 1px solid #ccc;
}

#GroupTreeView {
    font-size: 0.95rem;
}

    #GroupTreeView .e-list-text {
        padding: 6px 10px;
        font-weight: 500;
    }

    #GroupTreeView .e-active {
        background-color: #0278d7;
        color: white;
    }

    #GroupTreeView .e-icon-collapsible::before,
    #GroupTreeView .e-icon-expandable::before {
        color: #666;
    }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }

    .chat-sidebar {
        width: 250px;
        background-color: #f4f4f4;
        box-sizing: border-box;
        overflow-y: auto;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
        z-index: 100;
        position: absolute;
        top: 50px;
        bottom: 0;
        left: 0;
    }

        .chat-sidebar.show {
            transform: translateX(0);
        }
}
