@font-face {
    font-family: 'lean';
    src:  url('./fonts/lean.eot?7ev5uy');
    src:  url('./fonts/lean.eot?7ev5uy#iefix') format('embedded-opentype'),
    url('./fonts/lean.ttf?7ev5uy') format('truetype'),
    url('./fonts/lean.woff?7ev5uy') format('woff'),
    url('./fonts/lean.svg?7ev5uy#lean') format('svg');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

[class^="icon-"], [class*=" icon-"] {
    /* use !important to prevent issues with browser extensions that change fonts */
    font-family: 'lean' !important;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;

    /* Better Font Rendering =========== */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-check:before {
    content: "\e906";
}
.icon-envelope:before {
    content: "\e900";
}
.icon-pdf:before {
    content: "\e901";
}
.icon-share:before {
    content: "\e902";
}
.icon-refresh:before {
    content: "\e903";
}
.icon-copy:before {
    content: "\e904";
}
.icon-send:before {
    content: "\e905";
}



#chat-messages { flex-grow: 1; overflow-y: auto; padding: 10px; background: white; border-radius: 5px; max-height: 700px; display: flex; flex-direction: column; min-height: 100px; }
.user-message { align-self: flex-end; background: transparent; max-width: 70%; }
.typing { font-style: italic; color: #999; }
.error { color: red; }
#chat-input { flex-grow: 1; padding: 10px; border-radius: 5px; border: 1px solid #ccc; }

.typing span { display: inline-block; width: 8px; height: 8px; background: gray; margin: 0 2px; border-radius: 50%; animation: blink 1.4s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

#main {
    z-index: initial !important;
}

.wp-chatbot {
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
}

#chat-input {
    flex-grow: 1;
    padding: 10px;
    border: 0;
    background-color: #fff;
    outline: none;
    color: #595959;
    resize: none;
    height: auto !important;
}

#chat-input-area {
    display: flex;
    margin-top: 10px;
    position: relative;
    border-top: 1px solid #dedede;
    gap: 10px;
}

#chat-header {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: start;
    padding: 10px;
    background-color: #F4524D;
    background-image: linear-gradient(to bottom, rgba(255, 255, 255, .2) 0, rgba(255, 255, 255, .01) 100%);
    background-repeat: repeat-x;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#chat-subject {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

#chat-assistant-name {
    font-size: 14px;
    font-weight: 400;
    color: #fff;
}

.assistant-message .message-content {
    white-space: break-spaces;
}

.user-message .message-content {
    background-color: #e8e8e880;
    color: #000;
    border-radius: 20px;
    padding: 10px;
    margin-bottom: 5px;
}

.assistant-message {
    align-self: flex-start;
    background: transparent;
    padding: 10px;
    color: #000;
    border-radius: 10px;
    margin: 5px;
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

.assistant-message.typing {
    flex-direction: row;
    align-items: center;
}

.message .message-actions {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    gap: 5px;
}

.message .message-actions > li {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    position: relative;
}

.message .message-actions > li .action-dropdown {
    position: absolute;
    top: -60px;
    left: 0;
    width: max-content;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #f0f4f9;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
}

.message .message-actions > li .action-dropdown > li {
    padding: 8px 16px;
}

.message .message-actions > li:not(.active) .action-dropdown {
    display: none;
}

.message .message-actions > li:hover {
    background-color: #dedede;
}

.message .message-actions > li i {
    cursor: pointer;
}

#send-message {
    border: none;
    cursor: pointer;
    display: flex;
    background: transparent;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-radius: 0;

}

#send-message i {
    color: #838383;
    font-size: 21px;
}

#send-message:hover i {
    color: #000;
}

#share-conversation {
    border: none;
    cursor: pointer;
    display: flex;
    background: transparent;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-radius: 0;
}

#share-conversation i {
    color: #838383;
    font-size: 21px;
}

#share-conversation:hover i {
    color: #000;
}

#chat-legend {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 20px 10px;
}

#chat-legend > div > span {
    padding: 5px;
    border-radius: 5px;
    background: #dedede;
    border-bottom: 2px solid #848484;
    border-right: 2px solid #848484;
    font-size: 12px;
    font-weight: 600;
}

