@import url('https://fonts.googleapis.com/css2?family=Poppins');


.chatbot-toggler {
    position: fixed;
    right: 15px;
    bottom: 15px;
    height: 50px;
    width: 50px;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: pointer;
    background: #000;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.show-chatbot .chatbot-toggler {
    transform: rotate(90deg);
}

.chatbot-toggler span {
    position: absolute;
}

.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child {
    opacity: 0;
}

.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}

.chatbot {
    position: fixed;
    right: 40px;
    bottom: 100px;
    width: 420px;
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
        0 32px 64px -48px rgba(0, 0, 0, 0.5);

    z-index: 100000;

}

.show-chatbot .chatbot {
    transform: scale(1);
    opacity: 1;
    pointer-events: auto;
}

.chatbot header {
    background: #000;
    padding: 16px 0;
    text-align: center;
}

.chatbot header h2 {
    color: #fff;
    font-size: 1.4rem;
}

.chatbot header span {
    position: absolute;
    right: 20px;
    top: 50%;
    color: #fff;
    cursor: pointer;
    display: none;
    transform: translate(-50%);
}

.chatbot .chatbox {
    height: 510px;
    overflow-y: auto;
    padding: 30px 20px 70px;
}

.chatbox .chat {
    display: flex;
}

.chatbox .incoming span {
    height: 32px;
    width: 32px;
    color: #fff;
    align-self: flex-end;
    background: #000;
    text-align: center;
    line-height: 32px;
    border-radius: 4px;
    margin: 0 10px 7px 0;
}

.chatbox .outgoing {
    margin: 20px 0;
    justify-content: flex-end;
}

.chatbox .chat>div {
    color: #fff;
    max-width: 75%;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-radius: 10px 10px 0 10px;
    background: #000;
}

.chatbox .incoming>div {
    color: #000;
    background: #f2f2f2;
    border-radius: 10px 10px 10px 0;
}

.chatbot .chat-input {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    gap: 5px;
    background: #fff;
    padding: 5px 20px;
    border-top: 1px solid #ccc;
}

.chat-input textarea {
    height: 55px;
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    padding: 16px 15px 16px 0;
}

.chat-input span {
    align-self: flex-end;
    height: 55px;
    line-height: 55px;
    color: #000;
    font-size: 1.35rem;
    cursor: pointer;
    visibility: hidden;
}

.chat-input textarea:valid~span {
    visibility: visible;
}

/* Стили для контейнера с вариантами вопросов */
.options-container {
    display: flex;
    gap: 10px;
    padding: 10px;
    justify-content: flex-start;
    border-bottom: 1px solid #ccc;
    background: #f9f9f9;
    position: sticky;
    top: 0;
    z-index: 10;
}

.options-container .question-option {
    padding: 8px 12px;
    background-color: #000;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.options-container .question-option:hover {
    background-color: #444;
}

