:root {
    --primary-bg-color: #F4F4F4;
    --secondary-bg-color: #FFFFFF;
    --tertiary-bg-color: #f9f9f9;
    --wda-bg-color: #FF8727;
    --wdaover-bg-color: #E67E22;
    --positif-bg-color: #4CAF50;
    --negatif-bg-color: #F44336;
    --border-color: #DDD;
    --primary-text-color: black;
    --bot-message-bg: #E8F5E9;
    --bot-message-border: #4CQF50;
    --info-message-bg: #FCE4EC;
    --info-message-border: #F06292;
    --close-cross: #333;
    --close-cross-over: #FF0000;
    --feedback-btn-size: 1.5em;
}

body {
    font-family: Arial, sans-serif;
}

.in-iframe {
    /* Styles spécifiques lorsque chargé dans une iframe */
    background-color: var(--primary-bg-color);
    margin: 0 auto;
    max-width: 100%;
    padding: 5px;
}

.container, .image-container, .feedback-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.container, .image-container {
    flex-direction: column;
}

.image-container img {
    max-width: 145px;
    height: auto;
}

#chat-interface {
    position: relative;
    background-color: var(--secondary-bg-color);
    padding: 10px;
    width: 90%;
    /*max-width: 300px;*/
    height: auto;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#chat-interface input[type=text], #chat-interface input[type=submit] {
    width: calc(100% - 20px);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}
#chat-interface input[type=text] {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--tertiary-bg-color);
}
#chat-interface input[type=submit] {
    width: 100%;
    background-color: var(--wda-bg-color);
    color: var(--primary-text-color);
    cursor: pointer;
}
#chat-interface input[type=submit]:hover {
    background-color: var(--wdaover-bg-color);
}

#chat-response, .bot-message, .info-message, .citation-message, .attention-message {
    padding: 10px;
}
#chat-response {
    margin-top: 20px;
    background-color: var(--secondary-bg-color);
    min-height: 0;
    word-wrap: break-word;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s ease-in-out;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}
#chat-response.has-content {
    max-height: 1000px; /* Assez grand pour tout contenu */
    opacity: 1;
    min-height: 50px;
}

/* Chargement ... */
#loadingIndicator {
    display: none;
    position: absolute; /* Changez 'absolute' à 'fixed' si nécessaire */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100; /* Assurez-vous que c'est supérieur aux autres éléments de la page */
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1rem;
}

/* Réponses du Chatbot */
.responseText {
    font-family: Arial, sans-serif!important;
    font-size: 16px!important;
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}
.responseText.show {
    opacity: 1;
}
.feedback-container {
    margin-top: 10px;
}

/* Pour les réponses positives du Chatbot */
.bot-message {
    background-color: var(--bot-message-bg);
    font-size: 16px;
    color: #000000;
    border-left: 5px solid var(--bot-message-border);
}

.bot-message a {
    color: #FFFFFF;
    background-image: linear-gradient(145deg, #FF8727 0%, #FFA347 100%);
    text-decoration: none;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline;
}

.bot-message a:hover {
    background-image: linear-gradient(145deg, #E76F00 0%, #FF8727 100%);
    color: #FFFFFF;
    text-decoration: underline;
}

/* Pour les messages d'erreur ou negatives ou d'info */
.info-message {
    background-color: var(--info-message-bg);
    font-size: 16px;
    color: #000000;
    border-left: 5px solid var(--info-message-border);
}

/* Pour les citations */
.citation-message {
    background-color: #d1ecf1;
    font-size: 16px;
    color: #0c5460;
    border-left: 5px solid #3a8dad;
}

/* Pour les messages d'attention */
/* Encart */
.attention-message {
    background-color: #fff3cd;
    font-size: 16px;
    color: #856404;
    border-left: 5px solid #f0a30a;
}
/* Questions */
.clarification-question {
    font-size: 16px;
    cursor: pointer;
    color: #FFFFFF;
    background-image: linear-gradient(145deg, #FF8727 0%, #FFA347 100%);
    text-decoration: none;
    border-radius: 4px;
    padding: 2px 6px;
    display: inline;
}
.clarification-question:hover {
    background-image: linear-gradient(145deg, #E76F00 0%, #FF8727 100%);
    color: #FFFFFF;
    text-decoration: underline;
}

/* Pour la question de feedback */
.feedback-container {
    margin-top: 0px!important;
    font-size: 16px!important;
}

.feedback-question {
    margin-right: 5px;
}

.feedback-button {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: var(--feedback-btn-size);
    padding: 5px 5px;
    margin-left: 5px;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
/* Animation de transition pour adoucir le changement */
.feedback-button:hover {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.positive-feedback {
    color: green;
}
.positive-feedback:hover {
    background-color: var(--positif-bg-color);
    color: white;
}

.negative-feedback {
    color: red;
}
.negative-feedback:hover {
    background-color: var(--negatif-bg-color);
    color: white;
}

#close-chatbot {
    position: fixed;
    top: 2px;
    left: 1px;
    border: none;
    background-color: transparent;
    color: var(--close-cross);
    font-size: 24px;
    cursor: pointer;
}
#close-chatbot:hover {
    color: var(--close-cross-over);
}

@media only screen and (max-width: 600px) {
    #chat-response {
        max-height: auto;
    }
}