﻿body {
    margin-bottom: 0;
}

 /*  html, body, body > div, #ChatBox {
        outline:none;
    }


html, body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    height: 100%;
    width: 100%;
    overflow: hidden;
    outline: none;
}
    body > div {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }
*/

#ChatBox {
    border: solid 1px #0d6efd !important;
    border-radius: 11px;
    overflow: hidden;
    margin: auto;
}

/* Beautify scrollbar */
#ChatBody::-webkit-scrollbar {
    width: 4px;
}

#ChatBody::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#ChatBody::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 10px;
}

    #ChatBody::-webkit-scrollbar-thumb:hover {
        background: #0056b3;
    }

input.form-control:focus {
    outline: none;
    box-shadow: none;
    border-color: #ced4da;
}

div.input-group:focus-within {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
    border-radius: 0.2rem;
}

.chat-box {
    /* width: 350px;
        position: absolute; */
    border: 1px solid #cccccc !important;
    border-radius: 5px;
    bottom: 70px;
    right: 10px;
    /* height: 100%; */
}

    .chat-box .title {
        border-radius: 10px 10px 0 0;
    }

    .chat-box .body {
        /* height: 400px; */
        height: calc(100% - 97px);
        overflow-y: auto;
    }

        .chat-box .body .msg {
            padding: 2px 0.25rem 0 0.25rem;
        }

            .chat-box .body .msg .img {
                width: 28px;
                height: 28px;
                overflow: hidden;
                text-align: center;
                border-radius: 50%;
            }

                .chat-box .body .msg .img img {
                    width: 100%;
                    border-radius: 50%;
                }

            .chat-box .body .msg .head {
                padding: 8px 8px 2px 8px;
                max-width: 72%;
                margin-left: 36px;
                font-size: 0.7rem;
            }

                .chat-box .body .msg .head .dt {
                    font-style: italic;
                }

            .chat-box .body .msg .txt {
                border-radius: 0 10px 10px 10px;
                max-width: 72%;
                margin-left: 36px;
                background-color: #c9e6ff;
                padding: 0.5rem;
            }

            .chat-box .body .msg .im .txt {
                margin-left: 8px;
            }

        .chat-box .body .msg-r {
            text-align: right;
            padding-right: 0.5rem;
        }

            .chat-box .body .msg-r::after {
                content: "";
                display: table;
                clear: both;
            }

            .chat-box .body .msg-r .head {
                max-width: 75%;
                font-style: italic;
                float: right;
            }

            .chat-box .body .msg-r .txt {
                max-width: 75%;
                clear: both;
            }

    .chat-box .footer input[type=text] {
        resize: none;
        padding: 10px;
    }

    .chat-box .btn-group-sm > .btn,
    .btn-sm {
        padding: .2rem .5rem;
        font-size: 0.875rem;
    }

    .chat-box .btn-light {
        color: #4bb3ff;
        /*border-color: #6eaff1;*/ border: none;
        background: none;
    }

    .chat-box .body .msg-r .txt {
        background: linear-gradient(45deg, #629ff3, #c9e6ff);
        border-radius: 10px 0 10px 10px;
        text-align: left;
    }

    .chat-box .body .msg .txt {
        background-color: #c9e6ff !important;
       /* border: solid 1px #a6c5df;*/
    }





/* Chat container */
#ChatBody {
    background-color: #f5f5f5;
    padding: 15px;
    overflow-y: auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-bottom: solid 1px #0d6efd;
}

/* Base message styling */
.msg {
    margin-bottom: 15px;
    max-width: 80%;
    clear: both;
    position: relative;
}

    /* Message head (sender name and time) */
    .msg .head {
        font-size: 0.8em;
        color: #666;
        margin-bottom: 5px;
    }

/* Right-aligned messages (user messages) */
.msg-r {
    float: right;
    margin-left: 20%;
}

/* Left-aligned messages (bot messages) */
.msg:not(.msg-r) {
    float: left;
    margin-right: 20%;
}

/* Message text bubble */
.msg .txt {
    padding: 10px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
}

/* User message bubble */
.msg-r .txt {
    background-color: #007bff;
    /*color: white;*/
    border-top-right-radius: 5px;
}

/* Bot message bubble */
.msg:not(.msg-r) .txt {
    background-color: white;
    color: #333;
    border-top-left-radius: 5px;
   /* box-shadow: 0 1px 2px rgba(0,0,0,0.1);*/
}

/* Message with image */
.msg .im {
    display: flex;
    align-items: flex-end;
}

.msg .img {
    margin-right: 10px;
}

    .msg .img img {
        width: 32px;
        height: 32px;
        object-fit: cover;
    }

/* Typing indicator */
#MsgTyping .head {
    color: #999;
    font-style: italic;
}

/* Clear floats */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Date/time styling */
.dt {
    color: #999;
    font-size: 0.9em;
}

/* Input area styling */
#ChatBox .footer {
    background-color: white;
    padding: 10px;
    border-top: 1px solid #eee;
}

#TxtMessage {
    border-radius: 0 0 0 10px;
    padding: 0;
    border: none;
    width: calc(100% - 100px);
    margin-right: 4px;

}

#BtnSend {
    border-radius: 0 0 10px 0;
    padding: 0;
    background-color: #fff;
    color: #0d6dfd;
    border: none;
    cursor: pointer
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .msg, .msg-r {
        max-width: 90%;
    }

    .msg-r {
        margin-left: 10%;
    }

    .msg:not(.msg-r) {
        margin-right: 10%;
    }
}

.chat-box #TxtMessage::placeholder {
    color: #bebebe;
    opacity: 1;
}

.input-group > .form-control, .input-group > .form-select {
    background: #fff;
    padding: 0 12px !important;
}

.chat-box #TxtMessage:-ms-input-placeholder { /* Internet Explorer 10–11 */
    color: #bebebe;
}

.chat-box #TxtMessage::-ms-input-placeholder { /* Microsoft Edge (legacy) */
    color: #bebebe;
}

.chat-box #TxtMessage::-webkit-input-placeholder { /* Chrome, Safari, Opera */
    color: #bebebe;
}

.chat-box #TxtMessage::-moz-placeholder { /* Firefox 19+ */
    color: #bebebe;
}

.chat-box #TxtMessage:-moz-placeholder { /* Firefox 4–18 */
    color: #bebebe;
}