body {
    font-family: Arial, sans-serif;/*'Segoe UI', 'Helvetica Neue', */
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Style du bouton de chat */
.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4285f4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-button:hover {
    background-color: #3367d6;
    transform: scale(1.05);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ea4335;
    color: white;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.notification-badge.active {
    opacity: 1;
}

/* Style de l'icône */
.chat-icon {
    font-size: 24px;
}

/* Style de la fenêtre de chat */
.chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    transition: all 0.3s ease;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* En-tête de la fenêtre de chat */
.chat-header {
    background-color: #4285f4;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
}

.chat-header-info {
    display: flex;
    align-items: center;
}
/*
.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}*/

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #25D366; /* Vert WhatsApp pour cohérence */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    /* Icône SVG d'agent avec casque */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/><path d="M18 16.08c-.76 0-1.44.3-1.96.77L13.5 15.5v-2h5v2.58z"/></svg>');
    background-size: 24px 24px;
    background-repeat: no-repeat;
    background-position: center;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
}

.chat-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    margin-top: 3px;
    display: flex;
   Align-items: center;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0f0;
    margin-right: 5px;
}

.chat-header-actions {
    display: flex;
}

.header-button {
    background: none;
    border: none;
    color: white;
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.header-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Zone des messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background-color: #f8f9fa;
}

