* {
    box-sizing: border-box;
}

.lucrezia-chatbot-floating-wrapper {
    position: fixed;
    z-index: 999999;
}

.lucrezia-chatbot-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.lucrezia-chatbot-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.lucrezia-chatbot-toggle-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0066cc;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000000;
}

.lucrezia-chatbot-toggle-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.lucrezia-chatbot-container {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.lucrezia-chatbot-floating {
    position: fixed;
    z-index: 999998;
}

.lucrezia-chatbot-position-bottom-right .lucrezia-chatbot-floating {
    bottom: 90px;
    right: 20px;
}

.lucrezia-chatbot-position-bottom-left .lucrezia-chatbot-floating {
    bottom: 90px;
    left: 20px;
}

.lucrezia-chatbot-inline {
    position: relative;
    margin: 20px auto;
}

.lucrezia-chatbot-header {
    background-color: #0066cc;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
}

.lucrezia-chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lucrezia-chatbot-avatar-header {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.lucrezia-chatbot-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lucrezia-chatbot-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.lucrezia-chatbot-subtitle {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.9;
    line-height: 1.2;
}

.lucrezia-chatbot-close-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.lucrezia-chatbot-close-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.lucrezia-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.lucrezia-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.lucrezia-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.lucrezia-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.lucrezia-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.lucrezia-chatbot-message {
    display: flex;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lucrezia-chatbot-message-user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.lucrezia-chatbot-message-bot {
    flex-direction: row;
    justify-content: flex-start;
}

.lucrezia-chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lucrezia-chatbot-message-content {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.lucrezia-chatbot-message-user .lucrezia-chatbot-message-content {
    align-items: flex-end;
}

.lucrezia-chatbot-message-bot .lucrezia-chatbot-message-content {
    align-items: flex-start;
}

.lucrezia-chatbot-message-text {
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
}

.lucrezia-chatbot-message-user .lucrezia-chatbot-message-text {
    background-color: #0066cc;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.lucrezia-chatbot-message-bot .lucrezia-chatbot-message-text {
    background-color: #f5f5f5;
    color: #1a1a1a;
    border: none;
    border-bottom-left-radius: 4px;
}

.lucrezia-chatbot-message-error .lucrezia-chatbot-message-text {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.lucrezia-chatbot-message-text p {
    margin: 0 0 8px 0;
}

.lucrezia-chatbot-message-text p:last-child {
    margin-bottom: 0;
}

.lucrezia-chatbot-message-text ul,
.lucrezia-chatbot-message-text ol {
    margin: 8px 0;
    padding-left: 24px;
}

.lucrezia-chatbot-message-text li {
    margin: 4px 0;
}

.lucrezia-chatbot-message-text code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.lucrezia-chatbot-message-text pre {
    background-color: #282c34;
    color: #abb2bf;
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.lucrezia-chatbot-message-text pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.lucrezia-chatbot-message-text a {
    color: #0066cc;
    text-decoration: underline;
}

.lucrezia-chatbot-message-user .lucrezia-chatbot-message-text a {
    color: white;
}

.lucrezia-chatbot-message-time {
    font-size: 11px;
    color: #999;
    padding: 0 4px;
}

.lucrezia-chatbot-message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.lucrezia-chatbot-message-content:hover .lucrezia-chatbot-message-actions {
    opacity: 1;
}

.lucrezia-chatbot-feedback-button,
.lucrezia-chatbot-copy-button {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
}

.lucrezia-chatbot-feedback-button:hover,
.lucrezia-chatbot-copy-button:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

.lucrezia-chatbot-feedback-button.active {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #4caf50;
}

.lucrezia-chatbot-feedback-button.active-negative {
    background-color: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.lucrezia-chatbot-typing-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 20px;
    animation: slideIn 0.3s ease;
}

.lucrezia-chatbot-typing-content {
    background-color: #f0f0f0;
    border-radius: 16px;
    padding: 12px 16px;
    max-width: 75%;
}

.lucrezia-chatbot-typing-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.lucrezia-chatbot-typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lucrezia-chatbot-typing-dots span {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.lucrezia-chatbot-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.lucrezia-chatbot-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.lucrezia-avatar-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.lucrezia-chatbot-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e5e5;
}

.lucrezia-chatbot-input-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.lucrezia-chatbot-input {
    flex: 1;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 48px;
    overflow-y: auto;
    transition: all 0.2s;
    background-color: #fafafa;
}

.lucrezia-chatbot-input:focus {
    border-color: #c0c0c0;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.lucrezia-chatbot-disclaimer {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 0 4px;
    line-height: 1.4;
}

.lucrezia-chatbot-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.lucrezia-chatbot-send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #0066cc;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.lucrezia-chatbot-send-button:hover:not(:disabled) {
    background-color: #0052a3;
    transform: scale(1.05);
}

.lucrezia-chatbot-send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.lucrezia-chatbot-footer {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
}

.lucrezia-chatbot-export-button {
    background: none;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.lucrezia-chatbot-export-button:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
}

@media (max-width: 768px) {
    .lucrezia-chatbot-floating-wrapper {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .lucrezia-chatbot-position-bottom-right,
    .lucrezia-chatbot-position-bottom-left {
        bottom: 10px;
        right: 10px;
        left: auto;
    }
    
    .lucrezia-chatbot-floating {
        width: 100% !important;
        max-width: calc(100vw - 20px);
        height: 80vh !important;
        max-height: 600px;
    }
    
    .lucrezia-chatbot-position-bottom-right .lucrezia-chatbot-floating,
    .lucrezia-chatbot-position-bottom-left .lucrezia-chatbot-floating {
        bottom: 80px;
        right: 10px;
        left: 10px;
    }
    
    .lucrezia-chatbot-inline {
        width: 100% !important;
        height: 80vh !important;
        max-height: 600px;
        margin: 10px 0;
    }
    
    .lucrezia-chatbot-message-content {
        max-width: 85%;
    }
    
    .lucrezia-chatbot-message-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .lucrezia-chatbot-toggle-button {
        width: 50px;
        height: 50px;
    }
    
    .lucrezia-chatbot-header {
        padding: 12px 16px;
    }
    
    .lucrezia-chatbot-title {
        font-size: 14px;
    }
    
    .lucrezia-chatbot-messages {
        padding: 16px;
        gap: 12px;
    }
    
    .lucrezia-chatbot-input-wrapper {
        padding: 12px 16px;
        gap: 8px;
    }
    
    .lucrezia-chatbot-input {
        font-size: 13px;
        padding: 10px 14px;
    }
    
    .lucrezia-chatbot-send-button {
        width: 40px;
        height: 40px;
    }
}

.et_pb_section .lucrezia-chatbot-container,
.et_pb_row .lucrezia-chatbot-container,
.et-l .lucrezia-chatbot-container {
    box-sizing: border-box !important;
}

.et_pb_section .lucrezia-chatbot-container *,
.et_pb_row .lucrezia-chatbot-container *,
.et-l .lucrezia-chatbot-container * {
    box-sizing: border-box !important;
}

.lucrezia-chatbot-container h1,
.lucrezia-chatbot-container h2,
.lucrezia-chatbot-container h3,
.lucrezia-chatbot-container h4,
.lucrezia-chatbot-container h5,
.lucrezia-chatbot-container h6 {
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.lucrezia-chatbot-container blockquote {
    border-left: 4px solid #ddd;
    padding-left: 12px;
    margin: 8px 0;
    color: #666;
    font-style: italic;
}
