﻿:root {
    --body-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --msger-bg: #fff;
    --border: 1px solid #ddd;
    --left-msg-bg: #ececec;
    --right-msg-bg: #579ffb;
}

.msger {
    display: flex;
    flex-direction: column;
    width: 100%;
    /*max-width: 867px;*/
    height: calc(100vh - 190px);
    min-height: 400px;
    border: var(--border);
    border-radius: 8px;
    background: var(--msger-bg);
    box-shadow: 0 15px 15px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.msger-header {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: var(--border);
    background: #eee;
    color: #444;
}

.msger-chat {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #fcfcfe;
}

.msg {
    display: flex;
    align-items: flex-end;
    margin-bottom: 15px;
}

.msg-img {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    margin-right: 10px;
    background: #ddd;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    border-radius: 50%;
}

.msg-bubble {
    max-width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    overflow-wrap: anywhere;
}

.msg-info {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 8px;
}

.msg-info-name {
    font-weight: bold;
}

.msg-info-time {
    font-size: 0.8em;
    opacity: 0.75;
}

.msg-text {
    white-space: pre-wrap;
    line-height: 1.5;
}

.left-msg .msg-bubble {
    background: var(--left-msg-bg);
    border-bottom-left-radius: 0;
    color: #222;
}

.right-msg {
    flex-direction: row-reverse;
}

    .right-msg .msg-img {
        margin: 0 0 0 10px;
    }

    .right-msg .msg-bubble {
        background: var(--right-msg-bg);
        color: #fff;
        border-bottom-right-radius: 0;
    }

.msger-inputarea {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: var(--border);
    background: #eee;
}

.msger-input {
    flex: 1;
    min-width: 0;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    outline: none;
}

    .msger-input:focus {
        border-color: #579ffb;
    }

.msger-send-btn {
    padding: 0 20px;
    border: none;
    border-radius: 5px;
    background: rgb(0, 160, 60);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

    .msger-send-btn:hover {
        background: rgb(0, 140, 50);
    }

    .msger-send-btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.chat-status {
    padding: 6px 15px;
    color: #666;
    font-size: 12px;
    background: #fcfcfe;
}

@@media (max-width: 576px) {
    body {
        padding: 0;
    }

    .msger {
        height: 100vh;
        min-height: 100vh;
        border-radius: 0;
    }

    .msg-bubble {
        max-width: 85%;
    }
}
