/* Reset base e variabili */
:root {
    --bellatrix-primary: #d10911;
    --bellatrix-secondary: #f5f5f5;
    --bellatrix-text: #333333;
    --bellatrix-border-radius: 15px;
    --bellatrix-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --bellatrix-user-message-bg: #ffd0d2;
    --bellatrix-user-message-text: #000000;
    --bellatrix-bot-message-bg: #9b070d;
    --bellatrix-bot-message-text: #ffffff;
}

/* FAB (Floating Action Button) */
.bellatrix-ai-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    background-color: var(--bellatrix-primary);
    box-shadow: var(--bellatrix-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
}

.bellatrix-ai-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.bellatrix-ai-fab-icon {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Finestra di Chat */
.bellatrix-ai-chat-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 390px;
    height: 600px;
    max-height: 70vh;
    background-color: #ffffff;
    border-radius: var(--bellatrix-border-radius);
    box-shadow: var(--bellatrix-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
}

/* Header della Chat */
.bellatrix-ai-chat-header {
    background-color: var(--bellatrix-primary);
    color: #ffffff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bellatrix-ai-chat-title {
    font-weight: bold;
    font-size: 16px;
}

.bellatrix-ai-chat-close {
    cursor: pointer;
    font-size: 18px;
}

/* Corpo della Chat */
.bellatrix-ai-chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}

/* Area Input */
.bellatrix-ai-chat-input-container {
    padding: 15px;
    border-top: 1px solid #eaeaea;
    background-color: #ffffff;
    display: flex;
    align-items: center;
}

.bellatrix-ai-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    height: 40px;
    max-height: 100px;
    outline: none;
}

.bellatrix-ai-send {
    margin-left: 10px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bellatrix-primary);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.bellatrix-ai-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Messaggi */
.bellatrix-ai-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bellatrix-ai-message {
    max-width: 80%;
    padding: 12px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.bellatrix-ai-user-message {
    align-self: flex-end;
    background-color: var(--bellatrix-user-message-bg);
    color: var(--bellatrix-user-message-text);
    border-bottom-right-radius: 5px;
}

.bellatrix-ai-bot-message {
    align-self: flex-start;
    background-color: var(--bellatrix-bot-message-bg);
    color: var(--bellatrix-bot-message-text);
    border-bottom-left-radius: 5px;
}

.bellatrix-ai-system-message {
    align-self: center;
    background-color: var(--bellatrix-bot-message-bg);
    color: var(--bellatrix-bot-message-text);;
    border-radius: 10px;
}

.bellatrix-ai-system-message a,
.bellatrix-ai-bot-message a,
.bellatrix-ai-user-message a {
    color: #ffffff;
    text-decoration: underline;
}

.bellatrix-ai-system-message a:hover,
.bellatrix-ai-bot-message a:hover,
.bellatrix-ai-user-message a:hover {
    color: #ffffff;
}

.bellatrix-ai-bot-message .bellatrix-ai-bot-avatar {
    height: 48px;
    width: 48px;
    border-radius: 100%;
    margin: 0 0 6px 0;
    display: block;
}

img.bellatrix-ai-bot-avatar {
    width: 100%;
}

/* Form di Login */
.bellatrix-ai-login-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 360px;
    background-color: #ffffff;
    border-radius: var(--bellatrix-border-radius);
    box-shadow: var(--bellatrix-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
}

.bellatrix-ai-login-body {
    padding: 20px;
}

.bellatrix-ai-login-form-error-message {
    color: red;
    font-size: 14px;
    margin-top: 5px;
}

.bellatrix-ai-form-group {
    margin-bottom: 15px;
}

.bellatrix-ai-form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--bellatrix-text);
}

.bellatrix-ai-input-field {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

.bellatrix-ai-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.bellatrix-ai-login-button {
    width: 100%;
    padding: 12px;
    background-color: var(--bellatrix-primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

/* Overlay Termini e Privacy */
.bellatrix-ai-terms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.bellatrix-ai-terms-container {
    background-color: #ffffff;
    border-radius: var(--bellatrix-border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bellatrix-ai-terms-header {
    padding: 15px;
    border-bottom: 1px solid #eaeaea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bellatrix-ai-terms-content {
    padding: 20px;
    overflow-y: auto;
    max-height: 50vh;
}

.bellatrix-ai-terms-footer {
    padding: 15px;
    border-top: 1px solid #eaeaea;
    text-align: right;
}

.bellatrix-ai-button {
    padding: 8px 15px;
    background-color: var(--bellatrix-primary);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.bellatrix-ai-disclaimer {
    color: lightgray;
    font-size: 12px;
    line-height: 14px;
    padding: 0 16px 8px;
}

.bellatrix-ai-input {
    overflow: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bellatrix-ai-input::-webkit-scrollbar {
  display: none;
}



/* Media Query per dispositivi mobili */
@media (max-width: 768px) {
    .bellatrix-ai-chat-container,
    .bellatrix-ai-login-container {
        width: 100%;
        height: 90%;
        max-height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .bellatrix-ai-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}

/* Loading spinner */
.spinner {
    margin: 100px auto 0;
    width: 70px;
    text-align: center;
}

.spinner > div {
    width: 12px;
    height: 12px;
    background-color: #757575;

    border-radius: 100%;
    display: inline-block;
    -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}

.spinner .bounce1 {
    -webkit-animation-delay: -0.32s;
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    -webkit-animation-delay: -0.16s;
    animation-delay: -0.16s;
}

@-webkit-keyframes sk-bouncedelay {
    0%,
    80%,
    100% {
        -webkit-transform: scale(0);
    }
    40% {
        -webkit-transform: scale(1);
    }
}

@keyframes sk-bouncedelay {
    0%,
    80%,
    100% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }
    40% {
        -webkit-transform: scale(1);
        transform: scale(1);
    }
}
