/* Tabulizer pre-sales assistant - the chat bubble (plg_system_salesagent) */

.sales-launcher,
.sales-panel {
    --sales-accent: #1f6fb2;
    --sales-border: #d9dee5;
    --sales-muted: #5f6b7a;
    --sales-user-bg: #eaf3fc;
    position: fixed;
    z-index: 10000;
    font-size: 15px;
    line-height: 1.45;
    box-sizing: border-box;
}
.sales-launcher *, .sales-panel * { box-sizing: border-box; }

.sales-right { right: 20px; }
.sales-left { left: 20px; }

.sales-launcher {
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 28px;
    background: var(--sales-accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    transition: transform 0.15s ease;
}
.sales-launcher:hover { transform: translateY(-2px); }
.sales-launcher:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.sales-launcher .fa { font-size: 20px; }
.sales-launcher-open .sales-launcher-label { display: none; }

.sales-panel {
    bottom: 84px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1d2733;
    border: 1px solid var(--sales-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
.sales-panel[hidden] { display: none; }

.sales-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--sales-accent);
    color: #fff;
}
.sales-title { font-weight: 700; }
.sales-subtitle { font-size: 13px; opacity: 0.9; }
.sales-head-actions { display: flex; gap: 4px; }
.sales-icon {
    background: none;
    border: 0;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
}
.sales-icon:hover { background: rgba(255, 255, 255, 0.15); }

.sales-log { flex: 1; overflow-y: auto; padding: 12px; background: #f7f9fb; }

.sales-msg { display: flex; margin-bottom: 10px; }
.sales-msg-user { justify-content: flex-end; }
.sales-body {
    max-width: 88%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--sales-border);
    background: #fff;
    overflow-wrap: anywhere;
}
.sales-msg-user .sales-body { background: var(--sales-user-bg); border-color: #c9ddf2; }
.sales-body p { margin: 0 0 0.5em; }
.sales-body p:last-child, .sales-body ul:last-child, .sales-body ol:last-child { margin-bottom: 0; }
.sales-body ul, .sales-body ol { margin: 0 0 0.5em 1.3em; padding: 0; }
.sales-body code { background: #eef1f4; padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
.sales-body pre { background: #eef1f4; padding: 8px; border-radius: 6px; overflow-x: auto; }
.sales-body a { color: var(--sales-accent); text-decoration: underline; }

.sales-thinking .sales-body { color: var(--sales-muted); }
.sales-dots i {
    display: inline-block; width: 6px; height: 6px; margin-right: 3px;
    border-radius: 50%; background: var(--sales-muted);
    animation: sales-blink 1.2s infinite ease-in-out both;
}
.sales-dots i:nth-child(2) { animation-delay: 0.2s; }
.sales-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes sales-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.sales-error { background: #fdecea; color: #8a1f11; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; }

.sales-handoff {
    background: #fffaf0;
    border: 1px solid #e8c875;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.sales-handoff p { margin: 0 0 8px; }
.sales-handoff-button {
    border: 0;
    border-radius: 6px;
    background: var(--sales-accent);
    color: #fff;
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.sales-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--sales-border); background: #fff; }
.sales-form textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--sales-border);
    border-radius: 8px;
    font: inherit;
    color: inherit;
    background: #fff;
}
.sales-send {
    width: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--sales-accent);
    color: #fff;
    cursor: pointer;
}
.sales-send:disabled { opacity: 0.5; cursor: default; }

.sales-disclaimer { font-size: 11px; color: var(--sales-muted); padding: 0 10px 8px; background: #fff; }

/* the note above the contact form after a hand-over */
.sales-prefilled {
    background: #eaf3fc;
    border: 1px solid #c9ddf2;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

@media (max-width: 600px) {
    .sales-launcher { bottom: 14px; padding: 12px 14px; }
    .sales-right { right: 14px; }
    .sales-left { left: 14px; }
    .sales-panel { left: 8px; right: 8px; bottom: 76px; width: auto; max-width: none; height: calc(100vh - 100px); }
}
