﻿.assistentContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    z-index: 2;
}

.btn-open-assistant {
    background: linear-gradient(270deg, var(--corLogo), var(--corLogoEscuro), var(--corLogo));
    background-size: 600% 600%;
    animation: bgAnimation 5s ease infinite;
    font-family: var(--defaultFont);
    padding: 15px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 25px;
    border: none;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    gap: 10px;
    transition: 0.3s;
}

.btnAssistantMsg {
    background: linear-gradient(270deg, var(--corLogo), var(--corLogoEscuro), var(--corLogo));
    background-size: 600% 600%;
    animation: bgAnimation 5s ease infinite;
    font-family: var(--defaultFont);
    /*padding: 10px;*/
    position: absolute;
    right: 110%;
    max-width: 0vw;
    max-height: 100%;
    width: max-content;
    overflow: hidden;
    white-space: nowrap;
    top: 50%;
    opacity: 0;
    display: flex;
    transform: translateY(-85%);
    color: white;
    font-size: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: .3s;
}

.btnAssistantMsg.show{
    max-width: 80vw;
    padding: 10px;
    opacity: 1;
}



    .btn-open-assistant span {
        font-size: 30px;
    }

    .btn-open-assistant.open {
        background: linear-gradient(270deg, red, var(--corLogoEscuro), red);
        background-size: 600% 600%;
        animation: bgAnimation 3s ease infinite;
    }

.btn-open-assistant.open .btnAssistantMsg {
    max-width: 0;
    padding: 0;
    opacity: 0;
}

#micAiButton {
    border-radius: 50%;
    background: linear-gradient(270deg, var(--corLogo), var(--corLogoEscuro), var(--corLogo));
    background-size: 300% 300%;
    border: none;
    padding: 10px;
    aspect-ratio: 1/1;
    scale: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    cursor: pointer;
    isolation: isolate;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25), 0 0 18px var(--corLogoEscuro);
    animation: bgAnimation 8s ease infinite, micIdle 3s ease-in-out infinite;
    transition: 0.3s ease-in-out;
}

    #micAiButton.show {
        scale: 1;
    }

    #micAiButton:hover,
    #micAiButton:focus-visible {
        transform: scale(1.04);
        box-shadow: 0 10px 28px rgba(0, 0, 0, .3), 0 0 26px var(--corLogo);
    }

    #micAiButton::before,
    #micAiButton::after {
        content: "";
        position: absolute;
        inset: -8px;
        border-radius: 50%;
        pointer-events: none;
        opacity: 0;
        border: 2px solid var(--corLogo);
        z-index: -1;
    }

    #micAiButton.active,
    #micAiButton[aria-pressed="true"] {
        animation: bgAnimation 1.2s linear infinite, micActivePulse 0.8s ease-in-out infinite;
        filter: saturate(1.2);
        box-shadow: 0 0 32px 8px var(--corLogo), 0 0 64px 16px var(--corLogoEscuro), 0 10px 30px rgba(0,0,0,.35);
    }

        #micAiButton.active::before,
        #micAiButton[aria-pressed="true"]::before {
            opacity: .85;
            animation: ringPulse 1.4s ease-out infinite;
        }

        #micAiButton.active::after,
        #micAiButton[aria-pressed="true"]::after {
            opacity: .6;
            border-color: var(--corLogoEscuro);
            animation: ringPulse 1.4s ease-out 0.7s infinite;
        }




#speakResponseButton {
    border: none;
    padding: 5px;
    font-size: 10px;
    aspect-ratio: 1/1;
    scale: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    color: white;
    background: none;
    position: relative;
    cursor: pointer;
    isolation: isolate;
    max-width: 0;
    transition: 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

#speakResponseButton.show{
    scale: 1;
    max-width: 50px;
}


.speakResponse_loader {
    display: flex;
    align-items: center;
    scale: 0;
    opacity: 0;
    justify-content: center;
    height: 100%;
    transition: .3s;
    max-width: 0px;
    overflow: hidden;
}


#speakResponse_wave {
    height: 32px;
    width: 32px;
    fill: var(--corLogo);
    transition: .3s;
}


#speakResponseButton span {
    background: linear-gradient(145deg, var(--corLogo), var(--fontColor1), var(--backgroundColor2));
    background-clip: text;
    display: inline-block;
    transition: .3s;
    max-width: 100px;
    color: transparent;
    background-size: 1000% 1000%;
    animation: bgAnimation 3s ease infinite;
}

    #speakResponseButton.speaking span{
       max-width: 0px;
       overflow: hidden;
    }

    #speakResponseButton.speaking .speakResponse_loader {
        max-width: 100px;
        scale: 1;
        opacity: 1;
        overflow: hidden;
    }

        #speakResponseButton.speaking .speakResponse_loader:hover #speakResponse_wave {
            fill: red;
        }




.ai_buttons {
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 10px;
    width: 100%;
}

