/* Conteneur fixe en bas à droite au-dessus du site */
.gps-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
    font-family: inherit;
}

/* Bouton "Aide" type FAB */
#gps-chat-launcher.gps-chat-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gps-primary-gradient, linear-gradient(90deg, #0e5063 0%, #126b85 58%, #1d7f9d 100%));
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb, 14, 90, 112), 0.35);
    cursor: pointer;
    z-index: 1051;
    font-size: 0.9rem;
    padding: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

#gps-chat-launcher.gps-chat-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(var(--bs-primary-rgb, 14, 90, 112), 0.42);
}

#gps-chat-launcher.gps-chat-fab.gps-chat-fab-highlight {
    animation: gps-chat-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb, 14, 90, 112), 0.45);
}

.gps-chat-intro {
    position: fixed;
    right: 84px;
    bottom: 28px;
    display: flex;
    align-items: center;
    max-width: 280px;
    padding: 0.6rem 0.8rem;
    color: #fff;
    background: var(--gps-primary-gradient, linear-gradient(90deg, #0e5063 0%, #126b85 58%, #1d7f9d 100%));
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(var(--bs-primary-rgb, 14, 90, 112), 0.28);
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1051;
}

.gps-chat-intro-visible {
    opacity: 1;
    transform: translateX(0);
}

.gps-chat-intro::after {
    position: absolute;
    right: -8px;
    bottom: 16px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #1d7f9d;
    content: "";
}

@keyframes gps-chat-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb, 14, 90, 112), 0.45);
    }
    70% {
        transform: scale(1.06);
        box-shadow: 0 0 0 14px rgba(var(--bs-primary-rgb, 14, 90, 112), 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb, 14, 90, 112), 0);
    }
}

@media (max-width: 575.98px) {
    .gps-chat-intro {
        right: 20px;
        bottom: 86px;
        max-width: calc(100vw - 40px);
    }

    .gps-chat-intro::after {
        right: 20px;
        bottom: -8px;
        border-top: 8px solid #1d7f9d;
        border-right: 8px solid transparent;
        border-bottom: 0;
        border-left: 8px solid transparent;
    }
}

/* ===== Fenêtre du chat — mode normal ===== */
#gps-chat-window.gps-chat-window {
    position: fixed;
    bottom: 86px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    display: none;
    z-index: 1050;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.25s ease;
}

#gps-chat-window .card-header .close {
    opacity: 1;
    font-size: 1.5rem;
    padding: 0 0.25rem;
}

#gps-chat-window #chat-history {
    height: 320px;
    overflow-y: auto;
    transition: height 0.25s ease;
}

/* ===== Fenêtre du chat — mode agrandi ===== */
#gps-chat-window.gps-chat-expanded {
    width: 700px;
    max-width: calc(100vw - 40px);
    bottom: 20px;
}

#gps-chat-window.gps-chat-expanded #chat-history {
    height: calc(100vh - 200px);
}

/* ===== Indicateur "en train d'écrire" (3 points animés) ===== */
.typing-dots {
    display: inline-block;
    animation: typing-dots 1.4s ease-in-out infinite;
    color: #6c757d;
}

@keyframes typing-dots {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Message bot (pour cohérence avec l'indicateur de frappe) */
.chat-message.bot {
    margin-bottom: 0.5rem;
    text-align: left;
}

/* Bouton envoyer désactivé */
#btn-send-chat:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
