/* css/lh-chat.css - LogikHaus customer service chat widget (lhc- prefix). ASCII only. */

.lhc-root {
    --lhc-bg:        #0f131a;
    --lhc-surface:   #151a23;
    --lhc-surface-2: #1b212c;
    --lhc-border:    #2a3240;
    --lhc-text:      #e9edf3;
    --lhc-muted:     #98a1b2;
    --lhc-dim:       #6b7486;
    --lhc-accent:    #d99a4e;
    --lhc-accent-tx: #171006;
    --lhc-teal:      #52d3c7;
    --lhc-danger:    #f87171;
    --lhc-radius:    14px;

    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9990;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--lhc-text);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}
.lhc-root *, .lhc-root *::before, .lhc-root *::after { box-sizing: border-box; }
.lhc-root [hidden] { display: none !important; }
.lhc-root a { color: var(--lhc-teal); text-decoration: underline; }

/* Shield the widget from the site's global button / input / textarea styles
   (default.css styles every <button> yellow and full width). */
.lhc-root button,
.lhc-root input,
.lhc-root textarea {
    font: inherit;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
    margin: 0;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    float: none;
    transform: none;
}
.lhc-root button { cursor: pointer; line-height: normal; }

/* ---------- bubble ---------- */
.lhc-bubble {
    position: relative;
    width: 58px; height: 58px;
    border-radius: 50%;
    border: none;
    background: var(--lhc-accent);
    color: var(--lhc-accent-tx);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    transition: transform .15s ease, filter .15s ease;
    margin: 0; padding: 0;
}
.lhc-bubble:hover { transform: translateY(-2px); filter: brightness(1.06); }
.lhc-bubble:focus-visible { outline: 3px solid var(--lhc-teal); outline-offset: 3px; }
.lhc-badge {
    position: absolute;
    top: -3px; right: -3px;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--lhc-bg);
}

/* ---------- teaser ---------- */
.lhc-teaser {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 260px;
    background: var(--lhc-surface);
    border: 1px solid var(--lhc-border);
    border-radius: 12px;
    padding: 10px 8px 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    animation: lhc-pop .25s ease;
}
.lhc-teaser-text {
    background: none; border: none; padding: 0; margin: 0;
    color: var(--lhc-text);
    text-align: left;
    font-size: 13px;
}
.lhc-teaser-close {
    background: none; border: none; padding: 2px; margin: 0;
    color: var(--lhc-dim);
    line-height: 0;
    flex-shrink: 0;
}
.lhc-teaser-close:hover { color: var(--lhc-text); }
.lhc-teaser-close svg { width: 16px; height: 16px; }

/* ---------- panel ---------- */
.lhc-panel {
    width: 370px;
    height: 560px;
    max-height: calc(100vh - 110px);
    background: var(--lhc-bg);
    border: 1px solid var(--lhc-border);
    border-radius: var(--lhc-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: lhc-pop .2s ease;
}
@keyframes lhc-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lhc-panel, .lhc-teaser { animation: none; } }

.lhc-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 14px 18px;
    background: var(--lhc-surface);
    border-bottom: 1px solid var(--lhc-border);
}
.lhc-head-title { font-weight: 700; font-size: 15px; color: var(--lhc-text); }
.lhc-head-sub { font-size: 12px; color: var(--lhc-muted); }
.lhc-close {
    background: none; border: none; padding: 6px; margin: 0;
    color: var(--lhc-muted); border-radius: 8px; line-height: 0;
}
.lhc-close:hover { color: var(--lhc-text); background: var(--lhc-surface-2); }

/* ---------- messages ---------- */
.lhc-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overscroll-behavior: contain;
}
.lhc-msgs::-webkit-scrollbar { width: 5px; }
.lhc-msgs::-webkit-scrollbar-thumb { background: var(--lhc-border); border-radius: 4px; }

.lhc-msg { display: flex; flex-direction: column; max-width: 85%; }
.lhc-from-guest { align-self: flex-end; align-items: flex-end; }
.lhc-from-staff, .lhc-from-bot { align-self: flex-start; align-items: flex-start; }
.lhc-from-system { align-self: center; max-width: 92%; }

.lhc-name { font-size: 11px; color: var(--lhc-teal); font-weight: 600; margin: 0 0 3px 4px; }
.lhc-bubble-txt {
    padding: 9px 13px;
    border-radius: 14px;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: 14px;
}
.lhc-from-guest .lhc-bubble-txt { background: var(--lhc-accent); color: var(--lhc-accent-tx); border-bottom-right-radius: 4px; }
.lhc-from-guest .lhc-bubble-txt a { color: var(--lhc-accent-tx); }
.lhc-from-staff .lhc-bubble-txt,
.lhc-from-bot .lhc-bubble-txt { background: var(--lhc-surface-2); color: var(--lhc-text); border: 1px solid var(--lhc-border); border-bottom-left-radius: 4px; }
.lhc-time { font-size: 10px; color: var(--lhc-dim); margin: 3px 4px 0; }
.lhc-sys { font-size: 12px; color: var(--lhc-muted); text-align: center; padding: 4px 8px; }
.lhc-sys-err { color: var(--lhc-danger); }

