/* Widget de Chat Madi-Plan */

.madi-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    border-radius: 8px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    background: white;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    flex-direction: column;
}

.madi-chat-widget.minimized {
    width: auto;
    height: auto;
}

.madi-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.madi-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.madi-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.madi-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

.madi-message {
    margin-bottom: 15px;
    display: flex;
    animation: slideIn 0.3s ease;
}

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

.madi-message.user {
    justify-content: flex-end;
}

.madi-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
}

.madi-message.bot .madi-message-content {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.madi-message.user .madi-message-content {
    background: #667eea;
    color: white;
}

.madi-chat-input {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.madi-chat-input input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.madi-chat-input input:focus {
    border-color: #667eea;
}

.madi-chat-input button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.madi-chat-input button:hover {
    background: #764ba2;
}

/* Responsive */
@media (max-width: 480px) {
    .madi-chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .madi-chat-header {
        border-radius: 0;
    }
    
    .madi-message-content {
        max-width: 85%;
    }
}
