﻿/*html, body, form {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #e9eaed;
}*/

.chat-sidebar {
    width: 200px;
    position: fixed;
    height: 100%;
    right: 0;
    top: 0;
    padding: 10px 0;
    border: 1px solid rgba(29, 49, 91, 0.3);
    background-color: #EEEEEE;
}

/* Popup base */
/*.popup-box {
    display: none;
    position: fixed;
    bottom: 0;
    right: 360px;
    width: 300px;
    height: 335px;
    background-color: white;
    border: 1px solid rgba(29, 49, 91, 0.3);
    z-index: 1000;
}*/


/* When expanded fullscreen */
.popup-box.expanded-popup {
    position: fixed !important;
    top: 0;
    left: 7.5%; /* ✅ This makes it take up 85% of the viewport width */
    width: 85vw !important;
    height: 100vh !important;
    z-index: 9999;
    margin: 0 !important;
    background-color: white;
    border: 1px solid #888;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    display: flex !important;
    flex-direction: column;
}

    .popup-box.expanded-popup .popup-inner-content {
        height: calc(100vh - 160px) !important;
        overflow-y: auto !important;
    }


    .popup-box.expanded-popup ~ .floating-toggle-button {
        right: 100px !important;
    }

/* ✅ Non-expanded chat popup should have fixed height */
.popup-box:not(.expanded-popup) .popup-messages {
    height: 600px !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}