/* ---------- contact form ---------- */
.lhc-contact {
    margin: 4px 0 0;
    padding: 12px;
    background: var(--lhc-surface);
    border: 1px solid var(--lhc-accent);
    border-radius: 12px;
    display: flex; flex-direction: column; gap: 7px;
    flex-shrink: 0;
}
.lhc-contact-title { font-weight: 700; font-size: 13px; color: var(--lhc-text); }
.lhc-contact-sub { font-size: 12px; color: var(--lhc-muted); margin-bottom: 2px; }
.lhc-in {
    width: 100%;
    background: var(--lhc-surface-2);
    border: 1px solid var(--lhc-border);
    border-radius: 8px;
    color: var(--lhc-text);
    padding: 8px 10px;
    font: inherit;
    font-size: 14px;
    margin: 0;
}
.lhc-in::placeholder { color: var(--lhc-dim); }
.lhc-in:focus { outline: none; border-color: var(--lhc-accent); }
.lhc-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--lhc-muted); cursor: pointer; margin: 2px 0 0; }
.lhc-consent input { margin: 2px 0 0; flex-shrink: 0; accent-color: var(--lhc-accent); }
.lhc-contact-err { font-size: 12px; color: var(--lhc-danger); }
.lhc-contact-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.lhc-root button.lhc-btn {
    width: auto !important;
    background: var(--lhc-accent) !important; color: var(--lhc-accent-tx) !important;
    border: none !important; border-radius: 8px !important;
    padding: 8px 14px !important; font-weight: 700; font-size: 13px; margin: 0 !important;
}
.lhc-root button.lhc-btn:disabled { opacity: .6; cursor: default; }
.lhc-root button.lhc-link-btn {
    width: auto !important;
    background: none !important; border: none !important; color: var(--lhc-muted) !important;
    font-size: 12px; padding: 4px !important; margin: 0 !important; text-decoration: underline;
}

/* ---------- composer ---------- */
.lhc-composer {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--lhc-border);
    background: var(--lhc-surface);
    margin: 0;
}
.lhc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.lhc-root .lhc-composer .lhc-ta {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    background: var(--lhc-surface-2);
    border: 1px solid var(--lhc-border);
    border-radius: 10px;
    color: var(--lhc-text);
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
}
.lhc-ta::placeholder { color: var(--lhc-dim); }
.lhc-ta:focus { outline: none; border-color: var(--lhc-accent); }
.lhc-root .lhc-composer button.lhc-send {
    flex: 0 0 40px !important;
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 10px !important;
    background: var(--lhc-accent) !important;
    color: var(--lhc-accent-tx) !important;
    display: flex !important; align-items: center; justify-content: center;
}
.lhc-root .lhc-composer button.lhc-send:disabled { opacity: .55; cursor: default; }
.lhc-foot { font-size: 10.5px; color: var(--lhc-dim); text-align: center; padding: 0 12px 8px; background: var(--lhc-surface); }

/* ---------- mobile: full screen ---------- */
@media (max-width: 600px) {
    .lhc-root { right: 14px; bottom: 14px; }
    .lhc-root.lhc-is-open { inset: 0; right: 0; bottom: 0; gap: 0; }
    .lhc-root.lhc-is-open .lhc-bubble,
    .lhc-root.lhc-is-open .lhc-teaser { display: none; }
    .lhc-panel {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
    }
    .lhc-ta, .lhc-in { font-size: 16px; }   /* stops iOS zooming into inputs */
}

/* ---------- hardening: keep the site's global button styles off the widget ---------- */
.lhc-root button.lhc-bubble {
    width: 58px !important; height: 58px !important; min-width: 58px !important;
    padding: 0 !important; margin: 0 !important; border: none !important;
    border-radius: 50% !important;
    background: var(--lhc-accent) !important; color: var(--lhc-accent-tx) !important;
    display: flex !important;
}
.lhc-root button.lhc-close,
.lhc-root button.lhc-teaser-close {
    width: auto !important; padding: 6px !important; margin: 0 !important;
    border: none !important; background: none !important; color: var(--lhc-muted) !important;
}
.lhc-root button.lhc-close:hover { background: var(--lhc-surface-2) !important; color: var(--lhc-text) !important; }
.lhc-root button.lhc-teaser-text {
    width: auto !important; padding: 0 !important; margin: 0 !important;
    border: none !important; background: none !important; color: var(--lhc-text) !important;
    text-align: left !important;
}
.lhc-root .lhc-contact input.lhc-in { width: 100% !important; }
.lhc-root button.lhc-btn,
.lhc-root button.lhc-link-btn { height: auto !important; min-height: 0 !important; line-height: 1.3 !important; font-size: 13px !important; text-transform: none !important; }
.lhc-root .lhc-consent input[type="checkbox"] {
    width: 16px !important; height: 16px !important; min-width: 16px !important;
    flex: 0 0 16px !important; margin: 2px 0 0 !important; padding: 0 !important;
}
@media (max-width: 600px) {
    .lhc-root.lhc-is-open button.lhc-bubble { display: none !important; }
}