@media (max-width: 490px) {
    .chatbot {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .chatbot .chatbox {
        height: 90%;
    }

    .chatbot header span {
        display: block;
    }
}



/********************************************************/

button.ai-chatbot-toggle-btn {
    position: fixed;
    bottom: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    z-index: 999998;
}

.ai-chatbot-toggle-btn__robo-head {
    width: 90px;
    height: 70px;
    background-image: url(/static/aichat/robo-head.png);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

.ai-chatbot-toggle-btn__robo-text {
    font-size: 0.8rem;
    color: var(--contrast-color);
    background-color: var(--accent-color);
    border-radius: 50px;
    padding: 7px;
}

@media (max-width: 800px) {
    .ai-chatbot-toggle-btn__robo-text {
        display: none;
    }

    button.ai-chatbot-toggle-btn {
        bottom: 5px;
        right: 5px;
        background-color: var(--accent-color);
        border-radius: 50%;
    }

    .ai-chatbot-toggle-btn__robo-head {
        width: 80px;
        height: 80px;
    }
}

.ai-chatbot {
    display: none;
}

.ai-chatbot.--active {
    display: block;
}

.ai-chatbot__inner {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    width: 600px;
    height: 500px;
    background: url(/static/aichat/robo.png), linear-gradient(90deg, #2a2c39 210px, #fff 210px, #fff);
    background-size: 290px auto, cover;
    /* Указан размер для каждого слоя */
    background-position: -44px center, center;
    /* Указаны позиции для каждого слоя */
    background-repeat: no-repeat;
    box-shadow: 0 0 6px #d3d3d3, 0 0 9px #ededed;
    border-radius: 20px;
    z-index: 999999;
}

.ai-chatbot__title {
    position: absolute;
    top: 40px;
    left: 23px;
    color: #fff;
    font-size: 45px;
    font-weight: bolder;
}

button.ai-chatbot__close-btn {
    position: absolute;
    right: 0px;
    top: -53px;
    width: 44px;
    height: 44px;
    color: white;
    background-color: var(--accent-color);
    border: none;
    border-radius: 50px;
    padding: 0;
    margin: 0;
}

ul.ai-chatbot__chat {
    flex: 1;
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 20px 20px 20px;
    margin: 20px 0 0px 210px;
    gap: 20px;
    overflow-y: auto;
}

li.ai-chatbot__message {
    display: block;
    color: #000;
    font-size: 0.95rem;
    padding: 12px 16px;
    border-radius: 10px;
    background: #f2f2f2;
}

li.ai-chatbot__message.--bot {
    border-radius: 20px 20px 20px 0;
}

li.ai-chatbot__message.--user {
    align-self: flex-end;
    color: #f2f2f2;
    background-color: var(--heading-color);
    white-space: break-spaces;
    border-radius: 20px 20px 0 20px;
}

form.ai-chatbot__form {
    position: relative;
    display: flex;
    gap: 5px;
    border-top: 1px solid #ccc;
    padding: 0 20px 0;
    margin: 0px 0 0 210px;
}

textarea.ai-chatbot__form-textarea {
    flex: 1;
    height: 55px;
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    resize: none;
    padding: 16px 15px 16px 0;
}

button.ai-chatbot__form-send-btn {
    align-self: flex-end;
    height: 55px;
    line-height: 55px;
    color: #000;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    visibility: hidden;
}

textarea.ai-chatbot__form-textarea:valid~button.ai-chatbot__form-send-btn {
    visibility: visible;
}

@media (max-width: 640px) {
    .ai-chatbot__inner {
        width: auto;
        height: 80%;
        left: 10px;
        background: linear-gradient(180deg, #2a2c39 80px, #fff 80px, #fff);
        padding: 80px 0 0;
    }


    ul.ai-chatbot__chat {
        margin: 20px 0 0;
    }

    form.ai-chatbot__form {
        margin: 0;
    }

    .ai-chatbot__title {
        position: absolute;
        top: 7px;
        left: 50%;
        transform: translateX(-50%);
    }

    button.ai-chatbot__close-btn {
        top: 20px;
        right: 30px;
    }
}

.loader {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 15px 0 #fff, -15px 0 #fff;
    position: relative;
    animation: _____flash 0.5s ease-out infinite alternate;
    margin: 0 10px;
}

.ai-chatbot__message.--bot {
    .loader {
        background-color: #000;
        box-shadow: 15px 0 #000, -15px 0 #000;
        animation: _____flash_black 0.5s ease-out infinite alternate;
    }
}

@keyframes _____flash {
    0% {
        background-color: #fff2;
        box-shadow: 15px 0 #fff2, -15px 0 #fff;
    }

    50% {
        background-color: #fff;
        box-shadow: 15px 0 #fff2, -15px 0 #fff2;
    }

    100% {
        background-color: #fff2;
        box-shadow: 15px 0 #fff, -15px 0 #fff2;
    }
}

@keyframes _____flash_black {
    0% {
        background-color: #0002;
        box-shadow: 15px 0 #0002, -15px 0 #000;
    }

    50% {
        background-color: #000;
        box-shadow: 15px 0 #0002, -15px 0 #0002;
    }

    100% {
        background-color: #0002;
        box-shadow: 15px 0 #000, -15px 0 #0002;
    }
}