/* Landing chat assistant (includes/chat/chat.js). Themes: --dark (dark landing) and --light (classic wiki template) */

.ob-chat {
    box-sizing: border-box;
    margin: 22px 0;
    border-radius: 12px;
    border: 1px solid #d7dce3;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
}
.ob-chat *, .ob-chat *:before, .ob-chat *:after { box-sizing: border-box; }

/* Full-width chat row on the dark landing: section paddings provide the spacing */
.cl-chat .ob-chat { margin: 0; }

.ob-chat__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #e4e8ee;
}
.ob-chat__avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2f7bf6, #60CDFF);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex: none;
}
.ob-chat__title { font-weight: 700; color: #1d2530; }
.ob-chat__status {
    margin-left: auto;
    font-size: 12px;
    color: #3EB900;
    display: flex; align-items: center; gap: 5px;
    white-space: nowrap;
}
.ob-chat__status:before {
    content: "";
    width: 7px; height: 7px; border-radius: 50%;
    background: #3EB900;
}

.ob-chat__body {
    max-height: 420px;
    min-height: 120px;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.ob-chat__msg {
    max-width: 85%;
    padding: 9px 13px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.ob-chat__msg--assistant {
    align-self: flex-start;
    background: #f1f4f8;
    color: #1d2530;
    border-bottom-left-radius: 4px;
}
.ob-chat__msg--user {
    align-self: flex-end;
    background: #2f7bf6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ob-chat__msg--typing { color: #7c8698; }
.ob-chat__dots { display: inline-block; min-width: 18px; }

.ob-chat__download {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 22px;
    border-radius: 8px;
    background: linear-gradient(0deg, #3baf01 0, #3EB900 50%, #41C400 100%);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
}
.ob-chat__download:hover { filter: brightness(1.06); }

.ob-chat__form {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #e4e8ee;
}
.ob-chat__input {
    flex: 1;
    resize: none;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    padding: 9px 12px;
    font: inherit;
    color: #1d2530;
    background: #fff;
    outline: none;
    max-height: 110px;
}
.ob-chat__input:focus { border-color: #2f7bf6; }
.ob-chat__send {
    flex: none;
    border: 0;
    border-radius: 8px;
    padding: 0 18px;
    background: #2f7bf6;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ob-chat__send:hover { background: #2568d8; }
.ob-chat__send:disabled { opacity: .5; cursor: default; }

.ob-chat__note {
    padding: 0 16px 10px;
    font-size: 11px;
    color: #8C8C8C;
}

/* ---------- Dark theme ---------- */

.ob-chat--dark {
    border-color: #414141;
    background: #282828;
    color: #F4F4F4;
}
.ob-chat--dark .ob-chat__head { border-bottom-color: #414141; }
.ob-chat--dark .ob-chat__title { color: #F4F4F4; }
.ob-chat--dark .ob-chat__msg--assistant { background: #313131; color: #F4F4F4; }
.ob-chat--dark .ob-chat__msg--user { background: #2f7bf6; }
.ob-chat--dark .ob-chat__msg--typing { color: #8C8C8C; }
.ob-chat--dark .ob-chat__form { border-top-color: #414141; }
.ob-chat--dark .ob-chat__input {
    background: #202020;
    border-color: #414141;
    color: #F4F4F4;
}
.ob-chat--dark .ob-chat__input:focus { border-color: #60CDFF; }

@media (max-width: 640px) {
    .ob-chat__msg { max-width: 95%; }
    .ob-chat__body { max-height: 340px; }
}
