/**
 * Fichier CSS Front-end pour WP BTB AI Chatbot
 * (Basé sur front.css de PrestaShop)
 */

/* Styles pour la fenêtre de chat en front-office */
#prestashopchat-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 50px;
    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: 35px;
}

/* Sortir le conteneur du parent caché */
body > #prestashopchat-container,
html > #prestashopchat-container {
    display: flex !important;
}


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

#prestashopchat-header {
    display: flex;
    align-items: center;
    padding: 5px 5px;
    background-color: #1ca156;
    color: white;
}

#prestashopchat-title {
    flex: 1;
    font-weight: bold;
}

#prestashopchat-toggle {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 5px; /* Ajout d'un peu de padding */
}

#prestashopchat-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

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

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

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

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

.prestashopchat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

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

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

.prestashopchat-agent-message {
    background-color: #dfdfdf;
    color: #333;
    align-self: flex-start;
}

.prestashopchat-loading span {
    display: inline-block;
    animation: dot 1.4s infinite;
}

.prestashopchat-loading span:nth-child(2) {
    animation-delay: 0.2s;
}

.prestashopchat-loading span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot {
    0%, 20% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@media (max-width: 600px) {
    #prestashopchat-container {
        width: 12%;
        right: 5%;
        bottom: 10px;
    }
}

/* --- AJOUTS WORDPRESS --- */
/* Remplacement des Material Icons */
.chat-icon, .send-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-color: white;
}

.chat-icon {
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM6 9h12v2H6V9zm8 5H6v-2h8v2zm4-6H6V6h12v2z"/></svg>') no-repeat center / contain;
}

.send-icon {
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2 .01 7z"/></svg>') no-repeat center / contain;
}