#chat {
    flex: 1;
    min-height: 0;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .7rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.message {
    max-width: 70%;
    /* Changed from 90% */
    margin-bottom: 2px;
    padding: 14px 20px;
    border-radius: 18px;
    font-size: 1.08rem;
    line-height: 1.6;
    word-break: break-word;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
    opacity: 1;
    transition: opacity .5s;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--vizeo-accent), var(--vizeo-light));
    color: var(--white);
    font-weight: 500;
}

.message.assistant {
    align-self: flex-start;
    background: var(--gray-200);
    color: var(--gray-900);
}

.old-message {
    opacity: 1 !important;
}

.old-message .product-card,
.old-message .input-row button,
.old-message .dialog-button {
    opacity: 1 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Réduction de la taille des anciens messages de 30% */
.old-message {
    transform: scale(0.7);
    transform-origin: left top;
}

/* Styles pour les images FAQ */
.faq-image-container {
    margin: 10px 0;
    display: inline-block;
    text-align: center;
}

.faq-image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #e0e0e0;
    position: relative;
}

.faq-image-preview:hover {
    transform: scale(1.3);
    /* Agrandissement plus marqué au survol */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #3a8dde;
    z-index: 1000;
    /* Au-dessus du reste */
}

/* Modal pour agrandissement */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.image-modal img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    user-select: none;
}

.image-modal-close:hover {
    color: #ccc;
}

/* Animation pour effet de recherche FAQ */
@keyframes pulse {
    0% {
        opacity: 0.7;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }

    100% {
        opacity: 0.7;
        transform: scale(1);
    }
}

.search-animation {
    animation: pulse 1.5s infinite;
}

/* Transition fluide pour les bulles FAQ */
.chat-bubble {
    transition: all 0.5s ease-in-out;
}

/* 🎨 EFFET DE FONDUE - Styles améliorés pour les transitions de messages */
.message {
    transition: opacity 0.4s ease-in-out, transform 0.3s ease-in-out;
}

.message.fade-in {
    animation: fadeInMessage 0.4s ease-in-out;
}

.message.fade-transition {
    animation: fadeTransition 0.6s ease-in-out;
}

@keyframes fadeInMessage {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeTransition {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0;
        transform: scale(0.98);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Guided mode supprimé - styles nettoyés */

/* ===== FAQ ACTION CARD - Design moderne et élégant ===== */
.faq-action-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin: 20px 0 10px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.faq-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #2563eb);
}

.faq-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Header - Support */
.faq-action-card-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-bottom: 1px solid #e2e8f0;
}

.support-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.support-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
}

.support-details {
    flex: 1;
}

