/* ========================================
   CHAT ASSISTENTE IA - CLÍNICA COLUNA IDEAL
   ======================================== */

/* Botão Flutuante - Container */
.smart-chat-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Botão WhatsApp */
.whatsapp-btn.smart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #25d366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.whatsapp-btn.smart-btn:hover {
    background-color: #20ba5a;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

.whatsapp-btn.smart-btn i {
    font-size: 28px;
}

.whatsapp-btn.smart-btn .btn-text {
    display: none;
}

/* Botão Assistente IA */
.ai-btn.smart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5FA8A6 0%, #877048 100%);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(95, 168, 166, 0.4);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.ai-btn.smart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(95, 168, 166, 0.5);
}

.ai-btn.smart-btn i {
    font-size: 28px;
}

.ai-btn.smart-btn .btn-text {
    display: none;
}

/* Modal do Chat */
.chat-modal {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Ubuntu', sans-serif;
}

/* Header do Chat */
.chat-header {
    background: linear-gradient(135deg, #5FA8A6 0%, #877048 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.chat-title i {
    font-size: 20px;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-chat:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Área de Mensagens */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #5FA8A6;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #877048;
}

/* Mensagens */
.message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
}

.bot-message {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, #5FA8A6 0%, #877048 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-time {
    font-size: 10px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

.bot-message .message-time {
    text-align: left;
}

/* Indicador de Digitação */
.typing-indicator {
    opacity: 0.7;
}

.typing-indicator .message-content {
    background: #e0e0e0;
    color: #666;
}

/* Input do Chat */
.chat-input {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Ubuntu', sans-serif;
}

.chat-input input:focus {
    border-color: #5FA8A6;
}

.chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5FA8A6 0%, #877048 100%);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-input button:hover {
    transform: scale(1.1);
}

.chat-input button:active {
    transform: scale(0.95);
}

.chat-input button i {
    font-size: 18px;
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .chat-modal {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
        border-radius: 12px;
    }
    
    .smart-chat-float {
        right: 15px;
        bottom: 15px;
    }
    
    .whatsapp-btn.smart-btn,
    .ai-btn.smart-btn {
        width: 56px;
        height: 56px;
    }
    
    .whatsapp-btn.smart-btn i,
    .ai-btn.smart-btn i {
        font-size: 24px;
    }
}

/* Animações */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-modal[style*="flex"] {
    animation: slideIn 0.3s ease;
}

/* Ajustes para compatibilidade com botão WhatsApp existente */
.absolute-footer {
    z-index: 9998; /* Abaixo do chat assistant */
}

.smart-chat-float {
    z-index: 9999; /* Acima do botão WhatsApp existente */
}

