/* Variables pour le mode clair (par défaut) */
:root {
    --primary-color: #570047;
    --primary-color-hover: #760063;
    --background-color: #ffffff;
    --text-color: #333;
    --user-message-bg: var(--primary-color);
    --user-message-text: #ffffff;
    --bot-message-bg: #e0e0e0;
    --bot-message-text: var(--text-color);
    --input-bg: #f7f7f8;
    --input-border: #ddd;
    --card-bg: var(--background-color);
    --card-header-bg: var(--primary-color);
    --card-header-text: #ffffff;
    --card-footer-bg: #f8f9fa;
    --slider-bg: #f8f9fa;
    --slider-thumb-bg: var(--bot-message-bg);
    --slider-thumb-hover-bg: #e8e8e8;
    --user-input-text: var(--text-color);
    --input-group-text: #737373;


    --body-bg: #f0f2f5;
}
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}
/* Mode sombre */
.dark-mode {
    --primary-color: #1d1f21;
    --primary-color-hover: #282a2e;
    --background-color: #2c2f33;
    --text-color: #f0f0f0;
    --user-message-bg: var(--primary-color);
    --user-message-text: #ffffff;
    --bot-message-bg: #646464;
    --bot-message-text: #f0f0f0;
    --input-bg: #3c3f41;
    --input-border: #555;
    --card-bg: #2c2f33;
    --card-header-bg: #1d1f21;
    --card-header-text: #ffffff;
    --card-footer-bg: #323435;
    --slider-bg: #333538;
    --slider-thumb-bg: var(--bot-message-bg);
    --slider-thumb-hover-bg: #585858;
    --user-input-text: var(--text-color);
    --input-group-text: #737373;


    --body-bg: #1c1c1c;
}

/* Conteneur principal du chatbot */
.chatbot-card {
    width: 100%;
    max-width: 400px;
    border-radius: 15px;
    overflow: hidden;
    background-color: var(--card-bg);
    transition: background-color 0.3s ease, color 0.3s ease;

}

/* Style pour les messages */
.chatbot-messages {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
    scroll-behavior: smooth;
}

/* Scrollbar personnalisée */
.chatbot-messages::-webkit-scrollbar {
    width: 12px; /* Augmente la largeur de la scrollbar pour Chrome et Brave */
    height: 12px; /* Ajuste la hauteur de la scrollbar */

}

.chatbot-messages::-webkit-scrollbar-track {
    background: var(--slider-bg) !important; /* Couleur de l'arrière-plan de la scrollbar */
    border-radius: 10px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: var(--slider-thumb-bg) !important; /* Couleur du pouce de la scrollbar */
    border-radius: 10px;
    border: 3px solid var(--slider-bg) !important; /* Ajoute un contour pour une séparation visuelle */
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background-color: var(--slider-thumb-hover-bg) !important; /* Change la couleur lors du survol */
}

/* Scrollbar pour Firefox */
.chatbot-messages {
    scrollbar-width: auto; /* Largeur de la scrollbar sur Firefox */
    scrollbar-color: var(--slider-thumb-bg) var(--slider-bg) !important; /* Couleur de la scrollbar sur Firefox */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.chatbot-messages:hover {
    scrollbar-color: var(--slider-thumb-hover-bg) var(--slider-bg) !important; /* Changement de couleur au survol dans Firefox */
}

/* Autres styles de messages */
.message {
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: inline-block;
    max-width: 80%;
    word-wrap: break-word;
    margin: 5px 0;
}

/* Message de l'utilisateur */
.user-message {
    background-color: var(--user-message-bg);
    color: var(--user-message-text);
    align-self: flex-end;
    text-align: left;
    margin-left: auto;
    margin-right: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Message du bot */
.bot-message {
    background-color: var(--bot-message-bg);
    color: var(--bot-message-text);
    align-self: flex-start;
    text-align: left;
    margin-left: 0;
    margin-right: auto;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Style pour la barre d'entrée */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--input-border);
    border-radius: 25px;
    padding: 5px 10px;
    background-color: var(--input-bg);
    box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;


}
::placeholder {
    color: var(--input-group-text) !important;
    opacity: 1; /* Firefox */
    transition: background-color 0.3s ease, color 0.3s ease;
}
/* Champ de texte */
#userInput {
    flex: 1;
    border: none;
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 14px;
    background-color: transparent;
    outline: none;
    box-shadow: none;
    color: var(--user-input-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Style du bouton envoyer dans un cercle */
#sendButton {
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 16px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s, box-shadow 0.3s;
}

/* Ajustement de l'icône */
#sendButton i {
    font-size: 16px;
    margin: 0;
}

/* Effet de survol (hover) */
#sendButton:hover {
    background-color: var(--primary-color-hover);
}

/* Effet au clic */
#sendButton:active {
    transform: scale(0.95);
}

/* Suppression du focus outline et du box-shadow */
#userInput:focus,
#sendButton:focus {
    outline: none;
    box-shadow: none;
}

/* Styles pour le conteneur de la carte */
.card-header {
    background-color: var(--card-header-bg) !important;
    color: var(--card-header-text);
    border-bottom: none;
    padding: 15px;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Style du footer */
.card-footer {
    background-color: var(--card-footer-bg) !important;/* Utiliser la couleur du mode clair ou sombre */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.card {
    border: none;
    border-radius: 15px;
}

/* Style du body */
body {
    background-color: var(--body-bg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Bulle pour les trois points */
.message.typing {
    background-color: var(--bot-message-bg);
    color: var(--bot-message-text);
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: fit-content;
    word-wrap: break-word;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Animation des trois points */
.typing .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: var(--bot-message-text);
    border-radius: 50%;
    opacity: 0;
    animation: blink 1.4s infinite both;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.typing .dot:nth-child(1) {
    animation-delay: 0.2s;
}
.typing .dot:nth-child(2) {
    animation-delay: 0.4s;
}
.typing .dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes blink {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Style pour le bouton de bascule du mode sombre */
.btn-toggle-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000; /* S'assure que le bouton est au-dessus de tout le reste */
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s;
}

.btn-toggle-mode:hover {
    background-color: var(--primary-color-hover);
}

.btn-toggle-mode:active {
    transform: scale(0.95);
}

/* Ajustement de l'icône dans le bouton */
#darkModeIcon {
    font-size: 18px;
}

/* Désactiver les changements de couleur sur l'icône au survol */
.btn-toggle-mode:hover #darkModeIcon {
    color: white; /* Force la couleur de l'icône à rester blanche au survol */
}

