/*!
 * -------------------------------------------------------------------------
 * glpiai plugin for GLPI
 * -------------------------------------------------------------------------
 *
 * MIT License
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 * -------------------------------------------------------------------------
 * @copyright Copyright (C) 2023 by the glpiai plugin team.
 * @license   MIT https://opensource.org/licenses/mit-license.php
 * @link      https://github.com/pluginsGLPI/glpiai
 * -------------------------------------------------------------------------
 */

/* Styles for the summarization modal */

.writing {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.writing div {
    position: absolute;
    top: 33px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #5f5f5f4d;
    animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.writing div:nth-child(1) {
    left: 8px;
    animation: writing1 0.6s infinite;
}

.writing div:nth-child(2) {
    left: 8px;
    animation: writing2 0.6s infinite;
}

.writing div:nth-child(3) {
    left: 32px;
    animation: writing2 0.6s infinite;
}

.writing div:nth-child(4) {
    left: 56px;
    animation: writing3 0.6s infinite;
}

@keyframes writing1 {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes writing3 {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(0);
    }
}

@keyframes writing2 {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(24px, 0);
    }
}

.hidden {
    opacity: 0;
    transition: opacity 0.5s;
}

.zero-height {
    height: 0px !important;
    transition: height 0.5s;
}

.anim_container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    transition: height 0.5s;
}

.content-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-modal {
    min-height: 50%;
    min-width: 24.9%;
    max-height: 90%;
    max-width: 90%;
    position: fixed;
    bottom: 3rem;
    right: 0;
    margin-bottom: 0.8rem !important;
    margin-right: 1.5rem !important;
    z-index: 1100;
    display: block;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out !important;
    transform-origin: bottom right;
    box-shadow: -5px 0 5px rgba(0, 0, 0, 0.1), 5px 0 5px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.1), 0 -5px 5px rgba(0, 0, 0, 0.1) !important;
    border-radius: 10px 10px 0 0;
}


.chatbot-modal.hide {
    transform: scale(0);
    opacity: 0;
}

.vertical-resize {
    resize: vertical;
    position: absolute;
    inset: 0px;
    height: 0.5rem;
    width: 100%;
    cursor: ns-resize;
    z-index: 2;
}

.horizontal-resize {
    resize: horizontal;
    position: absolute;
    inset: 0px;
    height: 100%;
    width: 8px;
    cursor: ew-resize;
    z-index: 2;
}

.modal-resize {
    resize: both;
    position: absolute;
    inset: 0px;
    height: 0.5rem;
    width: 0.5rem;
    cursor: nwse-resize;
    z-index: 2;
}

.categorize-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 1rem;
}

/* Styles for the categorization input */

.categorize-waiting {
    animation: boxShadowRotate 2s infinite linear;
    border-radius: 4px;
    outline: none;
}

.categorize-success {
    box-shadow: 0 0 0 0.25rem var(--tblr-primary);
    border-radius: 4px;
    animation: boxShadowBlinkSuccess 1s infinite;
}

.categorize-error {
    box-shadow: 0 0 0 0.25rem var(--tblr-danger);
    border-radius: 4px;
    animation: boxShadowBlinkError 1s infinite;
}

@keyframes boxShadowBlinkSuccess {

    0%,
    100% {
        box-shadow: 0 0 0 0.1rem #a289d7;
    }

    50% {
        box-shadow: 0 0 0 0.2rem #a289d7;
    }
}

@keyframes boxShadowBlinkError {

    0%,
    100% {
        box-shadow: 0 0 0 0.1rem var(--tblr-danger);
    }

    50% {
        box-shadow: 0 0 0 0.2rem var(--tblr-danger);
    }
}

@keyframes boxShadowRotate {
    0% {
        box-shadow: 0 -5px 10px 0px #a289d7;
    }

    25% {
        box-shadow: 5px 0 10px 0px #a289d7;
    }

    50% {
        box-shadow: 0 5px 10px 0px #a289d7;
    }

    75% {
        box-shadow: -5px 0 10px 0px #a289d7;
    }

    100% {
        box-shadow: 0 -5px 10px 0px #a289d7;
    }
}

/* Styles for providers cards */

.card-provider {
    margin-top: 50px;
    transition: all 0.2s ease-in;
    box-shadow: 0px 3px 4px rgba(119, 119, 119, 0.5);
    overflow: hidden;
}

.card-provider:hover {
    box-shadow: 0px 5px 10px rgba(119, 119, 119, 0.5);
    transition: all 0.2s ease-in;
    margin-top: 50px;
}

.card-provider img {
    -webkit-transition: all .9s ease;
    -moz-transition: all .9s ease;
    -o-transition: all .9s ease;
    -ms-transition: all .9s ease;
    width: 100%;
    height: 200px;
}

