#ai-chat-btn, #ai-header a, #ai-history a:has(i.fa-trash-can), #ai-message a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    color: #fff !important;
    font-weight: bold;
    font-size: 18px;
    width: 35px;
    line-height: 35px;
}
#ai-chat-btn {
    position: fixed;
    bottom: 15px;
    height: 160px;
    width: 160px;
    right: 75px;
    z-index: 100;
    border-radius: 35px;
}
#ai-chat-btn.active {
    height: 60px;
    width: 60px;
}
#ai-chat-tooltip {
    position: fixed;
    bottom: 180px;
    width: 200px;
    right: 55px;
    z-index: 50;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #212121;
    padding: 6px 10px;
    background: #fff;
}
@media (max-width: 768px) {
    #ai-chat-btn {
        height: 80px;
        width: 80px;
        right: 15px;
    }
    #ai-chat-tooltip {
        bottom: 35px;
        right: 110px;
    }
}
#ai-chat {
    position: fixed;
    bottom: 70px;
    width: 300px;
    height: 500px;
    background: #00000095;
    border: #212121 1px solid;
    right: 15px;
    z-index: 75;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    overflow: hidden;
}
/*
#ai-chat a:has(i.fa-trash-alt) {
    position: absolute;
    bottom: 50px;
    right: 10px;
    background: #FFF;
    padding: 0px 5px;
    border-radius: 5px;
}
*/
#ai-header {
    height: 40px;
    line-height: 40px;
    background: #E30613;
    color: #FFF;
    font-weight: bold;
    padding: 0 2px;
    padding-left: 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
#ai-header span, 
#ai-header div {
    display: flex;
}
#ai-header span i {
    background-color: #43ac33;
    width: 8px;
    height: 8px;
    border-radius: 25px;
    border-radius: 25px;
    display: block;
    border: 1px solid #FFF;
    margin-right: 7.5px;
    margin-top: 14px;
}
#ai-history {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 5px 5px;
    position: relative;
    /*border: 1px solid #F0F0F0;*/
}
#ai-history .ai-message-inner {
    max-width: calc(100% - 55px);
    width: fit-content;
    border-radius: 5px;
    padding: 1px 10px;
    margin-bottom: 5px;
    background: #F0F0F0;
}
#ai-history .ai-message-inner p {
    padding: 0px;
    margin: 5px 0px;
}
#ai-history .ai-robot {
    display: flex;
    flex-direction: row;
}
#ai-history .ai-robot img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    margin-top: 5px;
    display: none;
}
#ai-history .ai-robot i.fa-robot {
    margin-right: 5px;
    color: #E30613;
}
#ai-history .ai-robot .ai-message-inner {
    max-width: calc(100% - 80px);
}
#ai-history .ai-user .ai-message-inner {
    background: #43ac33;
    color: #FFF;margin-left: auto; 
    margin-right: 5px;
}
#ai-history::-webkit-scrollbar {
    width: 5px;
}
#ai-history::-webkit-scrollbar-thumb {
    background: #636363;
}
#ai-history::-webkit-scrollbar-thumb:hover {
    background: #212121;
}
#ai-history .temp {
    color: #fff;
}
#ai-message {
    height: 50px;
    width: 100%;
    display: flex;
    justify-content: space-between;
}
#ai-message * {
    border-radius: 5px;
}
#ai-message textarea {
    height: calc(100% - 10px);
    width: calc(100% - 40px);
    border: none;
    padding: 5px;
    margin: 5px;
    margin-right: 0;
    border-bottom-left-radius: 10px;
    border-top-left-radius: 10px;
    border-bottom-right-radius: 0px;
    border-top-right-radius: 0px;
}
#ai-message a:has(i.fa-paper-plane) {
    width: 50px;
    background: #43ac33;
    margin: 5px;
    margin-left: 0;
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 0px;
    border-top-left-radius: 0px;
}
.ai-message-inner .products-cited {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-direction: column;
    padding-bottom: 1rem;
}
.ai-message-inner .products-cited > * {
    margin: 0;
}
.ai-message-inner .products-cited .added_to_cart {
    display: none;
}
.ai-message-inner .products-cited h3 {
    font-size: 0.9375rem;
    line-height: 1.35;
}
.ai-message-inner .products-cited-buttons {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.ai-message-inner .products-cited-buttons a {
    width: 100%;
}

/* Definizione dell'animazione a 8 scatti */
@keyframes fa-spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  
  /* Regole per la classe fa-spin-pulse */
  .fa-spin-pulse,
  .fa-pulse {
    animation-name: fa-spin;
    animation-delay: var(--fa-animation-delay, 0s);
    animation-direction: var(--fa-animation-direction, normal);
    animation-duration: var(--fa-animation-duration, 1s);
    animation-iteration-count: var(--fa-animation-iteration-count, infinite);
    animation-timing-function: var(--fa-animation-timing-function, steps(8));
  }