.message-container {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.user-container {
    align-self: flex-end;
}

.bot-container {
    align-self: flex-start;
}

.message {
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-message {
    background-color: #4285f4;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: white;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.7;
    align-self: flex-end;
}

.user-time {
    margin-right: 6px;
}

.bot-time {
    margin-left: 6px;
}

/* Options de réponse rapide */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.quick-reply {
    background-color: white;
    border: 1px solid #4285f4;
    color: #4285f4;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply:hover {
    background-color: #f0f7ff;
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    background-color: white;
    border-radius: 18px;
    padding: 12px 16px;
    display: none;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.typing-dots {
    display: flex;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    margin-right: 4px;
    animation: typing-dot 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-dot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Zone de saisie */
.chat-input-container {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid #e6e6e6;
    background-color: white;
    position: relative;
}

.chat-input-box {
    display: flex;
    flex: 1;
    background-color: #f1f3f4;
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    transition: background-color 0.2s;
}

.chat-input-box:focus-within {
    background-color: #e8eaed;
}

.chat-input {
    flex: 1;
    border: none;
    padding: 8px 0;
    background: none;
    outline: none;
    font-size: 14px;
    min-height: 24px;
    max-height: 120px;
    resize: none;
    font-family: inherit;
}

.chat-input::placeholder {
    color: #5f6368;
}

.chat-tools {
    display: flex;
    align-items: center;
}

.tool-button {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5f6368;
    margin-left: 4px;
    transition: background-color 0.2s;
}

.tool-button:hover {
    background-color: #e8eaed;
}

.send-button {
    background-color: #4285f4;
    color: white;
    border: none;
    width: 32px;
    height:  grandes écoles
    background-color: #c1d1f0;
    cursor: default;
}

.send-button:hover {
    background-color: #3367d6;
}

.send-button:disabled {
    background-color: #c1d1f0;
    cursor: default;
}

/* Feedback UI */
.message-feedback {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    align-self: flex-end;
    opacity: 0;
    transition: opacity 0.2s;
}

.bot-container:hover .message-feedback {
    opacity:1;
}

.feedback-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 12px;
    color: #5f6368;
    display: flex;
    align-items: center;
}

.feedback-button:hover {
    color: #4285f4;
}

/* Sélection de langue */
.language-selector {
    position: absolute;
    bottom: 70px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    padding: 10px;
    display: none;
    z-index: 1000;
}

.language-option {
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.language-option:hover {
    background-color: #f1f3f4;
}

/* States for minimized chat */
.chat-container.minimized {
    height: 60px;
    overflow: hidden;
}

/* Animation pour le bouton de chat */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(66, 133, 244, 0); }
    100% { box-shadow: 0 0 0 0 rgba(66, 133, 244, 0); }
}

.chat-button.pulse {
    animation: pulse 2s infinite;
}

/* FAQ accordéon */
.faq-section {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    height: 100%;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.faq-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #202124;
}

.faq-item {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.faq-question {
    padding: 12px 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #202124;
    transition: background-color 0.2s;
}

.faq-question:hover {
    background-color: #f1f3f4;
}

.faq-question::after {
    content: "+";
    font-size: 18px;
}

.faq-item.active .faq-question::after {
    content: "−";
}

.faq-answer {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 16px 16px 16px;
    max-height: 300px;
}

/* Mode nuit */
body.dark-mode {
    background-color: #202124;
    color: #e8eaed;
}

body.dark-mode .chat-container {
    background-color: #2d2e31;
}

body.dark-mode .chat-messages {
    background-color: #202124;
}

body.dark-mode .bot-message {
    background-color: #3c4043;
    color: #e8eaed;
}

body.dark-mode .chat-input-box {
    background-color: #3c4043;
}

body.dark-mode .chat-input {
    color: #e8eaed;
}

body.dark-mode .chat-input::placeholder {
    color: #9aa0a6;
}

body.dark-mode .quick-reply {
    background-color: #3c4043;
    border-color: #8ab4f8;
    color: #8ab4f8;
}

body.dark-mode .typing-indicator {
    background-color: #3c4043;
}

body.dark-mode .faq-section {
    background-color: #202124;
}

body.dark-mode .faq-item {
    background-color: #3c4043;
}

body.dark-mode .faq-question {
    color: #e8eaed;
}

/* Responsivité pour mobile */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 80%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
}

/******************************************/


/* Style pour les messages admin */
.admin-container {
    align-self: flex-start;
}

.admin-message {
    background-color: #34c759;
    color: white;
    border-bottom-left-radius: 4px;
}

.admin-time {
    margin-left: 6px;
}

.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4285f4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    transition: all 0.3s ease;
}

.quick-reply {
    background-color: #f1f3f4;
    border: 1px solid #4285f4;
    color: #4285f4;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 4px 0;
    display: block;
}

.quick-reply:hover {
    background-color: #4285f4;
    color: white;
}

.bot-message {
    white-space: pre-line; /* Pour conserver les sauts de ligne */
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    width: 315px;
}

.message {
    white-space: pre-line;
}

.feedback-button {
    /* Styles existants */
    margin: 0 2px;
}

/* Nouveau style pour le bouton de signalement */
.feedback-button[title="Signaler une erreur"] {
    color: #d32f2f;
}

.feedback-button[title="Signaler une erreur"]:hover {
    background-color: #d32f2f;
    color: white;
}

/* Style pour le formulaire de signalement */
.error-report-container {
    margin-top: 10px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-report-input {
    width: 100%;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid #e0e0e0;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 60px;
}

.error-report-button {
    align-self: flex-end;
    background-color: #25D366;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 18px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.error-report-button:hover {
    background-color: #128C7E;
}

/* Mode sombre */
body.dark-mode .error-report-input {
    background-color: #3c4043;
    color: #e8eaed;
    border-color: #5f6368;
}

.sessions-list {
    flex: 1;
    max-height: 100%;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    padding: 10px;
    background-color: #fff;
}

.session-header {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    font-weight: bold;
    padding: 8px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1;
}

.session-item {
    display: grid;
    grid-template-columns: 120px 1fr 80px;
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.session-item:hover {
    background-color: #f9f9f9;
}

.session-date {
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

.session-id {
    font-size: 0.9rem;
    color: #555;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-status {
    text-align: right;
}

.operator-badge {
    background-color: #ff9800;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.no-sessions, .error-message {
    padding: 10px;
    text-align: center;
    color: #666;
}

.error-message {
    color: #d32f2f;
}

/*********************************************
*************************************************/

/* 1. Rendez le bouton plus grand */
.chat-button {
    width: 60px;
    height: 60px;
    bottom: 25px;
    right: 25px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* 2. Changez la couleur pour quelque chose de plus vif */
.chat-button {
    background-color: #25D366; /* Couleur WhatsApp - très reconnaissable */
    /* Alternative: #FF5722 - Orange vif */
}

/* 3. Améliorez l'animation pulse */
@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
        transform: scale(1.05);
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
        transform: scale(1);
    }
}

.chat-button.pulse {
    animation: pulse 2s infinite;
}

/* 4. Rendez l'icône de chat plus visible */
.chat-icon {
    font-size: 42px;
}

/* 5. Améliorez le badge de notification */
.notification-badge {
    width: 24px;
    height: 24px;
    top: -8px;
    right: -8px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.notification-badge.active {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

/* 6. Ajoutez un effet de survol plus prononcé */
.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* 7. Animation d'apparition */
.chat-button {
    animation: appear 0.5s ease-out;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 8. Ajout d'une étiquette flottante (optionnel) */
.chat-button::before {
    content: "Assistance rapide 24h/24";
    position: absolute;
    top: -40px;
    right: 0;
    background-color: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.chat-button:hover::before {
    opacity: 1;
    transform: translateY(0);
}

/* 9. Ajoutez une bordure blanche autour du bouton */
.chat-button {
    border: 3px solid white;
}


/*********************************
MISE A JOUR
*****************************************/

.chat-button-label {
    position: fixed;
    bottom: 87px;
    right: 40px;
    background-color: rgb(37, 211, 102);
    background-color: #333;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: rgba(0, 0, 0, 0.3) 0px 4px 12px;
    z-index: 999;
    opacity: 0.9;
    pointer-events: none;
    padding: 8px 16px;
    border-radius: 20px;
    border-color: 1px #ffffff;
    transition: opacity 0.3s, transform 0.3s;
    animation: 0.5s ease-out 0s 1 normal none running slide-in;
}

/*
  @media (max-width: 450px) {
    .chat-button {
          bottom: 5px !important;
      }
    .chat-button-label {
        bottom: 65px;
    }
    body {
        line-height: 1.4 !important;
    }
  }
  
  @media (max-width: 350px) {
    .chat-button {
          bottom: 3px !important;
      }
    .chat-button-label {
        bottom: 62px;
    }
    body {
        line-height: 1.2 !important;
    }
  }*/
  

/* Solution CSS pure pour masquer le libellé pendant la saisie */

/* Transition fluide par défaut */
.chat-button-label {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 1;
    transform: translateY(0);
    pointer-events: none; /* Éviter les interférences */
}

/* Masquer le libellé quand le chat est ouvert */
.chat-container:not([style*="display: none"]) ~ .chat-button-label,
.chat-container.show ~ .chat-button-label,
.chat-container.active ~ .chat-button-label {
    opacity: 0.3;
    transform: translateY(-5px);
}

/* Masquer complètement quand l'input a le focus */
.chat-container #chatInput:focus ~ * .chat-button-label,
.chat-container .chat-input:focus ~ * .chat-button-label {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
}

/* Alternative avec les sélecteurs adjacents */
#chatInput:focus ~ .chat-button-label,
.chat-input:focus ~ .chat-button-label {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
}

/* Masquer aussi quand l'input n'est pas vide (pseudo-classe) */
.chat-container #chatInput:not(:placeholder-shown) ~ * .chat-button-label,
.chat-container .chat-input:not(:placeholder-shown) ~ * .chat-button-label {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
}

/* Si le chat-container est après le libellé dans le DOM */
.chat-button-label:has(~ .chat-container #chatInput:focus),
.chat-button-label:has(~ .chat-container .chat-input:focus) {
    opacity: 0 !important;
    transform: translateY(-10px) !important;
}

/* Fallback pour navigateurs sans support :has() */
@supports not selector(:has(*)) {
    /* Version JavaScript sera nécessaire pour ces navigateurs */
    .chat-button-label.typing {
        opacity: 0 !important;
        transform: translateY(-10px) !important;
    }
}