/* ==========================================================================
   Live Support AI — BongoHost Premium Widget Styles
   Branded navy-to-royal-blue theme with glass, depth and subtle motion.
   A single accent color (--lsai-color) is configured in the admin panel;
   widget.js derives a deep navy (--lsai-navy / --lsai-navy2) and a bright
   tint (--lsai-color2) from it, so the whole widget always matches the
   site's own brand gradient automatically.
   ========================================================================== */

#lsai-root, #lsai-root * {
    box-sizing: border-box;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --lsai-color: #1E56E8;
    --lsai-color2: #4B84F5;
    --lsai-navy: #10214F;
    --lsai-navy2: #060C22;
    --lsai-glow: rgba(30, 86, 232, 0.5);
}

/* ---------------- Floating action button ---------------- */
.lsai-fab {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, var(--lsai-color2) 0%, var(--lsai-color) 55%, var(--lsai-navy) 100%);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.16) inset,
        0 1px 0 rgba(255,255,255,0.35) inset,
        0 12px 30px rgba(6, 12, 34, 0.5),
        0 0 0 6px rgba(255,255,255,0.04);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
}
.lsai-fab::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid var(--lsai-glow);
    opacity: .8;
    animation: lsai-ring-pulse 2.4s ease-out infinite;
}
.lsai-fab::after {
    content: "";
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    border: 1px solid var(--lsai-glow);
    opacity: .35;
    animation: lsai-ring-pulse 2.4s ease-out .5s infinite;
}
@keyframes lsai-ring-pulse {
    0%   { transform: scale(.92); opacity: .75; }
    70%  { transform: scale(1.28); opacity: 0; }
    100% { transform: scale(1.28); opacity: 0; }
}
.lsai-fab:hover { transform: scale(1.07) translateY(-1px); box-shadow: 0 0 0 1px rgba(255,255,255,0.22) inset, 0 1px 0 rgba(255,255,255,0.4) inset, 0 16px 36px rgba(6,12,34,0.6), 0 0 30px var(--lsai-glow); }
.lsai-fab:active { transform: scale(.98); }
.lsai-fab.lsai-right { right: 24px; }
.lsai-fab.lsai-left  { left: 24px; }
.lsai-fab svg { width: 30px; height: 30px; position: relative; z-index: 1; }
.lsai-fab .lsai-logo-img-fab {
    width: 30px;
    height: 40px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.lsai-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #FF3B5C;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #fff;
    box-shadow: 0 0 10px rgba(255,59,92,0.6);
    display: none;
    z-index: 2;
}

/* ---------------- Panel ---------------- */
.lsai-panel {
    position: fixed;
    bottom: 102px;
    z-index: 999999;
    width: 384px;
    max-width: calc(100vw - 32px);
    height: 570px;
    max-height: calc(100vh - 140px);
    background: linear-gradient(190deg, var(--lsai-navy) 0%, var(--lsai-navy2) 78%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.09);
    box-shadow:
        0 28px 80px rgba(2, 6, 20, 0.6),
        0 1px 0 rgba(255,255,255,0.08) inset,
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 0 50px var(--lsai-glow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px) scale(.97);
    transition: opacity .25s cubic-bezier(.2,.8,.2,1), transform .25s cubic-bezier(.2,.8,.2,1);
}
.lsai-panel.lsai-right { right: 24px; }
.lsai-panel.lsai-left  { left: 24px; }
.lsai-panel.lsai-open  { display: flex; }
.lsai-panel.lsai-visible { opacity: 1; transform: translateY(0) scale(1); }

/* ---------------- Header ---------------- */
.lsai-header {
    position: relative;
    background:
        radial-gradient(120% 160% at 0% -30%, rgba(255,255,255,0.22), transparent 55%),
        linear-gradient(120deg, var(--lsai-navy) 0%, var(--lsai-color) 60%, var(--lsai-color2) 100%);
    color: #fff;
    padding: 20px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    overflow: hidden;
}
.lsai-header::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -60px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
    pointer-events: none;
}
.lsai-header-shine {
    position: absolute;
    top: 0; left: -60%;
    width: 45%;
    height: 100%;
    background: linear-gradient(75deg, transparent, rgba(255,255,255,0.16) 45%, transparent 90%);
    transform: skewX(-18deg);
    animation: lsai-shine-sweep 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes lsai-shine-sweep {
    0%   { left: -60%; }
    35%  { left: 130%; }
    100% { left: 130%; }
}
.lsai-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.lsai-logo-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 4px 14px rgba(0,0,0,0.28);
}
.lsai-logo-badge svg { width: 26px; height: 26px; }
.lsai-logo-badge .lsai-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}
.lsai-header-text h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .2px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 8px rgba(0,0,0,0.15);
}
.lsai-verified {
    display: inline-flex;
    width: 15px;
    height: 15px;
    color: #4CD3FF;
    filter: drop-shadow(0 0 4px rgba(76,211,255,0.7));
}
.lsai-verified svg { width: 100%; height: 100%; }
.lsai-header-text p { margin: 3px 0 0; font-size: 11.5px; opacity: .88; letter-spacing: .3px; text-transform: uppercase; font-weight: 500; }
.lsai-header-wordmark {
    height: 30px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}
.lsai-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}
.lsai-mute {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, opacity .15s ease;
}
.lsai-mute svg { width: 15px; height: 15px; }
.lsai-mute:hover { background: rgba(255,255,255,0.28); }
.lsai-mute.lsai-muted { opacity: .55; }
.lsai-close {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: background .15s ease;
}
.lsai-close:hover { background: rgba(255,255,255,0.28); }

