/* Layui Style Overrides and Integration */
:root {
    --layui-primary: #009688;
    --layui-blue: #1e9fff;
    --layui-red: #ff5722;
    --layui-bg: #f2f2f2;
}

body,
html,
#app {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

/* Screen Management */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Chat Message Styling (Custom to look like a modern chat UI within Layui) */
#chat-messages {
    background-color: #f2f2f2;
}

.message-row {
    display: flex;
    margin-bottom: 20px;
    width: 100%;
}

.message-row.sent {
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: #009688;
    color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-row.sent .avatar {
    background-color: #1e9fff;
    margin-left: 10px;
}

.message-row.received .avatar {
    margin-right: 10px;
}

.message-content {
    max-width: 70%;
}

.message-row.received .message-content {
    text-align: left;
}

.message-row.sent .message-content {
    text-align: right;
}

.nickname {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.bubble {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 4px;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-all;
    text-align: left;
}

.message-row.received .bubble {
    background-color: #fff;
    color: #333;
    border: 1px solid #e2e2e2;
}

.message-row.sent .bubble {
    background-color: #5fb878;
    color: #fff;
}

.system-message {
    text-align: center;
    margin: 15px 0;
}

.system-message span {
    display: inline-block;
    padding: 2px 10px;
    background: #e2e2e2;
    color: #999;
    font-size: 12px;
    border-radius: 2px;
}

/* Modal Helper */
.modal {
    display: none;
    /* Logic handles this */
    z-index: 1001;
}

/* Override input padding in groups */
.layui-input-group .layui-input {
    border-radius: 0;
}

/* Fix mobile responsive login card */
@media screen and (max-width: 768px) {
    .layui-col-md4.layui-col-md-offset4 {
        width: 90%;
        margin-left: 5%;
        margin-right: 5%;
    }
}