.phone-number {
    font-size: 18px;
    font-weight: 700;
    color: #1d4ed8;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.business-hours {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* Body - Actions PDF */
.faq-action-card-body {
    padding: 12px 18px;
}

.pdf-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.pdf-button {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
}

.pdf-button.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.pdf-button.primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.pdf-button.secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.pdf-button.secondary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.pdf-button:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Footer - FAQ Reference */
.faq-action-card-footer {
    padding: 10px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.faq-reference {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.faq-reference strong {
    color: #1e293b;
    font-weight: 700;
}

/* ============================================
   RESPONSIVE MOBILE - INTERFACE CHAT
   ============================================ */

/* Tablettes */
@media (max-width: 1024px) {
    #chat {
        padding: 1.25rem 0.75rem;
        gap: 0.6rem;
    }

    .message {
        max-width: 80%;
        padding: 13px 18px;
        font-size: 1.05rem;
    }

    .old-message {
        transform: scale(0.75);
    }
}

/* Smartphones */
@media (max-width: 768px) {
    #chat {
        padding: 1rem 0.5rem 1rem 0.5rem;
        /* Padding normal, le leftSide gère l'espace sticky */
        gap: 0.5rem;
    }

    .message {
        max-width: 90%;
        /* Plus large sur mobile */
        padding: 12px 16px;
        font-size: 1rem;
        border-radius: 16px;
        line-height: 1.5;
    }

    .old-message {
        transform: scale(0.85);
        /* Réduction moins agressive */
        transform-origin: left top;
    }

    /* Images FAQ responsive */
    .faq-image-container {
        margin: 8px 0;
    }

    .faq-image-preview {
        max-width: 160px;
        max-height: 120px;
        border-radius: 6px;
    }

    .faq-image-preview:hover {
        transform: scale(1.2);
        /* Moins agressif sur mobile */
    }

    /* Modal image en plein écran mobile */
    .image-modal img {
        max-width: 95%;
        max-height: 95%;
        border-radius: 8px;
    }

    .image-modal-close {
        top: 15px;
        right: 20px;
        font-size: 35px;
    }

    /* FAQ Action Card responsive */
    .faq-action-card {
        margin: 15px 5px;
        border-radius: 12px;
    }

    .faq-action-card-header {
        padding: 12px 14px;
    }

    .support-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .support-title {
        min-width: auto;
        font-size: 15px;
    }

    .support-details {
        width: 100%;
    }

    .phone-number {
        font-size: 16px;
        margin-bottom: 3px;
    }

    .business-hours {
        font-size: 12px;
    }

    .faq-action-card-body {
        padding: 10px 14px;
    }

    .pdf-actions {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .pdf-button {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 14px;
        min-height: 42px;
    }

    .faq-action-card-footer {
        padding: 8px 14px;
        text-align: center;
    }

    .faq-reference {
        font-size: 10px;
    }
}

/* Très petits smartphones */
@media (max-width: 375px) {
    #chat {
        padding: 0.75rem 0.4rem;
    }

    .message {
        max-width: 92%;
        padding: 10px 14px;
        font-size: 0.95rem;
        border-radius: 14px;
    }

    .old-message {
        transform: scale(0.88);
    }

    .faq-image-preview {
        max-width: 140px;
        max-height: 100px;
    }

    .phone-number {
        font-size: 15px;
    }

    .pdf-button {
        padding: 9px 14px;
        font-size: 13px;
        min-height: 40px;
    }
}

/* Tablettes en mode paysage */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .message {
        max-width: 75%;
    }

    #chat {
        padding: 1rem;
    }
}

/* Optimisations tactiles pour le chat */
@media (hover: none) and (pointer: coarse) {

    /* Désactiver le hover zoom sur images FAQ */
    .faq-image-preview:hover {
        transform: scale(1);
    }

    /* Activer le zoom au tap */
    .faq-image-preview:active {
        transform: scale(1.05);
    }

    /* Zone tactile suffisante pour les boutons PDF */
    .pdf-button {
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Pas d'effet hover sur boutons */
    .pdf-button:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* Effet active à la place */
    .pdf-button:active {
        transform: scale(0.98);
    }
}

/* ==============================================================================
   🚀 STREAMING SSE - Cursor Animation Styles
   ============================================================================== */

/* Curseur clignotant pendant le streaming */
.streaming-cursor {
    display: inline;
    animation: blink 0.7s infinite;
    color: var(--vizeo-accent, #3b82f6);
    font-weight: bold;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* Bulle en cours de streaming */
.streaming-response {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-left: 3px solid var(--vizeo-accent, #3b82f6);
    position: relative;
    min-height: 60px;
}

/* Loading indicator container */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

/* Animated dots */
.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--vizeo-accent, #3b82f6);
    border-radius: 50%;
    animation: bounce-dot 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce-dot {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading phrase text */
.loading-phrase {
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

/* Bulle d'erreur */
.error-bubble {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%) !important;
    border-left: 3px solid #ef4444;
    color: #991b1b;
}

/* ==============================================================================
   📄 FAQ PDF ACTION CARD - Beautiful download button
   ============================================================================== */

.faq-action-card {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 1px solid #bae6fd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.faq-action-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-action-icon {
    font-size: 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.faq-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.faq-action-text strong {
    color: #1e40af;
    font-size: 14px;
    font-weight: 600;
}

.faq-action-text span {
    color: #64748b;
    font-size: 12px;
}

.faq-pdf-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.faq-pdf-buttons .pdf-button {
    padding: 10px 18px;
    font-size: 13px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.faq-pdf-buttons .pdf-button.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.faq-pdf-buttons .pdf-button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.faq-pdf-buttons .pdf-button.secondary {
    background: white;
    color: #1d4ed8;
    border: 2px solid #3b82f6;
}

.faq-pdf-buttons .pdf-button.secondary:hover {
    background: #eff6ff;
}

.faq-pdf-buttons .pdf-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

/* Responsive */
@media (max-width: 480px) {
    .faq-action-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .faq-action-content {
        justify-content: center;
    }

    .faq-pdf-buttons {
        justify-content: center;
    }
}