.conversation-actions {
    position: relative;
}

.conversation-item__header {
    user-select: none;
}

.conversation-item__actions {
    user-select: none;
}

.conversation-actions__dropdown {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    background-color: #fff;
    min-width: 220px;
    right: 0;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
    z-index: 99;
    border-radius: 5px;
}

.conversation-actions__dropdown > li {
    padding: 10px !important;
    cursor: pointer;
}

.conversation-actions__dropdown > li:first-child {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.conversation-actions__dropdown > li:last-child {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.conversation-actions__dropdown > li:hover {
    color: #000;
}

.conversation-actions__dropdown:not(.active) {
    display: none;
}

.chat-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.chat-actions:not(.active) {
    display: none;
}

#save-pdf > i, #send-pdf > i {
    font-size: 21px;
    margin-right: 5px;
}

#save-pdf, #send-pdf {
    display: flex;
    flex-direction: row;
    align-items: center;
}

#save-pdf:disabled, #send-pdf:disabled, #save-pdf.disabled, #send-pdf.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#send-pdf-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

#send-pdf-wrapper:not(.active) {
    display: none;
}

#send-mail {
    background-color: #363636;
    color: #fff;
    border-color: #363636;
}

#send-mail.disabled, #send-mail:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#send-mail > i {
    font-size: 21px;
}

#chatbot-questions.disabled {
    opacity: .7;
    pointer-events: none;
}

#chatbot-questions p {
    cursor: pointer;
}

#chatbot-questions p:hover {
    color: #000 !important;
}

.ai-assistant-wrapper {
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    column-gap: 85px;
}

.ai-assistant__subjects {
    display: flex;
    flex-direction: column;
}

.ai-assistant__subjects__header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    margin-bottom: 15px;
}

.ai-assistant__main:not(.open) {
    margin-top: 300px;
}

.ai-assistant__main.open {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ai-assistant__main.open .ai-assistant__main__textarea {
    /*margin-top: auto;*/
}

.ai-assistant__main__chat .message {
    padding: 10px 15px;
    border-radius: 15px;
    font-family: 'Open Sans';
    font-size: 16px;
    font-weight: 400;
    color: #2c2c2c;
    margin-bottom: 10px;
}

.ai-assistant__main__chat .message .message-content {
    white-space: break-spaces;
}

.ai-assistant__main__chat .message-user {
    background-color: #f3f3f3;
    align-self: flex-end;
    text-align: right;

}

.ai-assistant__main__chat .message-bot {
    align-self: flex-start;
    text-align: left;
    background-color: #ffffff;
}

.ai-assistant__main__chat {
    display: flex;
    flex-direction: column;
    overflow: auto;
    max-height: calc(40vh - 40px);
    padding: 20px;
    margin-bottom: 40px;
    position: relative;
}

.ai-assistant__main__chat:not(.open) {
    display: none;
}

.ai-assistant__subjects__header__title {
    font-family: Open Sans;
    font-weight: 600;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0;
    color: #2c2c2c;
    cursor: pointer;
    text-align: center;
    display: block;
    margin-bottom: 20px;
}

.ai-assistant__history__conversation-list:not(.open) {
    display: none;
}

.ai-assistant__history__header__title {
    font-family: Open Sans;
    font-weight: 600;
    font-size: 18px;
    line-height: 100%;
    letter-spacing: 0;
    color: #2c2c2c;
    cursor: pointer;
    text-align: center;
    display: block;
    margin-bottom: 20px;
}

.ai-assistant__main__title {
    font-family: Open Sans;
    font-weight: 600;
    font-size: 36px;
    line-height: 100%;
    letter-spacing: 0;
    color: #2c2c2c;
    text-align: center;
    margin-bottom: 30px;
}

.ai-assistant__main__textarea textarea {
    width: 100%;
    height: 120px;
    border: 1px solid #C2C3C1;
    border-radius: 15px;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
    background-color: #fff;
    font-family: Open Sans;
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
}

.ai-assistant__main__textarea textarea:disabled {
    opacity: 0.4;
}

.ai-assistant__main__textarea textarea::placeholder {
    color: #2C2C2C99;
}

.ai-assistant__history__conversation-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-radius: 15px;
    background-color: #f3f3f3;
    padding: 15px;
    border: 1px solid #c2c3c1;
}

