@import url('../../ubuntu.css?1');
@import url('../../bootstrap-icons-1.13.1/bootstrap-icons.min.css');

* {
    box-sizing: border-box;
    outline: none;
    border: 0;
    user-select: none;
    font-family: 'Ubuntu', Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*:not(.chat){
    overflow: hidden;
}

heml,
body {
    position: fixed;
    padding: 0;
    background: transparent;
    color: #101114;
    touch-action: none;
    height: 100dvh;
    display: flex;
    align-items: center;
    align-content: center;
    flex-wrap: wrap;
    flex-direction: column;
    justify-content: space-between;
}

body:not(.standalone):not(.embeded){
    width: 100%;
    margin: 0
}

body:not(.standalone):not(.embeded) .bubble{
    max-width: 50%;
}

body.standalone{
    width: 600px;
    max-width: 100%;
    margin: auto;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

body:not(.fullscreen) {
    background-color: transparent;
}

body.fullscreen {
    background-color: #ffffff;
}

.fullscreen-exit {
    display: none;
}

body.fullscreen .fullscreen-enter {
    display: none;
}

body.fullscreen .fullscreen-exit {
    display: block;
}

.chat {
position: relative;
    display: flex;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    align-items: center;
    align-items: center;
    flex-direction: column;
    justify-content: space-between;
}
}

.chat.border {
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(16, 17, 20, .08);
    border-radius: 24px;
    box-shadow: 0 18px 60px rgba(30, 25, 50, .08);
}

.header {
	width:100%;
    z-index: 999;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(16, 17, 20, .07);
}

.fullscreen-btn,
.btn{
    padding: 0;
    cursor: pointer;
    transition: .2s ease;
}

.fullscreen-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #e5e4e9;
    border-radius: 11px;
    background: #fff;
    color: #77757f;
    display: grid;
    place-items: center;
}

.fullscreen-btn:hover {
    color: #7654d9;
    border-color: #d9d3ed;
    background: #f8f6fc;
}

.fullscreen-btn svg {
    width: 17px;
    height: 17px;
}

.bot-avatar.img {
    background-image: url(bot.webp);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    font-size: 0;
    background-color: #f7f7f5;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 42px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #1677e8 0%, #7654d9 52%, #f0188a 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 7px 20px rgba(118, 84, 217, .18);
}

.header-info {
    flex: 1;
    min-width: 0;
}

.header-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    color: #85858d;
    font-size: 11px;
}

.status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #20b56a;
    box-shadow: 0 0 0 3px rgba(32, 181, 106, .10);
}

.messages {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 100%;
    padding: 0 24px;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: .5rem;
    -webkit-overflow-scrolling: touch;
}

.message {
    display: flex;
    width: 100%;
    flex: 0 0 auto;
    animation: messageIn .3s ease;
}

.message.bot {
    justify-content: flex-start;
}

.message.user {
    justify-content: flex-end;
}

.message.date {
    justify-content: flex-start;
}

.message.date .bubble{
    padding: 0;
    margin: 0;
    color: #9b9aa2;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: .2rem;
}

.bubble p{
	margin: 0;
    padding: 0;
    display: inline;
}
.bubble {
    /*max-width: 78%;*/
    padding: 12px 15px;
    border-radius: 20px;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: break-word;
    word-break: break-word;
}

.bot .bubble {
    background: #f3f2f5;
    border-bottom-left-radius: 0px;
    color: #28282d;
}

.user .bubble {
    min-width: 100px;
    background: #f1eefb;
    color: #7654d9;
    border: 1px solid #e7e2f9;
    border-bottom-right-radius: 5px;
    box-shadow: 0 7px 18px rgb(118 84 217 / 6%);
}

.typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 40px;
}

.typing span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8c8b95;
    animation: typing 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: .15s;
}

.typing span:nth-child(3) {
    animation-delay: .3s;
}

.composer {
    z-index: 20;
    width: 100%;
    flex: 0 0 auto;
    max-height: 173px;
    padding: 14px;
    border-top: 1px solid rgba(16, 17, 20, .07);
    background: rgba(255, 255, 255, .96);
    overflow: hidden;
	touch-action: none;
}

.input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    width: 100%;
    padding: 7px;
    border: 1px solid #e5e4e9;
    border-radius: 17px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
    overflow: hidden;
}

