/* Chat Area */
        .chat-container {
            overflow: visible !important;
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 20px;
            overflow: hidden;
        }

        .messages-area {
            flex: 1;
            overflow-y: auto !important;
            max-height: calc(100vh - 280px); /* ✅ Soustrait header + input */
            scroll-behavior: smooth;
            padding: 15px;
            padding-bottom: 40px; /* ✅ Espace en bas */
            background: white;
            border-radius: var(--border-radius);
            margin-bottom: 15px;
        }

        .message {
            margin-bottom: 20px;
            animation: fadeIn 0.3s ease-out;
        }

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

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

        .message-bubble {
            overflow: visible !important;
            display: inline-block;
            max-width: 90%;
            padding: 15px 20px;
            border-radius: 18px;
            position: relative;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        }

        .message.user .message-bubble {
            background: linear-gradient(135deg, #3498db 0%, #3498db 100%);
            color: white;
            border-bottom-right-radius: 4px;
        }

        .message.assistant .message-bubble {
            background: #f1f3f5;
            color: #333;
            border-bottom-left-radius: 4px;
        }

        /* Styles pour le Markdown dans les messages */
        .message-bubble h1, .message-bubble h2, .message-bubble h3 {
            margin-top: 15px;
            margin-bottom: 10px;
            color: #2c3e50;
        }

        .message-bubble ul, .message-bubble ol {
            margin: 10px 0;
            padding-left: 20px;
        }

        .message-bubble pre {
            background: #f6f8fa;
            padding: 10px;
            border-radius: 5px;
            overflow-x: auto;
            margin: 10px 0;
        }

        .message-bubble code {
            background: #f6f8fa;
            padding: 2px 4px;
            border-radius: 3px;
            font-family: 'Courier New', monospace;
        }

        .message-bubble table {
            border-collapse: collapse;
            width: 100%;
            margin: 15px 0;
            display: block;
            overflow-x: auto;
            white-space: nowrap;
        }

        @media (max-width: 768px) {
            .message-bubble table {
                font-size: 12px;
            }
            
            .message-bubble th,
            .message-bubble td {
                padding: 5px;
                min-width: 80px;
            }
        }

        .message-bubble th, 
        .message-bubble td {
            border: 1px solid #ddd;
            padding: 10px;
            text-align: left;
            min-width: 100px;
            word-wrap: break-word;
            word-break: break-word;
        }

        .message-bubble th {
            background: #f0f4f8;
            font-weight: bold;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .message-bubble tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        /* Empêcher le débordement du texte */
        .message-bubble {
            overflow-x: auto;
            word-wrap: break-word;
        }

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

        .message-metadata {
            margin-top: 10px;
        }