/*
.bibliobot-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #215baa;
    color: #fff;
    border: none;
    font-size: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 9999;
    cursor: pointer;
}
.bibliobot-window {
    position: fixed;
    bottom: 100px;
    right: 32px;
    width: 340px;
    max-height: 60vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.20);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}
.bibliobot-header {
    padding: 10px 14px;
    background: #215baa;
    color: #fff;
    font-weight: bold;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#bibliobot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f9f9fa;
    font-size: 1rem;
    min-height: 80px;
    max-height: 32vh;
}
.user-msg { margin: 6px 0 6px 30%; text-align: right; color: #215baa; }
.bot-msg { margin: 6px 30% 6px 0; text-align: left; color: #222; }
#bibliobot-form { display: flex; border-top: 1px solid #ddd; background: #fff; }
#bibliobot-input { flex: 1; padding: 8px; border: none; border-radius: 0 0 0 12px; }
#bibliobot-form button { padding: 8px 16px; background: #215baa; color: #fff; border: none; border-radius: 0 0 12px 0; }
#bibliobot-close { cursor: pointer; font-size: 1.3rem; }*/



#bibliobot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: #ffffff;
    border: 2px solid #444;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    font-family: "Segoe UI", sans-serif;
    z-index: 9999;
    overflow: hidden;
}

#bibliobot-header {
    background: linear-gradient(90deg, #3f51b5, #5c6bc0);
    color: white;
    padding: 12px;
    font-weight: bold;
    text-align: center;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px 12px 0 0;
}

#bibliobot-body {
    padding: 10px;
}

#bibliobot-messages {
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.user-msg {
    text-align: right;
    margin: 5px;
    color: #007bff;
    font-style: italic;
}

.bot-msg {
    text-align: left;
    margin: 5px;
    color: #333;
    background: #f0f0f0;
    padding: 6px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 5px;
}

#bibliobot-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}


.chatbot-result-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background-color: #f9f9f9;
    width: 100%;
}
.chatbot-result-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.chatbot-result-meta div {
    margin-bottom: 4px;
}
.chatbot-summary {
    margin-bottom: 16px;
    font-size: 1.2rem;
}
.chatbot-debug {
    margin-top: 24px;
    font-size: 0.9rem;
    color: #555;
}

/* Refonte */

.chatbot-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
}

/* Étape 1 - Configuration avec questions et bouton rond */
.chat-button-container {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.question-bubble {
    background: #4169E1;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(65, 105, 225, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
    /*max-width: 200px;*/
}

.question-bubble:hover {
    background: #3557D1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.4);
}

.chat-round-button {
    width: 56px;
    height: 56px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.chat-round-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chat-round-icon {
    font-size: 24px;
}

.close-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4444;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Étape 2 - Fenêtre RGPD */
.chat-window {
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 30rem;
    height: 40rem;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-window.show {
    display: flex;
    animation: slideUp 0.3s ease;
}

/* Étape 3 - Fenêtre agrandie */
.chat-window.expanded {
    width: 75rem;
    height: 50rem;
}

.chat-header {
    background: #4169E1;
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    width: 32px;
    height: 32px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4169E1;
    font-size: 14px;
    font-weight: bold;
}

.header-title {
    font-size: 16px;
    font-weight: 500;
}

.header-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.content-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.content-text {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 16px;
}

.chat-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

.footer-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refuse {
    background: white;
    color: #4169E1;
    border: 2px solid #4169E1;
}

.btn-refuse:hover {
    background: #f8f9ff;
}

.btn-accept {
    background: #4169E1;
    color: white;
}

.btn-accept:hover {
    background: #3557D1;
}

.hidden {
    display: none !important;
}

/* Chat conversation dans l'étape 3 */
.chat-conversation {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message,.message-user {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.message-user {
    flex-direction: row-reverse;
}

.message-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 70%;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user .message-bubble {
    background: #4169E1;
    color: white;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4169E1;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #ddd;
    color: #666;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
}

.chat-input:focus {
    border-color: #4169E1;
}

.quick-action-btn {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 15px;
    padding: 4px 8px;
    margin: 0 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: #2196f3;
    color: white;
}

.context-indicator {
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 0 8px 8px 0;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.typing-indicator {
    display: inline-flex;
    gap: 2px;
    margin-right: 8px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Style pour les messages d'erreur avec boutons */
.message-bubble button {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 15px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.message-bubble button:hover {
    background: #2196f3;
    color: white;
}