.popup-box.expanded-popup .popup-messages {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.popup-box:not(.expanded-popup) .popup-inner-content {
    height: auto !important;
    max-height: 600px;
    overflow-y: auto !important;
}

/* Scroll area */
.popup-inner-content {
    all: unset;
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding: 10px;
    background-color: white;
}



/* Popup header */
.popup-head {
    background-color: #6d84b4;
    padding: 5px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header controls */
.popup-head-left {
    font-family: Arial;
}

.popup-head-right {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-left: auto; /* ✅ Pushes actions to the right */
}

/* Button styling */
.chat-button {
    width: 22px;
    height: 22px;
    background-color: #d3d3d3;
    border: 1px solid #a9a9a9;
    color: black;
    font-weight: bold;
    font-size: 14px;
    font-family: Arial, sans-serif;
    text-align: center;
    line-height: 22px;
    border-radius: 2px;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 1px 1px 1px #fff;
    padding: 0;
}

    .chat-button:hover {
        background-color: #e6e6e6;
        border-color: #888;
        text-decoration: none;
    }

/* Main vertical layout container */
.popup-messages {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}




/* Drop zone and input bar (don’t stretch) */
.popup-filebar, .popup-input, .typing-indicator {
    flex-shrink: 0;
}

/* Dropzone bar */
.popup-filebar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background-color: white;
    border-top: 1px solid #ddd;
}

.dropzone {
    padding: 15px;
    border: 2px dashed #ccc;
    background-color: white;
    color: #666;
    font-size: 12px;
    border-radius: 8px;
    height: 50px;
    flex: 1;
    text-align: center;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

    .dropzone.dragover {
        background-color: #e0f7fa;
        border-color: #2196f3;
        color: #000;
    }

.fileButton {
    border: 0;
    background-color: white;
    width: 48px;
    height: 48px;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22pt;
}

/* Typing indicator */
.typing-indicator {
    font-style: italic;
    color: #888;
    font-size: 12px;
    padding: 4px 10px;
    background-color: white;
}

/* Input bar */
.popup-input {
    display: flex;
    gap: 4px;
    padding: 5px;
    background-color: #fff;
    border-top: 1px solid #ccc;
}

    .popup-input textarea {
        flex: 1;
        height: 50px;
        resize: none;
        color: black;
        font-size: 10pt;
    }

/* Message bubbles */
.chat-bubble {
    max-width: 80%;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 16px;
    display: inline-block;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word; /* ✅ add this */
    overflow-wrap: anywhere; /* ✅ add this for maximum protection */
    clear: both;
}

    .chat-bubble img {
        width: 24px;
        height: 24px;
        border: 1px solid #999 !important;
        border-radius: 50% !important;
        box-sizing: border-box;
        display: inline-block;
        vertical-align: middle;
        margin-right: 5px;
    }


.sent-message {
    text-align: right;
    font-size: 8pt;
    color: black;
}

    .sent-message .chat-bubble {
        background-color: #dcf8ff;
        color: #000;
        margin-left: auto;
        margin-right: 8px;
        border-top-right-radius: 4px;
        font-size: 12pt;
        color: black;
    }

.received-message {
    text-align: left;
    font-size: 12pt;
    color: black;
}

    .received-message .chat-bubble {
        background-color: #f1f1f1;
        color: #000;
        margin-left: 8px;
        margin-right: auto;
        border-top-left-radius: 4px;
        font-size: 12pt;
        color: black;
    }

/* Online status icons */
.online-status {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
}

.user-online {
    background-color: #00ff00;
}

.user-offline {
    background-color: #ff0000;
}

/* Message date headers */
.message-date-header {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin: 10px 0 5px;
    border-top: 1px solid #eee;
    padding-top: 5px;
}

.popup-box.group-chat {
    width: 360px !important; /* wider than default 300px */
}

    .popup-box.group-chat .popup-head {
        flex-wrap: wrap;
        height: auto;
        padding-bottom: 2px;
    }

    .popup-box.group-chat .popup-head-left {
        flex: 1 1 100%;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
    }

        .popup-box.group-chat .popup-head-left img {
            width: 18px;
            height: 18px;
        }

    .popup-box.group-chat.expanded-popup {
        width: calc(100% - 200px) !important;
        height: 100vh !important;
        right: 200px !important;
    }

.group-link:hover::after {
    content: attr(data-members);
    position: absolute;
    background: #333;
    color: white;
    padding: 6px;
    border-radius: 4px;
    font-size: 12px;
    top: 100%;
    left: 0;
    white-space: nowrap;
    z-index: 1000;
}

.group-link {
    text-decoration: none !important;
}

.sidebar-name {
    font-size: 9pt !important;
    text-decoration: none !important;
    padding: 6px;
}

/*.popup-box.minimized-popup {
    position: absolute !important;
    bottom: 0 !important;
    height: 30px !important;
    overflow: hidden !important;
    z-index: 9999;
}*/

    .popup-box.minimized-popup .popup-messages,
    .popup-box.minimized-popup .popup-input,
    .popup-box.minimized-popup .popup-filebar {
        display: none !important;
    }
/* Main container that holds the columns */
#chat_popups_container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    /*width: 1850px;*/
    max-height: 800px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 10px;
    box-sizing: border-box;
    /*margin-left: 200px !important;*/
    background-color: #f8f8f8;
}

.popup-column {
    width: 360px;
    margin-right: 10px;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
}

.popup-box {
    position: relative;
    display: block;
    width: 300px;
    height: 635px;
    margin-bottom: 10px;
    background-color: white;
    border: 1px solid rgba(29, 49, 91, 0.3);
    z-index: 1000;
    flex-shrink: 0; /* 🔒 Prevent shrinking */
    min-width: 300px; /* 📦 Fixed popup size */
    margin-right: 10px;
}

.expanded-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background-color: white;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.sidebar-name img.userlist-avatar {
    border: 1px solid #999 !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-block;
    box-sizing: border-box;
}


img.userlist-avatar {
    border: 1px solid #999 !important;
    border-radius: 50% !important;
}
/**********************************************************/
#ctl00_ContentPlaceHolder1_upPopups {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
    width: auto;
    min-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: auto;
}

    #ctl00_ContentPlaceHolder1_upPopups::-webkit-scrollbar {
        height: 12px;
    }

    #ctl00_ContentPlaceHolder1_upPopups::-webkit-scrollbar-thumb {
        background: #999;
        border-radius: 6px;
    }

    #ctl00_ContentPlaceHolder1_upPopups::-webkit-scrollbar-track {
        background: #eee;
    }

#ctl00_ContentPlaceHolder1_upPopups {
    overflow-x: scroll !important;
}



