/* N8N Chat Widget - Intercom Style */

/* Variables CSS pour personnalisation */
:root {
    --chat-primary-color: #45d3d3;
    --chat-secondary-color: #38b8b8;
    --chat-text-primary: #1f2937;
    --chat-text-secondary: #6b7280;
    --chat-background: #ffffff;
    --chat-border-radius: 24px;
    --chat-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Bloquer le scroll de la page quand le widget est ouvert */
body.n8n-chat-widget-body-no-scroll {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Scrollbar personnalisé - Style moderne et discret */
.n8n-chat-widget-popup ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.n8n-chat-widget-popup ::-webkit-scrollbar-track {
    background: transparent;
}

.n8n-chat-widget-popup ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.n8n-chat-widget-popup ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Firefox */
.n8n-chat-widget-popup * {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.1) transparent;
}

/* Container principal */
.n8n-chat-widget-container {
    position: fixed;
    bottom: 45px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.n8n-chat-widget-position-right {
    right: 24px;
}

.n8n-chat-widget-position-left {
    left: 24px;
}

/* Bouton principal - Intercom Style */
.n8n-chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chat-button-bg, var(--chat-primary-color));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.06), 0 2px 32px 0 rgba(0, 0, 0, 0.16);
    transition: transform 100ms linear, box-shadow 140ms linear, background-color 140ms linear;
    position: relative;
    z-index: 1;
}

.n8n-chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08), 0 4px 48px 0 rgba(0, 0, 0, 0.24);
    background-color: var(--chat-button-hover-bg, var(--chat-secondary-color));
}

.n8n-chat-widget-button:active {
    transform: scale(1.05);
}

.n8n-chat-widget-open .n8n-chat-widget-button {
    transform: scale(0.9);
}

/* Intercom Icon SVG */
.n8n-chat-widget-intercom-icon {
    width: 28px;
    height: 32px;
    fill: var(--chat-button-icon-color, rgba(255, 255, 255, 1));
}