.ai-assistant__history__conversation-list .conversation-item {
    font-size: 14px;
    color: #2c2c2c;
    cursor: pointer;
    display: flex;
    padding: 5px 10px;
    border-radius: 15px;
    flex-direction: row;
    align-items: flex-start;
    position: relative;
}

.conversation-item__header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
}

.ai-assistant__history__conversation-list .conversation-item span {
    margin-right: 10px;
    line-height: 1.5;
}

.ai-assistant__history__conversation-list .conversation-item__header svg {
    position: relative;
    top: 9px;
    margin-left: auto;
    min-width: 14px;
    min-height: 3px;
}

.ai-assistant__history__conversation-list .conversation-item:hover {
    background-color: #ffffff;
}

.ai-assistant__history__conversation-list .conversation-item__actions {
    position: absolute;
    top: 100%;
    z-index: 100;
    right: 0;
    background-color: #ffffff;
    border-radius: 15px;
    border: 1px solid #C2C3C1;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
    padding: 10px 20px;
}

.ai-assistant__history__conversation-list .conversation-item__actions:not(.open) {
    display: none;
}

.ai-assistant__history__conversation-list .conversation-item__actions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.conversation-item__actions ul li {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.ai-assistant__history__conversation-list .conversation-item__actions ul li:hover {
    text-decoration: underline;
}

.ai-assistant__history__conversation-list .conversation-item__actions ul li.disabled {
    user-select: none;
    cursor: wait;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: #f1f1f1;
    border-radius: 8px;
    width: fit-content;
    margin: 4px 0;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #888;
    animation: blink 1.4s infinite both;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0; }
    40% { opacity: 1; }
}

.message.skeleton {

    display: flex;
    justify-content: flex-start;
}

