/* =========================
   Chatbot Widget - CSS
   ========================= */

.chatbot-widget {
    position: fixed;       /* toujours à l'écran */
    bottom: 20px;          /* décalage depuis le bas */
    right: 20px;           /* décalage depuis la droite */
    z-index: 99999;        /* très élevé pour passer au-dessus de tout */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Bouton déclencheur */
.chatbot-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-color, #667eea);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100000;
}

.chatbot-trigger:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.chatbot-icon {
    font-size: 28px;
    display: block;
}

.chatbot-close-icon {
    font-size: 24px;
    display: none;
    color: white;
}

.chatbot-trigger.active .chatbot-icon {
    display: none;
}

.chatbot-trigger.active .chatbot-close-icon {
    display: block;
}

/* Fenêtre du chatbot */
.chatbot-window {
    position: absolute;      /* par rapport au widget */
    bottom: 70px;            /* juste au-dessus du trigger */
    right: 0;
    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);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100000;
    transition: all 0.3s ease;
}

/* Header */
.chatbot-header {
    background: var(--chatbot-color, #667eea);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    font-size: 32px;
}

.chatbot-title {
    font-size: 18px;
    font-weight: 600;
}

.chatbot-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

/* Bouton minimiser */
.chatbot-minimize {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-minimize:hover {
    background: rgba(255,255,255,0.3);
}

/* Body / messages */
.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chatbot-message {
    margin-bottom: 16px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-bubble {
    background: white;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 85%;
    line-height: 1.5;
}

/* Options / boutons */
.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.chatbot-option {
    background: white;
    border: 2px solid var(--chatbot-color, #667eea);
    color: var(--chatbot-color, #667eea);
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
}

.chatbot-option:hover {
    background: var(--chatbot-color, #667eea);
    color: white;
    transform: translateX(4px);
}

/* Bouton retour */
.chatbot-back {
    border-color: #6c757d;
    color: #6c757d;
}

.chatbot-back:hover {
    background: #6c757d;
    color: white;
}

/* Footer / reset */
.chatbot-footer {
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
}

.chatbot-reset {
    width: 100%;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.chatbot-reset:hover {
    background: #e9ecef;
}

/* Loader / erreurs */
.chatbot-loader {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.chatbot-error {
    background: #fee;
    color: #c00;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
    .chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
    }
}
