/**
 * 2022-2025 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 */

/* 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;
    justify-content: space-between;
    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;
}

#prestashopchat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    margin-left: auto;
}

#prestashopchat-close:hover {
    opacity: 0.8;
}

#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;
    min-height: 40px;
    max-height: 160px;
    resize: none;
    overflow-y: hidden;
    box-sizing: border-box;
    font-family: inherit;
}

#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: 800px) {
    #prestashopchat-container.open {
        width: 80%;
		height: 40%;
        right: 10px;
        bottom: 10px;
    } 
}

@media (max-height: 510px) {
    #prestashopchat-container.open {
        width: 80%;
		height: 70%;
        right: 5px;
        bottom: 5px;
    } 
}