/* ---------------- Online status ---------------- */
.lsai-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .2px;
    color: rgba(255,255,255,0.65);
    padding: 7px 18px;
    background: rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.lsai-online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #35D67C;
    box-shadow: 0 0 6px rgba(53,214,124,0.9);
    animation: lsai-online-pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes lsai-online-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .5; transform: scale(.8); }
}

/* ---------------- Tabs ---------------- */
.lsai-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}
.lsai-tab {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    background: none;
    border-top: none; border-left: none; border-right: none;
    transition: color .15s ease;
}
.lsai-tab.lsai-active {
    color: #fff;
    border-bottom-color: var(--lsai-color2);
    text-shadow: 0 0 14px var(--lsai-glow);
}

.lsai-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lsai-view { flex: 1; min-height: 0; display: none; flex-direction: column; }
.lsai-view.lsai-active { display: flex; }

/* ---------------- AI chat view ---------------- */
.lsai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    background:
        radial-gradient(circle at 12% 0%, rgba(75,132,245,0.10), transparent 45%),
        radial-gradient(circle at 90% 100%, rgba(30,86,232,0.10), transparent 45%);
}
.lsai-messages::-webkit-scrollbar { width: 6px; }
.lsai-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 10px; }

.lsai-msg-wrap {
    display: flex;
    flex-direction: column;
    max-width: 84%;
}
.lsai-msg-wrap.lsai-user { align-self: flex-end; align-items: flex-end; }
.lsai-msg-wrap.lsai-bot { align-self: flex-start; align-items: flex-start; }
.lsai-msg-wrap .lsai-msg { max-width: 100%; }
.lsai-msg-time {
    font-size: 10px;
    color: rgba(255,255,255,0.32);
    margin-top: 3px;
    padding: 0 4px;
}

.lsai-msg {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: lsai-msg-in .18s ease;
}
@keyframes lsai-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lsai-msg.lsai-bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    color: #EAF0FF;
    border: 1px solid rgba(255,255,255,0.09);
    border-bottom-left-radius: 4px;
}
.lsai-msg.lsai-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--lsai-color2), var(--lsai-color));
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px var(--lsai-glow);
}
.lsai-msg.lsai-typing {
    align-self: flex-start;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
    border-bottom-left-radius: 4px;
    padding: 13px 16px;
}
.lsai-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
    background: var(--lsai-color2);
    box-shadow: 0 0 6px var(--lsai-glow);
    animation: lsai-blink 1.2s infinite;
}
.lsai-dot:nth-child(2){ animation-delay:.2s; } .lsai-dot:nth-child(3){ animation-delay:.4s; }
@keyframes lsai-blink { 0%,80%,100%{opacity:.25} 40%{opacity:1} }

.lsai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
    flex-shrink: 0;
}
.lsai-chip {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    color: #EAF0FF;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.lsai-chip:hover {
    background: rgba(255,255,255,0.16);
    border-color: var(--lsai-color2);
    transform: translateY(-1px);
}

.lsai-inputbar {
    display: flex;
    gap: 9px;
    padding: 13px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    background: rgba(0,0,0,0.15);
}
.lsai-inputbar textarea {
    flex: 1;
    resize: none;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 10px 13px;
    font-size: 13.5px;
    max-height: 80px;
    outline: none;
    color: #EAF0FF;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lsai-inputbar textarea::placeholder { color: rgba(255,255,255,0.38); }
.lsai-inputbar textarea:focus {
    border-color: var(--lsai-color2);
    box-shadow: 0 0 0 3px var(--lsai-glow);
}
.lsai-send {
    background: linear-gradient(135deg, var(--lsai-color2), var(--lsai-color));
    border: none;
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px var(--lsai-glow);
    transition: transform .12s ease;
}
.lsai-send:hover:not(:disabled) { transform: scale(1.05); }
.lsai-send:disabled { opacity: .45; cursor: default; box-shadow: none; }
.lsai-send svg { width: 18px; height: 18px; fill: #fff; }

.lsai-note {
    font-size: 10.5px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    padding: 7px 12px 11px;
    background: rgba(0,0,0,0.15);
}

/* ---------------- WhatsApp / Telegram views ---------------- */
.lsai-contact-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
    text-align: center;
    gap: 14px;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.05), transparent 55%);
}
.lsai-contact-view svg { width: 58px; height: 58px; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.4)); }
.lsai-contact-view h4 { margin: 0; font-size: 16px; color: #fff; }
.lsai-contact-view p { margin: 0; font-size: 13px; color: rgba(255,255,255,0.55); }
.lsai-contact-btn {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
}
.lsai-contact-btn:hover { transform: translateY(-2px); }
.lsai-wa-btn { background: linear-gradient(135deg, #25D366, #128C7E); box-shadow: 0 6px 20px rgba(37,211,102,0.35); }
.lsai-tg-btn { background: linear-gradient(135deg, #38B7F0, #229ED9); box-shadow: 0 6px 20px rgba(34,158,217,0.35); }

/* ---------------- Footer branding ---------------- */
.lsai-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    background: rgba(0,0,0,0.22);
    border-top: 1px solid rgba(255,255,255,0.07);
    transition: color .15s ease;
}
.lsai-footer:hover { color: rgba(255,255,255,0.85); }
.lsai-footer-spark {
    color: var(--lsai-color2);
    filter: drop-shadow(0 0 5px var(--lsai-glow));
    font-size: 11px;
}
.lsai-footer-logo {
    height: 20px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(75,132,245,0.25));
}

/* ---------------- Mobile ---------------- */
@media (max-width: 480px) {
    .lsai-panel {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        bottom: 0;
        right: 0 !important;
        left: 0 !important;
        border-radius: 0;
    }
    .lsai-fab { bottom: 18px; }
    .lsai-fab.lsai-right { right: 18px; }
    .lsai-fab.lsai-left { left: 18px; }
}
