/**
 * Adaptation des styles pour le Chatbot WordPress.
 *
 * Remplacement de #prestashopchat- par #wpchatbot-
 */

/* Styles pour la fenêtre de chat en front-office */
#wpchatbot-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 70px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    background-color: #fff;
    z-index: 9999;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    height: 50px;
}

/* S'assurer que le conteneur est visible même si un thème le cache */
body > #wpchatbot-container,
html > #wpchatbot-container {
    display: flex !important;
}


#wpchatbot-container.open {
    height: 500px;
    width: 350px;
}

#wpchatbot-header {
    display: flex;
    align-items: center;
    padding: 5px 5px;
    /* La couleur verte de Prestashop */
    background-color: #1ca156; 
    color: white;
    cursor: pointer;
}

#wpchatbot-title {
    flex: 1;
    font-weight: bold;
    padding-left: 10px;
}

#wpchatbot-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0 10px;
}

#wpchatbot-body {
    flex: 1;
    display: none;
    flex-direction: column;
    height: 100%;
}

#wpchatbot-container.open #wpchatbot-body {
    display: flex;
}

#wpchatbot-chatbox {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#wpchatbot-input-container {
    padding: 10px;
    display: flex;
    border-top: 1px solid #ccc;
}

#wpchatbot-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}

#wpchatbot-send {
    padding: 8px 15px;
    background-color: #1ca156;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

#wpchatbot-send:hover {
    background-color: #1ca156;
}

/* Styles des messages */
.wpchatbot-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.wpchatbot-user-message {
    background-color: #1ca156;
    color: white;
    align-self: flex-end;
}

.wpchatbot-bot-message {
    background-color: #f1f1f1;
    color: #333;
    align-self: flex-start;
}

.wpchatbot-agent-message {
    background-color: #dfdfdf; /* Gris plus foncé pour les agents */
    color: #333;
    align-self: flex-start;
    border-left: 3px solid #337ab7; /* Une petite barre bleue pour l'agent */
}

/* Indicateur de chargement (facultatif mais utile) */
#wpchatbot-chatbox.loading::after {
    content: '...';
    align-self: center;
    color: #999;
    font-size: 2em;
    opacity: 0.5;
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}