.popup-assistant {
    position: absolute;
    bottom: 150%;
    right: 0;
    transform: translateX(0) scale(0);
    transform-origin: right bottom;
    z-index: 1000;
    background: linear-gradient(270deg, var(--corLogo), var(--backgroundColor), var(--corLogoEscuro));
    background-size: 600% 600%;
    animation: bgAnimation 5s ease infinite;
    border: 2px solid var(--corLogoEscuro);
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    border-radius: 15px;
    min-width: 600px;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    padding: 0;
    overflow: hidden;
}

    .popup-assistant.active {
        padding: 5px;
        pointer-events: all;
        opacity: 1;
        transform: translateX(-10%) scale(1);
    }

.aiassist-container {
    width: 100%;
    min-height: 40vh;
    min-width: 600px;
    height: 300px;
    max-height: 80vh;
    border-radius: 15px;
    overflow: hidden;
    transition: .4s;
}

    .aiassist-container.expanded {
        min-height: 60vh;
        min-width: 800px;
    }

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--defaultFont);
    color: var(--fontColor1);
    margin-bottom: 10px;
}

pre#out {
    color: var(--fontColor1);
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: max-width 1s ease, max-height 1s ease;
    transition: .2s;
    color: transparent;
}




#out-msg {
    max-width: 0px;
    max-height: 0px;
    overflow: hidden;
    background: linear-gradient(270deg, var(--corLogo), var(--fontColor1), var(--corLogo));
    background-size: 200% 200%;
    background-clip: text;
    transition: .3s;
}

#out-msg.show {
    max-width: 500px;
    max-height: 100px;
    animation: bgAnimation 4s infinite;
    animation-delay: 0.3s;
}


.e-content-body br {
    display: none !important;
}


.related-link {
    display: inline-block;
    padding: 8px 14px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 2px;
    margin-bottom: 3px;
    border-radius: 30px;
    background: var(--backgroundColor);
    background: linear-gradient(270deg, var(--backgroundColor), var(--corLogo), var(--backgroundColor));
    background-size: 200% 200%;
    animation: bgAnimation 8s ease infinite;
    color: var(--fontColor1) !important;
    text-decoration: none;
    font-size: 15px;
    transition: .3s;
    border: 2px solid transparent;
}

    .related-link:hover {
        border: 2px solid var(--corLogo);
    }

  


@media (max-width: 968px) {

    .aiassist-container.expanded {
        min-height: 50vh;
        min-width: 700px;
    }
}

    @keyframes bgAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 768px) {
    .popup-assistant {
        position: fixed;
        width: 90vw;
        min-width: 80vw;
        bottom: 15vh;
        left: 50%;
        transform: translateX(-50%) scale(0);
    }


    #out-msg.show {
        max-width: 50vw;
    }

    .popup-assistant.active {
        transform: translateX(-50%) scale(1);
    }

    .aiassist-container {
        min-width: 100%;
    }

        .aiassist-container.expanded {
            min-height: 70vh;
            min-width: 90%;
        }
}


@keyframes ringPulse {
    0% {
        transform: scale(1);
        opacity: .9;
    }

    80% {
        opacity: 0;
    }

    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

@keyframes micIdle {
    0%,100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

@keyframes speakAway {
    0% {
        transform: translateX(0) scale(0.25, 0.5);
        opacity: .35;
    }
    45% {
        transform: translateX(var(--speak-distance)) scale(1, 1);
        opacity: 1;
    }
    55% {
        transform: translateX(calc(var(--speak-distance) + 6px)) scale(1.06, 1.08);
        opacity: .9;
        animation-timing-function: cubic-bezier(.2,.8,.2,1);
    }
    56% {
        transform: translateX(0) scale(0.2, 0.45);
        opacity: .3;
        animation-timing-function: steps(1, end); 
    }
    100% {
        transform:  translateX(0) scale(0.25, 0.5);
        opacity: .35;
    }
}


@keyframes micActivePulse {
    0%,100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}



#Line_1 {
    animation: pulse 0.7s infinite;
    animation-delay: 0.15s;
}

#Line_2 {
    animation: pulse 0.7s infinite;
    animation-delay: 0.30s;
}

#Line_3 {
    animation: pulse 0.7s infinite;
    animation-delay: 0.45s;
}

#Line_4 {
    animation: pulse 0.7s infinite;
    animation-delay: 0.60s;
}

#Line_5 {
    animation: pulse 0.7s infinite;
    animation-delay: 0.75s;
}

#Line_6 {
    animation: pulse 0.7s infinite;
    animation-delay: 0.90s;
}

#Line_7 {
    animation: pulse 0.7s infinite;
    animation-delay: 1.05s;
}

#Line_8 {
    animation: pulse 0.7s infinite;
    animation-delay: 1.20s;
}

#Line_9 {
    animation: pulse 0.7s infinite;
    animation-delay: 1.35s;
}

@keyframes pulse {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.5);
    }

    100% {
        transform: scaleY(1);
    }
}