.message.skeleton .bubble {
    width: 60%;
    padding: 15px;
    border-radius: 15px;
    background: linear-gradient(
            90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

.message.skeleton:nth-child(2) .bubble {
    width: 40%;
}
.message.skeleton:nth-child(3) .bubble {
    width: 70%;
}
.message.skeleton:nth-child(4) .bubble {
    width: 30%;
}
.message.skeleton:nth-child(5) .bubble {
    width: 50%;
}

@keyframes shimmer {
    0% { background-position: -100% 0; }
    100% { background-position: 100% 0; }
}

.conversation-skeleton {
    width: 100%;
    height: 20px;
    border-radius: 15px;
    background: linear-gradient(
            90deg,
            #e0e0e0 25%,
            #d0d0d0 50%,
            #e0e0e0 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite ease-in-out;
}

.ai-assistant__main__textarea {
    position: relative;
}

.ai-assistant__main__textarea__send-button {
    width: 30px;
    height: 30px;
    background-color: #31697D;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    position: absolute;
    right: 15px;
    bottom: 15px;
}

.message-actions-list {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

.message-actions-list button {
    background-color: transparent;
    padding: 5px;
    cursor: pointer;
    height: auto;
    border: 0;
}

.message-actions-list button:hover {
    background-color: #ddd;
}

#aiEmailModal {
    display:none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 320px;
}

#aiEmailInput {
    width:100%;
    margin: 20px 0;
}

#aiEmailModalActions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#aiEmailSubmit.disabled {
    cursot: not-allowed;
    opacity: .6;
}

.ai-assistant__subjects__list {
    max-height: 70vh;
    overflow: auto;
}

.ai-assistant__subjects__list__subject__header {
    min-height: 45px;
    width: 100%;
    border: 1px solid rgba(194, 195, 193, 1);
    border-radius: 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 15px;
    gap: 10px;
    cursor: pointer;
    line-height: 18px;
}

.ai-assistant__subjects__list__subject__header span {
    font-family: Open Sans;
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0;
}

.ai-assistant__subjects__list__subject:not(.open) .ai-assistant__subjects__list__subject__items {
    display: none;
}

.ai-assistant__subjects__list__subject.open .ai-assistant__subjects__list__subject__header {
    border-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: rgba(49, 105, 125, 1);
    border-color: rgba(49, 105, 125, 1);
    color: #ffffff;
}

.ai-assistant__subjects__list__subject__items {
    border: 1px solid rgba(194, 195, 193, 1);
    border-top: 0;
    padding: 10px 5px;
}

.ai-assistant__subjects__list__subject__items__item span {
    font-family: Open Sans;
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0;
}

.ai-assistant__subjects__list__subject__items__item {
    line-height: 21px;
    display: flex;
    flex-direction: row;
    cursor: pointer;
    border-radius: 15px;
    padding: 10px;
    justify-content: space-between;
}

.ai-assistant__subjects__list__subject__items__item:hover {
    background-color: rgba(243, 243, 243, 1);
}

.ai-assistant__subjects__list__subject__items__item svg {
    min-height: 16px;
    min-width: 16px;
    position: relative;
    top: 2px;
}

.ai-assistant__subjects__list__subject {
    margin-bottom: 15px;
}

.ai-assistant__subjects__list:not(.open) {
    display: none;
}

.ai-assistant__history__header__mobile-close {
    display: none;
}

.ai-assistant__main__toggle-history {
    height: 40px;
    line-height: 40px;
    white-space: nowrap;
    gap: 10px;
    padding: 0 15px;
    border-radius: 10px;
    background-color: rgba(49, 105, 125, 1);
    color: #ffffff !important;
    display: none;
    align-items: center;
    justify-content: center;
    border: 0;
    align-self: center;
    margin-bottom: 20px;
    justify-self: center;
}

.ai-assistant__main__chat__download-chat {
    background-color: rgba(49, 105, 125, 1);
    border: 0;
    border-radius: 15px;
    color: #fff !important;
    height: 24px;
    line-height: 24px;
    width: 140px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-family: 'Open Sans';
}

.ai-assistant__main__chat__download-chat:disabled {
    opacity: .5;
    cursor: wait;
}

.ai-assistant__main__chat__download-chat.loading {
    display: none;
}

.ai-assistant__history__new-conversation {
    background-color: rgba(49, 105, 125, 1);
    border: 0;
    border-radius: 15px;
    color: #fff !important;
    font-family: 'Open Sans';
    font-size: 14px;
    height: 25px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    margin-bottom: 15px;
    font-weight: 400;
}


.ai-assistant__main__chat:not(.open) + .ai-assistant__main__chat__download-chat {
    display: none;
}

@media(max-width: 991.5px) {

    .ai-assistant__main__toggle-history {
        display: flex;
    }

    .ai-assistant-wrapper {
        grid-template-columns: 1fr;
    }

    .ai-assistant__main {
        order: 1;
    }

    .ai-assistant__main:not(.open) {
        margin-top: 20px;
    }

    .ai-assistant__subjects {
        order: 2;
    }

    .ai-assistant__main__textarea {
        margin-bottom: 20px !important;
    }

    .ai-assistant__history {
        order: 3;
        position: fixed;
        right: 0;
        top: 0;
        height: 100%;
        background-color: rgba(243, 243, 243, 1);
        z-index: 1000;
        width: 260px;
        padding: 30px 20px;
    }

    .ai-assistant__main__textarea textarea {
        height: 200px;
    }

    .ai-assistant__main__textarea {
        margin-bottom: 20px;
    }

    .ai-assistant__subjects__header {
        justify-content: start;
    }


    .ai-assistant__history__conversation-list .conversation-item {
        border: 0;
        background: transparent;
    }

    .ai-assistant__history__conversation-list {
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    body.admin-bar .ai-assistant__history {
        padding-top: 70px;
    }

    .ai-assistant__history__header__mobile-close {
        display: flex;
        margin-bottom: 30px;
    }

    .ai-assistant__history:not(.open) {
        display: none;
    }

    .ai-assistant__main__chat {
        margin-bottom: 0;
    }

    .ai-assistant__main__chat__download-chat {
        margin-bottom: 15px;
    }

    .ai-assistant__subjects__list {
        max-height: none;
        overflow: auto;
    }
}