.input-wrap:focus-within {
    border-color: #9b87df;
    box-shadow: 0 0 0 3px rgba(118, 84, 217, .09);
}

textarea {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    max-height: 110px;
    resize: none;
    padding: 12px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #101114;
    font-size: 13px;
    line-height: 1.4;
    overflow-x: hidden;
    overflow-y: auto;
	touch-action: auto;
}

textarea::placeholder {
    color: #9b9aa2;
}

.send {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border: 0;
    border-radius: 12px;
    background: #f1eefb;
    color: #7654d9;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform .2s ease, color .2s ease, background .2s ease;
}

.send:hover {
    background: #dfd5ff;
    transform: translateY(-1px);
}

.send:disabled {
    opacity: .45;
    cursor: default;
    transform: none;
}

.send svg {
    width: 17px;
    height: 17px;
}

.powered {
    text-align: center;
    padding: 7px 0 1px;
    font-size: 11px;
    color: #aaa9b0;
    letter-spacing: .02em;
}

.powered strong {
    color: #7654d9;
    font-weight: 600;
}

.logs {
    margin-top: 6px;
    font-size: 11px;
    color: #8d8b95;
    padding: 6px 4px;
    line-height: 1.55;
    overflow-wrap: break-word;
    word-break: break-word;
}

.logs.checking {
    color: #7654d9;
}

.logs.valid {
    color: #20a968;
}

.logs.invalid {
    color: #e05252;
}

.logs.checking:not(.done)::after {
    content: "";
    display: inline-block;
    width: 16px;
    text-align: left;
    animation: loadingDots 1.2s steps(4, end) infinite;
}

@keyframes loadingDots {
    0% {
        content: "";
    }
    25% {
        content: ".";
    }
    50% {
        content: "..";
    }
    75% {
        content: "...";
    }
    100% {
        content: "";
    }
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@media (max-width: 600px) {

    .chat.border {
        border-radius: 20px;
    }

    .header {
        padding: 8px;
    }

    .bubble {
        max-width: 86%;
    }

    .composer {
        padding: 10px;
    }
}

@media (display-mode: fullscreen) {
    body {
        padding: 0;
    }

    .chat,
    .chat.border {
        border-radius: 0;
    }
}

.bubble ul,
.bubble ol {
    margin: 10px 0;
    padding-left: 0;
    list-style: none;
}

.bubble ul li,
.bubble ol li {
    position: relative;
    margin: 6px 0;
    padding-left: 24px;
}

/* Unordered list */
.bubble ul li::before {
    content: "\f26a"; /* Bootstrap Icons check */
    font-family: "bootstrap-icons";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 14px;
}

/* Ordered list */
.bubble ol {
    counter-reset: bot-list;
}

.bubble ol li {
    counter-increment: bot-list;
}

.bubble ol li::before {
    content: counter(bot-list) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
}

/* Headings */
.bubble h1,
.bubble h2,
.bubble h3,
.bubble h4 {
    margin: 16px 0 8px;
    line-height: 1.3;
}

.bubble h1 {
    font-size: 1.4em;
}

.bubble h2 {
    font-size: 1.25em;
}

.bubble h3 {
    font-size: 1.1em;
}

.bubble h4 {
    font-size: 1em;
}


/* Links */
.bubble a {
    color: inherit;
    text-decoration: underline;
}


/* Blockquotes */
.bubble blockquote {
    margin: 12px 0;
    padding: 8px 14px;
    border-left: 3px solid currentColor;
    opacity: .8;
}


/* Horizontal line */
.bubble hr {
    margin: 16px 0;
    border: 0;
    border-top: 1px solid currentColor;
    opacity: .2;
}


/* Inline code */
.bubble code {
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .06);
    font-size: .9em;
}


/* Code blocks */
.bubble pre {
    margin: 12px 0;
    padding: 12px;
    overflow-x: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, .06);
}

.bubble pre code {
    padding: 0;
    background: none;
    font-size: .85em;
}


/* Tables */
.bubble table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: .9em;
}

.bubble th,
.bubble td {
    padding: 7px 9px;
    border: 1px solid rgba(0, 0, 0, .12);
    text-align: left;
}

.bubble th {
    font-weight: 600;
}


/* Images */
.bubble img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 8px;
}


/* Line breaks */
.bubble br {
    line-height: 1.5;
}