.card-provider:hover img {
    -webkit-transform: scale(1.025);
    -moz-transform: scale(1.025);
    -ms-transform: scale(1.025);
    -o-transform: scale(1.025);
    transform: scale(1.025);
}

/* Chatbot styles */
.chatbot {
    width: 100%;
    height: 100%;
}

.assistant-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: #9990ff;
    border-radius: 10px 10px 0 0;
    padding: 0.5rem;
    color: white;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.assistant-header-title {
    display: flex;
    flex-direction: row;
}

.assistant-header-text {
    display: flex;
    flex-direction: column;
}

.assistant-header-text>* {
    margin-bottom: 0 !important;
}

.assistant-more-actions {
    display: flex;
    margin-top: 1px;
    color: black;
    opacity: 0.5 !important;
    transition: opacity 0.3s;
}

.assistant-more-actions:hover {
    opacity: 1 !important;
}

.assistant-options-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.vertical-sep-bar {
    width: 1px;
    height: 30px !important;
    display: inline-block;
    margin-inline: 1rem;
    margin: 0 !important;
}

.assistant-more-actions {
    display: flex;
    margin-top: 1px;
    color: black;
    opacity: 0.5 !important;
    transition: opacity 0.3s;
}

.assistant-more-actions:hover {
    opacity: 1 !important;
}

.assistant-options-tools {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.vertical-sep-bar {
    width: 1px;
    height: 30px !important;
    display: inline-block;
    margin-inline: 1rem;
    margin: 0 !important;
}

.assistant-body {
    display: contents;
    height: 100%;
    border-left: 1px solid #dfdfdf;
    border-right: 1px solid #dfdfdf;
    border-width: 1px;
}

.assistant-body-content {
    border-left: 1px solid #dfdfdf;
    border-right: 1px solid #dfdfdf;
    padding-bottom: 0.5rem;
    height: inherit;
    overflow-y: auto;
}

.assistant-body-content.assistant-modal {
    max-height: 700px;
}

.assistant-body-content.assistant-panel {
    max-height: 50vh;
}

.bubble-container {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 15px;
}

.bubble-container.left {
    display: flex;
    justify-content: flex-start;
}

.bubble-container.right {
    display: flex;
    justify-content: flex-end;
}

.chat-bubble {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
    width: fit-content;
    padding: 0.5rem !important;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    gap: 1rem;
}

.chat-bubble.left {
    align-self: flex-start;
    flex-direction: row;
    box-shadow: none;
}

.chat-bubble.right {
    align-self: flex-end;
    flex-direction: row-reverse;
    background-color: #efefef;
}

.chat-bubble-header.left {
    display: flex;
    align-items: center;
    flex-direction: row;
    margin-bottom: 10px;
}

.chat-bubble-header.right {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    margin-bottom: 10px;
}

.chat-bubble-header.left .chat-bubble-header-avatar {
    width: max-content;
}

.chat-bubble-header-avatar img,
.chat-bubble-header-avatar span {
    width: 30px;
    height: 30px;
}

.avatar-initials {
    --tblr-avatar-size: 2.75rem;
}

.chat-bubble-header-sender{
    display: flex;
    flex-direction: column;
}

.chat-bubble-header-sender.left{
    align-items: flex-start;

}

.chat-bubble-header-sender.right{
    align-items: flex-end;

}

.chat-bubble-header-sender span:first-child {
    font-weight: bold;
    color: #333;
}

.chat-bubble-header-sender span:last-child {
    font-size: 0.8em;
    color: #999;
}

.chat-bubble-content {
    font-size: 1em;
    color: #555;
    line-height: 1.5;
}

.assistant-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #dfdfdf;
    border-bottom: 1px solid #dfdfdf;
    border-left: 1px solid #dfdfdf;
    border-right: 1px solid #dfdfdf;
    border-radius: 0 0 0 0;
    position: relative;
    height: min-content;
    max-height: 40%;
    background-color: #f1f1f1;
}

.assistant-footer>.input-group {
    margin: 0.5rem;
    outline: none !important;
    border-radius: 10px;
    width: 100% !important;
    background-color: #fff;
    display: flex;
    align-items: flex-end;
    height: -webkit-fill-available;
}

.assistant-footer>.input-group>.form-control {
    position: relative;
    flex: 1 1 auto;
    border: none !important;
    border-radius: 10px 0 0 10px !important;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    resize: none;
    overflow-y: auto;
    max-height: 100%;
}

.input-group-append {
    display: flex;
}

.footer-panel {
    width: 100%;
    background: #fafbfc;
    border-radius: 12px;
    padding: 0 1em;
    margin-right: 1rem;
    height: 55px;
}

.input-group-send {
    background: transparent !important;
    border: none !important;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: min-content;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    cursor: pointer;
    color: #ccc;
}

