/* --- Style Global & Lanceur --- */
.tipo-launcher-common {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #295071;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 9998;
    overflow: hidden;
}
.tipo-launcher-common img {
    width: 80%;
    height: auto;
    transition: transform 0.2s;
}
.tipo-launcher-common:hover img {
    transform: scale(1.1);
}

/* --- Conteneur Principal du Chatbot (Membres) --- */
#tipo-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 90px;
    width: 350px;
    max-width: 90%;
    height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

/* --- En-tête --- */
#tipo-chat-header {
    background-color: #295071;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
#tipo-chat-header p {
    margin: 0;
    font-weight: bold;
}
.tipo-header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}
#tipo-clear-history-btn, #tipo-close-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0.8;
    transition: opacity 0.2s, background-color 0.2s;
}
#tipo-clear-history-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}
#tipo-close-btn svg {
    width: 24px;
    height: 24px;
    color: white;
}
#tipo-clear-history-btn:hover, #tipo-close-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

/* --- Corps du Chat (Messages) --- */
#tipo-chat-body {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9f9f9;
}
.tipo-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
}
.user-message {
    background-color: #295071;
    color: white;
    margin-left: auto;
}
.bot-message {
    background-color: #e5e5e5;
    color: #333;
    align-self: flex-start;
}
.bot-message strong {
    color: #295071;
}

/* --- Boutons d'Action --- */
#tipo-action-buttons {
    padding: 0 15px 10px 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tipo-action-btn {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.tipo-action-btn:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

/* --- Pied de Page (Input) --- */
#tipo-chat-footer {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #ddd;
    gap: 10px;
    flex-shrink: 0;
}
#tipo-user-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    height: 40px;
}
#tipo-send-btn {
    background-color: #295071;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 0;
}
#tipo-send-btn svg {
    width: 20px;
    height: 20px;
    margin-left: -2px;
}
#tipo-send-btn:hover {
    background-color: #1f3c56;
}

/* --- Animation de Réflexion --- */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 8px 12px !important;
}
.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: bounce 1.2s infinite;
}
.typing-indicator span:nth-of-type(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-of-type(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* --- Fenêtre Visiteur --- */
#tipo-visitor-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    max-width: 90%;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}
#tipo-visitor-close-btn {
    color: white;
}
.tipo-visitor-body {
    padding: 25px;
    text-align: center;
}
.tipo-visitor-body h3 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-top: 0;
}
.tipo-visitor-body p {
    color: #666;
    margin-bottom: 25px;
}
.tipo-cta-button {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    margin-top: 10px;
    transition: background-color 0.2s;
    box-sizing: border-box;
}
.tipo-cta-button.primary {
    background-color: #295071;
    color: white;
}
.tipo-cta-button.primary:hover {
    background-color: #1f3c56;
}
.tipo-cta-button.secondary {
    background-color: #e5e7eb;
    color: #1f2937;
}
.tipo-cta-button.secondary:hover {
    background-color: #d1d5db;
}

/* --- Responsive : Correction pour les mobiles --- */
@media (max-width: 768px) {
    #tipo-chatbot-container, #tipo-visitor-container {
        bottom: 90px;
        right: 20px;
        width: calc(100% - 40px);
        height: 70vh;
    }
}
/* --- Style pour le bouton Copier --- */

/* On s'assure que le conteneur du message peut positionner l'icône */
.tipo-message {
    position: relative;
}

/* Style de l'icône "copier" */
.tipo-copy-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    cursor: pointer;
    opacity: 0; /* Caché par défaut */
    transition: opacity 0.2s ease-in-out;
    background-color: #f0f0f0;
    border-radius: 5px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* L'icône apparaît quand on survole le message de l'assistant */
.tipo-message.assistant:hover .tipo-copy-btn {
    opacity: 0.7;
}

/* L'icône devient plus visible quand on la survole directement */
.tipo-copy-btn:hover {
    opacity: 1;
    background-color: #e0e0e0;
}

/* Style de l'icône SVG à l'intérieur du bouton */
.tipo-copy-btn svg {
    color: #333;
}