/* Bulle de notification (tooltip) au-dessus du bouton */
.n8n-chat-widget-tooltip {
    position: absolute;
    bottom: 80px;
    right: 0;
    max-width: 240px; /* Mobile par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
    pointer-events: none;
}

/* Tablette et plus grand */
@media (min-width: 481px) {
    .n8n-chat-widget-tooltip {
        max-width: 280px;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .n8n-chat-widget-tooltip {
        max-width: 340px;
    }
}

.n8n-chat-widget-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.n8n-chat-widget-tooltip-content {
    background: white;
    border-radius: 12px;
    padding: 14px 32px 14px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    max-width: calc(100vw - 100px); /* S'adapte à la largeur de l'écran mobile */
    width: 280px; /* Largeur fixe confortable par défaut */
    cursor: pointer; /* Indiquer que c'est interactif */
    transition: opacity 0.2s ease;
}

.n8n-chat-widget-tooltip-content:hover {
    opacity: 0.95;
}

.n8n-chat-widget-tooltip-close {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 20px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    font-weight: 300;
}

.n8n-chat-widget-tooltip-close:hover {
    opacity: 1;
}

/* Tablette et plus grand */
@media (min-width: 481px) {
    .n8n-chat-widget-tooltip-content {
        width: 300px;
        max-width: 300px;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .n8n-chat-widget-tooltip-content {
        width: 340px;
        max-width: 340px;
    }
}

.n8n-chat-widget-tooltip-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mobile - ajustements pour petit écran */
@media (max-width: 480px) {
    .n8n-chat-widget-tooltip-content {
        width: auto;
        min-width: 240px;
    }

    .n8n-chat-widget-tooltip-content p {
        font-size: 13px;
    }
}

.n8n-chat-widget-tooltip-arrow {
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
}

/* Animation de pulse subtil pour attirer l'attention */
@keyframes tooltip-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.n8n-chat-widget-tooltip.show.pulse {
    animation: tooltip-pulse 2s ease-in-out 3;
}

/* Ajuster la position pour le côté gauche */
.n8n-chat-widget-position-left .n8n-chat-widget-tooltip {
    right: auto;
    left: 0;
}

.n8n-chat-widget-position-left .n8n-chat-widget-tooltip-arrow {
    right: auto;
    left: 20px;
}

/* Popup Chat */
.n8n-chat-widget-popup {
    position: absolute;
    bottom: 84px;
    width: 400px;
    overscroll-behavior: contain; /* Empêche le scroll de se propager à la page */
    height: 700px;
    background: var(--chat-background);
    border-radius: var(--chat-border-radius);
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

.n8n-chat-widget-popup-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.n8n-chat-widget-position-right .n8n-chat-widget-popup {
    right: 0;
}

.n8n-chat-widget-position-left .n8n-chat-widget-popup {
    left: 0;
}

/* Header */
.widget-header {
    background: var(--chat-primary-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px 24px;
}

.brand-name {
    color: white;
    font-size: 28px;
    font-weight: bold;
    font-style: italic;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.brand-name:hover {
    transform: scale(1.05);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.n8n-chat-back-to-list {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.n8n-chat-back-to-list:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.n8n-chat-back-to-list:active {
    transform: scale(0.9);
}

.close-btn {
    color: white;
    background: transparent;
    border: none;
    border-radius: 50%;
    padding: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.close-btn:active {
    transform: scale(0.9);
}

/* Greeting Section */
.greeting-section {
    background: var(--chat-primary-color);
    padding: 0 24px 24px 24px;
}

.greeting-text {
    color: white;
    font-size: 22px;
    font-weight: bold;
    white-space: pre-line;
    line-height: 1.4;
    margin: 0;
}

/* Welcome Section */
.n8n-chat-welcome-section {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    background: var(--chat-background);
    overscroll-behavior: contain;
}

/* Bouton terminer la conversation */
.n8n-chat-end-conversation {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.n8n-chat-end-conversation:hover {
    background: rgba(255, 255, 255, 0.2);
}

.n8n-chat-end-conversation:active {
    transform: scale(0.95);
}

/* Quick Actions / Suggestions */
.n8n-chat-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

/* Quick actions en mode inline (au-dessus de l'input) */
.n8n-chat-quick-actions.inline-mode {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    margin-bottom: 0;
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    white-space: nowrap;
}

.n8n-chat-quick-actions.inline-mode::-webkit-scrollbar {
    height: 4px;
}

.n8n-chat-quick-actions.inline-mode::-webkit-scrollbar-track {
    background: transparent;
}

.n8n-chat-quick-actions.inline-mode::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.n8n-chat-quick-action {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Quick action en mode inline */
.n8n-chat-quick-actions.inline-mode .n8n-chat-quick-action {
    padding: 8px 12px;
    border-radius: 20px;
    gap: 6px;
    flex-shrink: 0;
}

.n8n-chat-quick-actions.inline-mode .n8n-chat-quick-action-icon {
    font-size: 16px;
}

.n8n-chat-quick-actions.inline-mode .n8n-chat-quick-action-text {
    font-size: 13px;
    white-space: nowrap;
}

.n8n-chat-quick-actions.inline-mode .n8n-chat-quick-action-arrow {
    display: none;
}

.n8n-chat-quick-action:hover {
    background: var(--chat-primary-color);
    border-color: var(--chat-primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.n8n-chat-quick-action:hover .n8n-chat-quick-action-text {
    color: white;
}

.n8n-chat-quick-action:hover .n8n-chat-quick-action-arrow {
    color: white;
}

.n8n-chat-quick-action-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.n8n-chat-quick-action-text {
    font-size: 14px;
    color: var(--chat-text-primary);
    font-weight: 500;
}

.n8n-chat-quick-action-arrow {
    margin-left: auto;
    color: var(--chat-text-secondary);
    font-size: 18px;
}

/* Messages container */
.n8n-chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #fafafa;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

.n8n-chat-widget-messages::-webkit-scrollbar {
    width: 6px;
}

.n8n-chat-widget-messages::-webkit-scrollbar-track {
    background: transparent;
}

.n8n-chat-widget-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.n8n-chat-widget-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Messages */
.n8n-chat-message {
    display: flex;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bot Message (left aligned) */
.n8n-chat-message.n8n-chat-bot-message-container {
    justify-content: flex-start;
}

/* User Message (right aligned) */
.n8n-chat-user-message-container {
    justify-content: flex-end;
}

.n8n-chat-message-bubble {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.n8n-chat-bot-message {
    background-color: white;
    color: var(--chat-text-primary);
    border: 1px solid #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.n8n-chat-user-message {
    background-color: var(--chat-primary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(69, 211, 211, 0.3);
}

/* Hide avatars */
.n8n-chat-bot-avatar,
.n8n-chat-user-avatar {
    display: none;
}

/* Error messages */
.n8n-chat-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* Welcome message */
.n8n-chat-welcome-message {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Typing indicator */
.n8n-chat-typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 16px;
}

.n8n-chat-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chat-text-secondary);
    animation: typing 1.4s infinite;
}

.n8n-chat-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.n8n-chat-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Input container - Compact collé à la nav */
.n8n-chat-widget-input-container {
    flex-shrink: 0;
    padding: 8px 12px 4px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.n8n-chat-widget-form {
    display: flex;
    gap: 8px;
    align-items: stretch;/* 
    background: #f5f5f5; */
    border: none;
    border-radius: 12px;
    padding: 6px;
    margin: 0 !important;
    transition: all 0.2s ease;
}


.n8n-chat-widget-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    color: var(--chat-text-primary);
    border-radius: 0;
}

.n8n-chat-widget-input:focus {
    outline: none;
}

.n8n-chat-widget-input::placeholder {
    color: #9ca3af;
}

.n8n-chat-widget-send-button {
    width: auto;
    min-width: 48px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--chat-primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.n8n-chat-widget-send-button svg {
    width: 20px;
    height: 20px;
}

.n8n-chat-widget-send-button:hover {
    background: var(--chat-secondary-color);
}

.n8n-chat-widget-send-button:active {
    transform: scale(0.97);
}

.n8n-chat-widget-send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Navigation bottom (style Intercom) */
.n8n-chat-bottom-nav {
    flex-shrink: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 24px 8px 24px;
    background: white;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.n8n-chat-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
}

.n8n-chat-nav-item:hover {
    transform: scale(1.05);
    background: #e5e7eb;
    color: var(--chat-text-primary);
}

.n8n-chat-nav-item:hover .n8n-chat-nav-icon {
    stroke: var(--chat-text-primary);
}

.n8n-chat-nav-item:hover .n8n-chat-nav-label {
    color: var(--chat-text-primary);
}

.n8n-chat-nav-item:active {
    transform: scale(0.95);
}

.n8n-chat-nav-item.active {
    color: var(--chat-primary-color);
    background-color: rgba(69, 211, 211, 0.15);
}

.n8n-chat-nav-icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    transition: stroke 0.2s ease;
}

.n8n-chat-nav-label {
    font-size: 12px;
    font-weight: 500;
}

.n8n-chat-nav-item.active .n8n-chat-nav-label {
    color: var(--chat-primary-color);
}

.n8n-chat-nav-item.active .n8n-chat-nav-icon {
    stroke: var(--chat-primary-color);
}

/* Copyright footer */
.n8n-chat-widget-copyright {
    flex-shrink: 0;
    text-align: center;
    padding: 8px 16px;
    background: white;
    border-top: 1px solid #f3f4f6;
    font-size: 11px;
    line-height: 1.4;
}

.n8n-chat-widget-copyright a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 500;
}

.n8n-chat-widget-copyright a:hover {
    color: #6b7280;
    text-decoration: none;
}

.n8n-chat-widget-copyright .yodlynci-brand {
    color: #ff8f27;
    font-weight: 700;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .n8n-chat-widget-popup {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        bottom: 0 !important;
    }

    .n8n-chat-widget-container {
        bottom: 45px;
        right: 20px;
        left: auto;
    }

    .n8n-chat-widget-mobile .n8n-chat-widget-popup {
        width: 100%;
        height: 100%;
    }

    /* Cacher le bouton et le tooltip sur mobile quand le widget est ouvert */
    .n8n-chat-widget-container.n8n-chat-widget-open .n8n-chat-widget-button,
    .n8n-chat-widget-container.n8n-chat-widget-open .n8n-chat-widget-tooltip {
        display: none !important;
    }

    /* Empêcher le zoom automatique sur les inputs en utilisant 16px minimum */
    .n8n-chat-widget-input,
    .text-input,
    #n8n-chat-home-input {
        font-size: 16px !important;
    }
}

/* Markdown styling */
.n8n-chat-bot-message strong {
    font-weight: 600;
}

.n8n-chat-bot-message em {
    font-style: italic;
}

.n8n-chat-bot-message a {
    color: var(--chat-primary-color);
    text-decoration: underline;
}

.n8n-chat-bot-message .list-item {
    padding-left: 20px;
    margin: 4px 0;
}

/* Animation pour le bouton */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    }
}

.n8n-chat-widget-button.pulse {
    animation: pulse 2s infinite;
}

/* Navigation toujours visible */
.n8n-chat-bottom-nav {
    display: flex;
}

/* Content sections for nav tabs */
.n8n-chat-content-section {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    display: none;
    overscroll-behavior: contain;
}

.n8n-chat-content-section.active {
    display: block;
}

.n8n-chat-content-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--chat-text-primary);
    margin-bottom: 16px;
}

.n8n-chat-content-section p {
    font-size: 14px;
    color: var(--chat-text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.n8n-chat-faq-item {
    background: white;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0;
    padding: 16px 20px;
    margin-bottom: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

/* Désactive les pointer-events sur les enfants pour que le clic remonte à l'item */
.n8n-chat-faq-item * {
    pointer-events: none;
}

/* Mais réactive les pointer-events sur les liens dans les réponses */
.n8n-chat-faq-answer a {
    pointer-events: auto;
    color: var(--chat-primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.n8n-chat-faq-answer a:hover {
    color: var(--chat-secondary-color);
    text-decoration: none;
}

.n8n-chat-faq-item:hover {
    background: #fafafa;
    border-left-color: var(--chat-primary-color);
}

.n8n-chat-faq-item.open {
    background: #fafafa;
    border-left-color: var(--chat-primary-color);
}

.n8n-chat-faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--chat-text-primary);
    gap: 12px;
    font-size: 14px;
}

.n8n-chat-faq-question svg {
    width: 20px;
    height: 20px;
    color: #d1d5db;
    flex-shrink: 0;
    transition: transform 0.3s ease, color 0.2s ease;
}

.n8n-chat-faq-item:hover .n8n-chat-faq-question svg {
    color: var(--chat-primary-color);
}

.n8n-chat-faq-item.open .n8n-chat-faq-question svg {
    transform: rotate(180deg);
    color: var(--chat-primary-color);
}

.n8n-chat-faq-answer {
    font-size: 14px;
    color: var(--chat-text-secondary);
    line-height: 1.7;
    margin-top: 12px;
    padding-top: 0;
    border-top: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.n8n-chat-faq-item.open .n8n-chat-faq-answer {
    max-height: 1000px;
    opacity: 1;
    padding-top: 12px;
}

/* Styles complets pour les sections Aide */
.n8n-chat-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--chat-text-primary);
    margin-bottom: 24px;
    padding-bottom: 0;
    border-bottom: none;
}

/* FAQ Section */
.n8n-chat-faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.n8n-chat-faq-icon {
    margin-right: 8px;
    font-size: 16px;
}

.n8n-chat-help-footer {
    margin-top: 32px;
    padding: 24px;
    background: white;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.n8n-chat-help-footer p {
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 15px;
    color: var(--chat-text-primary);
}

.n8n-chat-contact-support {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.n8n-chat-contact-support:hover {
    background: var(--chat-secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.n8n-chat-contact-support:active {
    transform: translateY(0);
}

/* Quick Actions Wrapper - Conteneur avec position relative pour les gradients */
.n8n-chat-quick-actions-wrapper {
    position: relative;
    background: white;
}

/* Gradient indicators pour montrer qu'on peut scroller - Fixes aux bords du widget */
.n8n-chat-quick-actions-wrapper::before,
.n8n-chat-quick-actions-wrapper::after {
    content: '';
    position: absolute;
    display: block;
    top: 0;
    width: 40px;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.n8n-chat-quick-actions-wrapper::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.n8n-chat-quick-actions-wrapper::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

.n8n-chat-quick-actions-wrapper.has-scroll-left::before {
    opacity: 1;
}

.n8n-chat-quick-actions-wrapper.has-scroll-right::after {
    opacity: 1;
}

/* Quick Actions Inline Mode (au-dessus de l'input) - Design simple et clair */
.n8n-chat-quick-actions-inline {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 12px 16px;
    background: white;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #e5e7eb transparent;
    scroll-behavior: smooth;
}

.n8n-chat-quick-actions-inline::-webkit-scrollbar {
    height: 4px;
}

.n8n-chat-quick-actions-inline::-webkit-scrollbar-track {
    background: transparent;
}

.n8n-chat-quick-actions-inline::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 2px;
}

.n8n-chat-quick-actions-inline::-webkit-scrollbar-thumb:hover {
    background: #d1d5db;
}

/* Quick action en mode inline - Pills simples et élégantes */
.n8n-chat-quick-actions-inline .n8n-chat-quick-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
    color: var(--chat-text-primary);
    min-width: fit-content;
}

.n8n-chat-quick-actions-inline .n8n-chat-quick-action:hover {
    background: var(--chat-primary-color);
    color: white;
    border-color: var(--chat-primary-color);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(69, 211, 211, 0.25);
}

.n8n-chat-quick-actions-inline .n8n-chat-quick-action-icon {
    font-size: 14px;
    line-height: 1;
}

.n8n-chat-quick-actions-inline .n8n-chat-quick-action-text {
    line-height: 1;
}

.n8n-chat-quick-actions-inline .n8n-chat-quick-action-arrow {
    display: none;
}

/* Ajustement de la disposition des sections */
.n8n-chat-widget-popup.show-help #n8n-chat-help-section {
    display: flex;
    flex-direction: column;
}

/* Cacher complètement le chat (input, quick actions, typing, messages) dans Aide, Accueil, Liste Conversations et Conversations Terminées */
.n8n-chat-widget-popup.show-help .n8n-chat-widget-input-container,
.n8n-chat-widget-popup.show-welcome .n8n-chat-widget-input-container,
.n8n-chat-widget-popup.show-conversations-list .n8n-chat-widget-input-container,
.n8n-chat-widget-popup.show-completed-conversation .n8n-chat-widget-input-container,
.n8n-chat-widget-popup.show-help .n8n-chat-quick-actions-inline,
.n8n-chat-widget-popup.show-welcome .n8n-chat-quick-actions-inline,
.n8n-chat-widget-popup.show-conversations-list .n8n-chat-quick-actions-inline,
.n8n-chat-widget-popup.show-completed-conversation .n8n-chat-quick-actions-inline,
.n8n-chat-widget-popup.show-help .n8n-chat-typing-indicator,
.n8n-chat-widget-popup.show-welcome .n8n-chat-typing-indicator,
.n8n-chat-widget-popup.show-conversations-list .n8n-chat-typing-indicator,
.n8n-chat-widget-popup.show-completed-conversation .n8n-chat-typing-indicator,
.n8n-chat-widget-popup.show-help .n8n-chat-widget-messages,
.n8n-chat-widget-popup.show-welcome .n8n-chat-widget-messages,
.n8n-chat-widget-popup.show-conversations-list .n8n-chat-widget-messages {
    display: none !important;
}

/* Cacher le greeting UNIQUEMENT en mode chat pur (pas accueil) */
.n8n-chat-widget-popup.show-messages:not(.show-welcome) .greeting-section {
    display: none !important;
}

/* Message d'avertissement pour utilisateurs non connectés */
.n8n-chat-login-warning {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #f59e0b;
}

.n8n-chat-login-warning-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.n8n-chat-warning-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 2px;
}

.n8n-chat-login-warning h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-text-primary);
}

.n8n-chat-login-warning p {
    margin: 0;
    font-size: 13px;
    color: var(--chat-text-secondary);
    line-height: 1.5;
}

/* Section Messages récents */
.n8n-chat-recent-section,
.n8n-chat-articles-section {
    margin-bottom: 20px;
}

.n8n-chat-recent-title,
.n8n-chat-articles-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-text-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.n8n-chat-recent-title svg,
.n8n-chat-articles-title svg {
    color: var(--chat-text-secondary);
}

/* Message Input Section */
.input-section {
    padding: 0;
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-container {
    background-color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0;
    transition: all 0.2s;
}

.input-container:focus-within {
    transform: translateY(-2px);
}

.text-input {
    flex: 1;
    border: none;
    outline: none;
    color: #1f2937;
    font-size: 14px;
    padding: 12px 16px;
    line-height: 1.5;
}

#n8n-chat-home-input {
    margin-bottom: 0 !important;
}

.text-input::placeholder {
    color: #6b7280;
}

.send-btn {
    background: transparent;
    border: none;
    color: var(--chat-primary-color);
    cursor: pointer;
    padding: 12px 16px;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover {
    color: white;
    transform: scale(1.05);
    background-color: var(--chat-primary-color);
}

.send-btn:active {
    transform: scale(0.95);
    background-color: var(--chat-secondary-color);
}

.send-btn:disabled {
    color: #d1d5db;
    cursor: not-allowed;
    transform: scale(1);
}

.icon {
    width: 20px;
    height: 20px;
}

/* Start Conversation Button */
.n8n-chat-start-conversation {
    margin: 20px 0;
    animation: slideInUp 0.6s ease-out;
}

.n8n-chat-start-conversation-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--chat-primary-color), var(--chat-secondary-color));
    color: white;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(69, 211, 211, 0.3);
    position: relative;
    overflow: hidden;
}

.n8n-chat-start-conversation-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.n8n-chat-start-conversation-btn:hover::before {
    left: 100%;
}

.n8n-chat-start-conversation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(69, 211, 211, 0.4);
}

.n8n-chat-start-conversation-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(69, 211, 211, 0.3);
}

/* Quick Answers Card */
.quick-answers-card {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    margin-bottom: 20px;
}

/* Card Header */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.card-title {
    color: #1f2937;
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

.header-icon {
    width: 16px;
    height: 16px;
    color: var(--chat-primary-color);
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
}

.question-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    animation: questionSlideIn 0.3s ease-out backwards;
    min-width: auto;
}

/* Désactive les pointer-events sur les enfants pour que le clic remonte au bouton */
.question-item * {
    pointer-events: none;
}

.question-item:nth-child(1) { animation-delay: 0.1s; }
.question-item:nth-child(2) { animation-delay: 0.15s; }
.question-item:nth-child(3) { animation-delay: 0.2s; }
.question-item:nth-child(4) { animation-delay: 0.25s; }
.question-item:nth-child(5) { animation-delay: 0.3s; }
.question-item:nth-child(6) { animation-delay: 0.35s; }

@keyframes questionSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-item:last-child {
    border-bottom: none;
}

.question-item:hover {
    background-color: #f9fafb;
    transform: translateX(4px);
}

.question-text {
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s;
}

.question-item:hover .question-text {
    color: #1f2937;
}

.chevron-icon {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
    margin-left: 8px;
    transition: color 0.2s;
}

.question-item:hover .chevron-icon {
    color: var(--chat-primary-color);
}

/* Carte article de blog */
.n8n-chat-latest-post {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.n8n-chat-latest-post:hover {
    border-color: var(--chat-primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.n8n-chat-latest-post-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.n8n-chat-latest-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.n8n-chat-latest-post-badge {
    display: inline-block;
    background: white;
    color: var(--chat-text-primary);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
}

.n8n-chat-latest-post-content {
    padding: 16px;
}

.n8n-chat-latest-post-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--chat-text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.n8n-chat-latest-post-excerpt {
    font-size: 13px;
    color: var(--chat-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bouton "Voir plus d'articles" */
.n8n-chat-view-more-posts {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 2px solid var(--chat-primary-color);
    border-radius: 8px;
    color: var(--chat-primary-color);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.n8n-chat-view-more-posts:hover {
    background: var(--chat-primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Header des conversations */
.n8n-chat-conversations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.n8n-chat-new-conversation-btn {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.n8n-chat-new-conversation-btn:hover {
    background: var(--chat-secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(69, 211, 211, 0.3);
}

.n8n-chat-new-conversation-btn:active {
    transform: translateY(0);
}

.n8n-chat-new-conversation-btn svg {
    flex-shrink: 0;
}

/* Liste des conversations */
#n8n-chat-conversations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.n8n-chat-conversation-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.n8n-chat-conversation-item:hover {
    border-color: var(--chat-primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.n8n-chat-conversation-item.completed {
    opacity: 0.7;
    /* Permettre le clic pour voir l'historique */
    cursor: pointer;
}

.n8n-chat-conversation-item.completed:hover {
    border-color: var(--chat-secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

/* Bouton Charger plus */
.n8n-chat-load-more-btn {
    width: 100%;
    padding: 12px 20px;
    margin-top: 16px;
    background: white;
    border: 2px solid var(--chat-primary-color);
    border-radius: 8px;
    color: var(--chat-primary-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.n8n-chat-load-more-btn:hover {
    background: var(--chat-primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.n8n-chat-load-more-btn:active {
    transform: translateY(0);
}

.n8n-chat-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.n8n-chat-conversation-preview {
    flex: 1;
}

.n8n-chat-conversation-first-message {
    font-size: 14px;
    font-weight: 600;
    color: var(--chat-text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.n8n-chat-conversation-last-message {
    font-size: 13px;
    color: var(--chat-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.n8n-chat-conversation-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--chat-text-secondary);
}

.n8n-chat-conversation-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.n8n-chat-conversation-status.active {
    background: #dcfce7;
    color: #16a34a;
}

.n8n-chat-conversation-status.completed {
    background: #f3f4f6;
    color: #6b7280;
}

.n8n-chat-conversation-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.n8n-chat-conversation-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Quick actions verticales dans le chat */
.n8n-chat-quick-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    padding: 0 16px;
}

.n8n-chat-quick-action-btn {
    width: 100%;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.n8n-chat-quick-action-btn:hover {
    background: #f9fafb;
    border-color: var(--chat-primary-color);
    color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.n8n-chat-quick-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Empty state */
.n8n-chat-empty-state {
    text-align: center;
    padding: 40px 20px;
}

.n8n-chat-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.n8n-chat-empty-state p {
    font-size: 15px;
    color: var(--chat-text-secondary);
    margin-bottom: 20px;
}

.n8n-chat-start-conversation-btn {
    background: var(--chat-primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.n8n-chat-start-conversation-btn:hover {
    background: var(--chat-secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(69, 211, 211, 0.3);
}