.send-button>i {
    color: white;
    font-size: 1.75em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.typing {
    position: relative;
    padding: 0.05rem;
    margin: 1rem;
}

.typing span {
    content: '';
    animation: blink 1.5s infinite;
    animation-fill-mode: both;
    height: 10px;
    width: 10px;
    background: #3b5998;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 50%;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
    margin-left: 15px;
    /* 10px * 1.5 */
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
    margin-left: 30px;
    /* 10px * 3 */
}

@keyframes blink {
    0% {
        opacity: 0.1;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: 0.1;
    }
}

.pl-0 {
    padding-left: 0 !important;
}


.assistant-modal {
    background-color: transparent !important;
}

.chatbot-section-container {
    display: flex;
    height: 100%;
    flex-direction: column;
    width: 100%;
    background-color: #ffffff;
    border-radius: 10px;
}

.chatbot-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid #dfdfdf;
    border-right: 1px solid #dfdfdf;
    border-bottom:  1px solid #dfdfdf;
    border-width: 1px;
    border-top: 1px solid #dfdfdf;
    border-radius: 10px 10px 0 0;
}

.chatbot-section-title {
    display: flex;
    align-items: center;
}

.chatbot-section-title>.item-title,
.chatbot-section-title>.ti {
    color: var(--tblr-body-color) !important;
}

.vr {
    margin-inline: 1rem;
}

.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 1099;
}

select:focus, input:focus, textarea:focus {
    outline: none !important;
    outline-style: none;
    box-shadow: none;
    border-color: transparent;
}

.btn-assistant {
    position: fixed;
    bottom: 5rem;
    right: 3rem;
    z-index: 1000;
    width: 78px;
    height: 78px;
    border: unset !important;
    padding: unset !important;
    background-image: url("../pics/assistant_80.png");
    background-repeat: no-repeat;
    border-radius: 50px !important;
    cursor: pointer;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 14px 28px, rgba(0, 0, 0, 0.22) 0px 10px 10px;
    transition: background-color 2s ease-out; /* Transition pour le changement de couleur */
}

.btn-assistant:hover {
    border: unset !important;
    border-radius: 50px;
    background-color: white;
    animation: infinite-bounce 1.5s ease-out infinite; /* Rebond perpétuel */
}

/* Animation de rebond perpétuel */
@keyframes infinite-bounce {
    0%, 100% {
        transform: translateY(0); /* Position de départ et de fin */
    }
    50% {
        transform: translateY(-10px); /* Rebond vers le haut */
    }
}

.btn-assistant > .ti {
    font-size: 2em;
}

.btn-ghost-glpiai-bubble-action{
    --tblr-btn-color: #ffffff;
    --tblr-btn-color-interactive: #566483;
    --tblr-btn-color-text: #626976;
    background: #626976;
    border: unset !important;
}

.btn-ghost-glpiai-bubble-action:hover{
    --tblr-btn-color: #F9F9F9
}

.chat-bubble-content p {
    margin-bottom: 0.5rem;
}

.glpiai-bg-color {
    background: linear-gradient(145deg, #4F4790, #a289d7) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Shiny gloss effect */
.glpiai-bg-color::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    opacity: 0.5;
    pointer-events: none;
}

/* Moving highlight */
.glpiai-bg-color::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-20deg);
    animation: shiny 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shiny {
    0% {
        left: -150%;
        opacity: 0.8;
    }
    8.33% {
        left: -125%;
        opacity: 0.8;
    }
    16.67% {
        left: -100%;
        opacity: 0.8;
    }
    25% {
        left: -75%;
        opacity: 0.8;
    }
    33.33% {
        left: -50%;
        opacity: 0.8;
    }
    41.67% {
        left: -25%;
        opacity: 0.8;
    }
    50% {
        left: 0%;
        opacity: 0.8;
    }
    58.33% {
        left: 25%;
        opacity: 0.8;
    }
    66.67% {
        left: 50%;
        opacity: 0.8;
    }
    75% {
        left: 75%;
        opacity: 0.8;
    }
    83.33% {
        left: 100%;
        opacity: 0.8;
    }
    91.67% {
        left: 125%;
        opacity: 0.8;
    }
    100% {
        left: 150%;
        opacity: 0.8;
    }
}

.assistant-pre-footer {
    z-index: 1;
    border-top: 1px solid #dfdfdf;
    border-bottom: 1px solid #dfdfdf;
    border-left: 1px solid #dfdfdf;
    border-right: 1px solid #dfdfdf;
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    margin: 0.2rem;
    gap: 0.5rem;
}

.bg-selfhosted {
    background-color: #3498DB !important;
    color: white;
}

.bg-recommended {
    background-color: #2E7D32 !important;
    color: white;
}
