/* AI Chatbot Styles */
#ai-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#ai-chatbot-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    overflow: hidden;
}

#ai-chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

#ai-chatbot-toggle .chatbot-iso {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

#ai-chatbot-toggle:hover .chatbot-iso {
    transform: scale(1.1);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transform: scale(1);
    }
}

/* Classe para controlar quando o pulso deve parar */
#ai-chatbot-toggle.no-pulse {
    animation: none;
}

#ai-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

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

#ai-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#ai-chatbot-header .header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

#ai-chatbot-header .header-iso {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

#ai-chatbot-header .header-tipography {
    height: 35px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

#ai-chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

#ai-chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#ai-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

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

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

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 5px;
}

.message.bot .message-content {
    background: white;
    color: #333;
    border: 1px solid #e1e5e9;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.message.user .message-time {
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

#ai-chatbot-input {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#ai-chatbot-message {
    flex: 1;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
    max-height: 80px;
    min-height: 40px;
}

#ai-chatbot-message:focus {
    border-color: #667eea;
}

#ai-chatbot-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    min-width: 40px;
}

#ai-chatbot-send svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

#ai-chatbot-send:hover {
    transform: scale(1.1);
}

#ai-chatbot-send:hover svg {
    transform: translateX(2px);
}

#ai-chatbot-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

#ai-chatbot-send:disabled svg {
    transform: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.error-message {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 10px;
    margin: 10px 0;
    font-size: 13px;
}

/* Responsive Design */
@media (max-width: 480px) {
    #ai-chatbot-window {
        width: calc(100vw - 40px);
        right: -10px;
        height: 60vh;
    }
    
    #ai-chatbot-container {
        bottom: 10px;
        right: 10px;
    }
    
    #ai-chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    
    #ai-chatbot-toggle span {
        font-size: 20px;
    }
}

/* Scrollbar customization */
#ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#ai-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

