/* Container Principal do Chat */
.ai-chat-container {
    max-width: 800px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header do Chat */
.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-chat-header-icon {
    font-size: 32px;
    line-height: 1;
}

.ai-chat-header-text h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.ai-chat-header-text p {
    margin: 4px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Área de Mensagens */
.ai-chat-messages {
    padding: 24px;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    background: #f8f9fa;
}

.ai-chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.ai-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.ai-chat-bot .ai-chat-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ai-chat-user .ai-chat-avatar {
    background: #e0e0e0;
}

.ai-chat-bubble {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
}

.ai-chat-bot .ai-chat-bubble {
    background: white;
    border: 1px solid #e0e0e0;
}

.ai-chat-user .ai-chat-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-chat-bubble p {
    margin: 0 0 8px 0;
}

.ai-chat-bubble p:last-child {
    margin-bottom: 0;
}

/* Botões CTA de Artigos */
.ai-chat-article-button {
    margin: 12px 0;
}

.ai-chat-cta-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 2px solid #667eea;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.ai-chat-cta-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.ai-chat-cta-icon {
    font-size: 24px;
}

.ai-chat-cta-title {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
}

.ai-chat-cta-arrow {
    font-size: 20px;
    font-weight: bold;
}

/* Área de Anúncios AdSense */
.ai-chat-adsense {
    margin: 16px 0;
    padding: 16px;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
}

.ai-chat-adsense-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Área de Input */
.ai-chat-input-container {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.ai-chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    transition: border-color 0.3s ease;
    max-height: 120px;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #667eea;
}

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

.ai-chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

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

/* Indicador de Digitação */
.ai-chat-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.ai-chat-typing span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Footer */
.ai-chat-footer {
    padding: 12px 24px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.ai-chat-footer small {
    color: #999;
    font-size: 12px;
}

/* Mensagem de Erro */
.ai-chat-error {
    padding: 12px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    color: #c33;
    margin: 12px 0;
}

/* Responsivo */
@media (max-width: 768px) {
    .ai-chat-container {
        margin: 20px 16px;
        border-radius: 12px;
    }
    
    .ai-chat-messages {
        max-height: 400px;
    }
    
    .ai-chat-cta-btn {
        padding: 12px 16px;
    }
    
    .ai-chat-cta-title {
        font-size: 14px;
    }
}

/* Scrollbar Customizada */
.ai-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}
