﻿@charset "UTF-8";
/* =====================================================================
   AI Chat Support widget  (all classes start with "aic-" -> no clash with Bootstrap / your theme)
   ===================================================================== */
.aic-root, .aic-panel {
    --aic-1: #6366f1; --aic-2: #8b5cf6; --aic-3: #ec4899;
    --aic-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #ec4899 100%);
    --aic-ink: #1e1b4b; --aic-muted: #6b7280; --aic-bg: #f6f7fb; --aic-line: #e7e8f0;
    --aic-font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Nirmala UI", "Noto Sans Devanagari", Mangal, Arial, sans-serif;
}
.aic-root { position: relative; display: inline-flex; align-items: center; vertical-align: middle; font-family: var(--aic-font); line-height: 1.45; z-index: 1050; }
.aic-root *, .aic-root *::before, .aic-root *::after,
.aic-panel *, .aic-panel *::before, .aic-panel *::after { box-sizing: border-box; }
.aic-token { display: none; }

/* ---------- launcher (top bar icon) ---------- */
.aic-launcher { position: relative; width: 46px; height: 46px; margin: 0 8px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.aic-launcher::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; background: conic-gradient(from 0deg, #6366f1, #8b5cf6, #ec4899, #f59e0b, #6366f1); animation: aic-spin 4s linear infinite; }
.aic-orb { position: absolute; inset: 0; border-radius: 50%; background: var(--aic-grad); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(99,102,241,.45), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .3s cubic-bezier(.34,1.56,.64,1); animation: aic-float 3.2s ease-in-out infinite; }
.aic-launcher:hover .aic-orb { transform: scale(1.1) rotate(-8deg); }
.aic-launcher:active .aic-orb { transform: scale(.92); }
.aic-launcher:focus-visible { box-shadow: 0 0 0 4px rgba(139,92,246,.35); }
.aic-launcher .aic-bot { width: 100%; height: 100%; display: block; }
.aic-orb { overflow: hidden; }
.aic-pulse { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid rgba(139,92,246,.6); animation: aic-pulse 2.4s ease-out infinite; pointer-events: none; }
.aic-badge { position: absolute; top: -6px; right: -10px; padding: 1px 6px; border-radius: 999px; background: #fff; color: #7c3aed; font: 800 9px/1.5 var(--aic-font); letter-spacing: .3px; box-shadow: 0 2px 8px rgba(0,0,0,.18); white-space: nowrap; animation: aic-badge 3s ease-in-out infinite; }
.aic-unread { display: none; position: absolute; top: -2px; left: -2px; width: 13px; height: 13px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.aic-root.has-unread .aic-unread { display: block; animation: aic-pop .35s ease; }
.aic-root.is-open .aic-pulse { display: none; }
.aic-root.is-open .aic-orb { transform: rotate(-8deg) scale(1.04); }

.aic-eyes { animation: aic-blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
.aic-eyes-move { transition: transform .15s ease-out; }
.aic-antenna { animation: aic-glow 2s ease-in-out infinite; }

/* ---------- greeting bubble ---------- */
.aic-greet { position: absolute; top: calc(100% + 14px); right: -6px; width: 300px; padding: 14px 14px 12px; background: #fff; color: var(--aic-ink); border: 1px solid #ede9fe; border-radius: 18px; box-shadow: 0 18px 44px rgba(30,27,75,.22); font-size: 14px; text-align: left; opacity: 0; transform: translateY(-8px) scale(.95); transform-origin: top right; pointer-events: none; transition: opacity .3s ease, transform .4s cubic-bezier(.34,1.56,.64,1); z-index: 1060; }
.aic-greet::before { content: ""; position: absolute; top: -7px; right: 22px; width: 14px; height: 14px; background: #fff; border-left: 1px solid #ede9fe; border-top: 1px solid #ede9fe; transform: rotate(45deg); }
.aic-greet.show { opacity: 1; transform: none; pointer-events: auto; }
.aic-greet-top { display: flex; gap: 10px; align-items: flex-start; padding-right: 14px; }
.aic-greet-emoji { font-size: 28px; line-height: 1; display: inline-block; transform-origin: 70% 70%; }
.aic-greet.show .aic-greet-emoji { animation: aic-wave 1.6s ease-in-out 2; }
.aic-greet-title { font-weight: 800; font-size: 15px; background: var(--aic-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aic-greet-text { margin-top: 3px; min-height: 38px; color: #4b5563; font-size: 13px; }
.aic-greet-text::after { content: "▍"; color: var(--aic-2); animation: aic-caret 1s steps(1) infinite; }
.aic-greet-text.done::after { content: ""; }
.aic-greet-cta { display: flex; gap: 8px; margin-top: 10px; }
.aic-greet-x { position: absolute; top: 6px; right: 9px; border: 0; background: none; color: #9ca3af; font-size: 19px; line-height: 1; cursor: pointer; }
.aic-btn-grad { border: 0; border-radius: 999px; padding: 7px 15px; background: var(--aic-grad); color: #fff; font: 600 13px var(--aic-font); cursor: pointer; box-shadow: 0 4px 12px rgba(139,92,246,.35); transition: transform .2s; }
.aic-btn-grad:hover { transform: translateY(-1px); }
.aic-btn-ghost { border: 0; padding: 7px 8px; background: transparent; color: #6b7280; font: 13px var(--aic-font); cursor: pointer; }

/* ---------- panel ---------- */
.aic-panel { position: fixed; top: 68px; right: 18px; width: 410px; max-width: calc(100vw - 24px); height: 680px; max-height: calc(100vh - 88px); display: flex; flex-direction: column; overflow: hidden; background: var(--aic-bg); color: var(--aic-ink); border-radius: 22px; box-shadow: 0 30px 70px rgba(30,27,75,.30), 0 0 0 1px rgba(99,102,241,.08); font-family: var(--aic-font); font-size: 14px; line-height: 1.5; text-align: left; z-index: 10500; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-14px) scale(.96); transform-origin: top right; transition: opacity .25s ease, transform .35s cubic-bezier(.34,1.4,.64,1), visibility 0s linear .35s; }
.aic-panel.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .25s ease, transform .35s cubic-bezier(.34,1.4,.64,1), visibility 0s; }
.aic-panel.no-anim { transition: none !important; }

.aic-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 14px 12px 15px 14px; background: var(--aic-grad); color: #fff; overflow: hidden; flex: none; }
.aic-head::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 85% -30%, rgba(255,255,255,.38), transparent 45%), radial-gradient(circle at 5% 130%, rgba(255,255,255,.2), transparent 40%); }
.aic-avatar { position: relative; flex: none; width: 42px; height: 42px; border-radius: 14px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; }
.aic-avatar { overflow: hidden; }
.aic-avatar .aic-bot { width: 42px; height: 42px; border-radius: 14px; display: block; background: rgba(255,255,255,.18); }
.aic-panel.busy .aic-avatar { animation: aic-float 1s ease-in-out infinite; }
.aic-online { position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.aic-head-text { min-width: 0; }
.aic-title { margin: 0; color: #fff; font: 700 16px/1.2 var(--aic-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aic-sub { font-size: 11.5px; opacity: .92; white-space: nowrap; }
.aic-head-actions { position: relative; z-index: 1; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.aic-lang { display: flex; padding: 2px; border-radius: 10px; background: rgba(255,255,255,.16); }
.aic-lang button { border: 0; padding: 5px 7px; border-radius: 8px; background: transparent; color: #fff; font: 600 11.5px var(--aic-font); cursor: pointer; opacity: .85; }
.aic-lang button.on { background: #fff; color: #6d28d9; opacity: 1; }
.aic-icon-btn { width: 32px; height: 32px; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; padding: 0; }
.aic-icon-btn:hover { background: rgba(255,255,255,.3); }
.aic-icon-btn svg { width: 17px; height: 17px; }

/* ---------- conversation ---------- */
.aic-body { flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: radial-gradient(circle at 100% 0, rgba(236,72,153,.05), transparent 40%), radial-gradient(circle at 0 100%, rgba(99,102,241,.06), transparent 45%); }
.aic-body::-webkit-scrollbar { width: 6px; }
.aic-body::-webkit-scrollbar-thumb { background: #d4d4e8; border-radius: 6px; }

.aic-welcome { text-align: center; padding: 6px 4px 12px; animation: aic-msg .5s ease both; }
.aic-welcome-emoji { display: inline-block; font-size: 42px; line-height: 1.1; animation: aic-wave 2s ease-in-out 1; transform-origin: 70% 70%; }
.aic-welcome h4 { margin: 6px 0 4px; font: 800 20px/1.25 var(--aic-font); background: var(--aic-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aic-welcome p { max-width: 310px; margin: 0 auto; color: var(--aic-muted); font-size: 13.5px; }
.aic-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; text-align: left; }
.aic-topic { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--aic-line); border-radius: 14px; background: #fff; color: var(--aic-ink); font: 600 13px/1.3 var(--aic-font); text-align: left; cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; }
.aic-topic:hover { transform: translateY(-2px); border-color: #c4b5fd; box-shadow: 0 8px 20px rgba(139,92,246,.16); }
.aic-topic i { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: #f3f0ff; font-size: 17px; font-style: normal; }
.aic-topic small { color: var(--aic-muted); font-size: 11.5px; font-weight: 400; }

.aic-row { display: flex; gap: 8px; margin: 10px 0; animation: aic-msg .35s ease both; }
.aic-row.aic-user { justify-content: flex-end; }
.aic-mini { flex: none; width: 28px; height: 28px; margin-top: 2px; border-radius: 9px; background: var(--aic-grad); display: flex; align-items: center; justify-content: center; }
.aic-mini { overflow: hidden; }
.aic-mini svg { width: 28px; height: 28px; display: block; }
.aic-col { display: flex; flex-direction: column; min-width: 0; max-width: 86%; }
.aic-user .aic-col { align-items: flex-end; }
.aic-bubble { padding: 10px 13px; border-radius: 16px; font-size: 14px; overflow-wrap: anywhere; word-wrap: break-word; }
.aic-bot .aic-bubble { background: #fff; border: 1px solid var(--aic-line); border-top-left-radius: 5px; box-shadow: 0 2px 8px rgba(30,27,75,.05); }
.aic-user .aic-bubble { background: var(--aic-grad); color: #fff; border-top-right-radius: 5px; box-shadow: 0 6px 14px rgba(139,92,246,.25); white-space: pre-wrap; }
.aic-bubble p { margin: 0 0 7px; }
.aic-bubble p:last-child, .aic-bubble ul:last-child, .aic-bubble ol:last-child { margin-bottom: 0; }
.aic-bubble ul, .aic-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.aic-bubble li { margin: 3px 0; }
.aic-bot .aic-bubble strong { color: #4c1d95; }
.aic-bubble a { color: #6d28d9; text-decoration: underline; }
.aic-bubble code { padding: 1px 5px; border-radius: 5px; background: #f3f0ff; color: #6d28d9; font: 12.5px Consolas, "Courier New", monospace; }
.aic-h { margin: 8px 0 4px; color: #4c1d95; font-weight: 700; }
.aic-table-wrap { margin: 6px 0; overflow-x: auto; }
.aic-bubble table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.aic-bubble th, .aic-bubble td { padding: 4px 6px; border: 1px solid var(--aic-line); text-align: left; vertical-align: top; }
.aic-bubble th { background: #f3f0ff; }

.aic-code { margin: 8px 0; overflow: hidden; border-radius: 12px; background: #1e1b4b; }
.aic-code-bar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #2e2a5a; color: #c7d2fe; font-size: 11px; }
.aic-code-bar span { margin-right: auto; text-transform: uppercase; letter-spacing: .5px; }
.aic-code-bar button { border: 0; padding: 3px 9px; border-radius: 6px; background: rgba(255,255,255,.14); color: #fff; font: 11px var(--aic-font); cursor: pointer; }
.aic-code-bar button:hover { background: rgba(255,255,255,.26); }
.aic-code pre { margin: 0; padding: 10px; max-height: 260px; overflow: auto; background: transparent; border: 0; border-radius: 0; color: #e0e7ff; font: 12px/1.45 Consolas, "Courier New", monospace; white-space: pre; }
.aic-code pre code { padding: 0; background: none; color: inherit; font: inherit; }

.aic-meta { display: flex; align-items: center; gap: 2px; margin-top: 3px; color: #9ca3af; font-size: 11px; }
.aic-meta time { margin: 0 4px; }
.aic-act { border: 0; padding: 3px 6px; border-radius: 7px; background: transparent; color: #9ca3af; font: 12px var(--aic-font); line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.aic-act:hover { background: #eef0f7; color: #6d28d9; }
.aic-act.on { background: #ede9fe; color: #6d28d9; }

.aic-video { margin-top: 8px; overflow: hidden; border-radius: 14px; background: #0f0d2e; box-shadow: 0 6px 18px rgba(30,27,75,.18); }
.aic-video-title { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: linear-gradient(90deg, #312e81, #6d28d9); color: #fff; font-size: 12.5px; font-weight: 600; }
.aic-video video { display: block; width: 100%; max-height: 230px; background: #000; }
.aic-video a { display: block; padding: 6px 10px; background: #1e1b4b; color: #c7d2fe !important; font-size: 12px; text-decoration: none !important; }
.aic-video-exp { padding: 10px; color: #fde68a; font-size: 12px; }

.aic-pages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.aic-page-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 12px; background: var(--aic-grad); color: #fff !important; font-size: 13px; text-decoration: none !important; box-shadow: 0 6px 14px rgba(139,92,246,.30); transition: transform .2s, box-shadow .2s; animation: aic-msg .35s ease both; }
.aic-page-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(139,92,246,.40); }
.aic-page-btn b { font-weight: 700; }
.aic-page-ico { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,.22); font-size: 13px; }

.aic-typing .aic-bubble { display: flex; align-items: center; gap: 10px; color: var(--aic-muted); font-size: 12.5px; }
.aic-dots { display: inline-flex; gap: 4px; }
.aic-dots i { width: 7px; height: 7px; border-radius: 50%; background: #6366f1; animation: aic-dot 1.2s infinite ease-in-out; }
.aic-dots i:nth-child(2) { background: #a855f7; animation-delay: .15s; }
.aic-dots i:nth-child(3) { background: #ec4899; animation-delay: .3s; }

.aic-err .aic-bubble { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.aic-err .aic-btn-grad { margin-top: 8px; padding: 5px 12px; font-size: 12px; }

/* ---------- chips + composer ---------- */
.aic-chips { flex: none; display: flex; gap: 6px; padding: 6px 12px 2px; overflow-x: auto; scrollbar-width: none; }
.aic-chips::-webkit-scrollbar { display: none; }
.aic-chip { flex: none; padding: 5px 11px; border: 1px solid #ddd6fe; border-radius: 999px; background: #fff; color: #5b21b6; font: 12px var(--aic-font); white-space: nowrap; cursor: pointer; transition: background .2s, border-color .2s; }
.aic-chip:hover { background: #f5f3ff; border-color: #a78bfa; }

.aic-form { flex: none; display: flex; align-items: flex-end; gap: 6px; margin: 8px 12px 6px; padding: 6px; background: #fff; border: 1.5px solid var(--aic-line); border-radius: 18px; transition: border-color .2s, box-shadow .2s; }
.aic-form:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(139,92,246,.12); }
.aic-input { flex: 1; min-width: 0; min-height: 22px; max-height: 120px; padding: 7px 4px; border: 0 !important; outline: 0 !important; box-shadow: none !important; resize: none; background: transparent; color: var(--aic-ink); font: 14px/1.4 var(--aic-font); }
.aic-mic, .aic-send { flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .2s, opacity .2s; }
.aic-mic { background: #f3f0ff; color: #6d28d9; }
.aic-mic.rec { background: #fee2e2; color: #dc2626; animation: aic-rec 1.2s infinite; }
.aic-send { background: var(--aic-grad); color: #fff; box-shadow: 0 4px 12px rgba(139,92,246,.35); }
.aic-send:disabled { opacity: .4; cursor: default; box-shadow: none; }
.aic-send:not(:disabled):hover { transform: translateY(-1px) rotate(-10deg); }
.aic-foot { flex: none; padding: 0 12px 8px; color: #9ca3af; font-size: 10.5px; text-align: center; }

/* ---------- animations ---------- */
@keyframes aic-spin { to { transform: rotate(360deg); } }
@keyframes aic-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -2px; } }
@keyframes aic-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.65); opacity: 0; } }
@keyframes aic-blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes aic-glow { 0%,100% { fill: #fde047; } 50% { fill: #fffbeb; } }
@keyframes aic-badge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes aic-wave { 0%,100% { transform: rotate(0); } 20% { transform: rotate(16deg); } 40% { transform: rotate(-10deg); } 60% { transform: rotate(12deg); } 80% { transform: rotate(-4deg); } }
@keyframes aic-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes aic-msg { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes aic-dot { 0%,80%,100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@keyframes aic-caret { 50% { opacity: 0; } }
@keyframes aic-rec { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 50% { box-shadow: 0 0 0 7px rgba(220,38,38,0); } }

/* ---------- mobile ---------- */
@media (max-width: 560px) {
    .aic-panel { top: 0; right: 0; left: 0; bottom: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
    .aic-greet { position: fixed; top: 62px; right: 10px; width: calc(100vw - 20px); max-width: 320px; }
    .aic-greet::before { display: none; }
    .aic-lang button { padding: 5px 5px; }
}
@media (prefers-reduced-motion: reduce) {
    .aic-root *, .aic-panel *, .aic-panel { animation: none !important; transition: none !important; }
}
@media print { .aic-root, .aic-panel { display: none !important; } }
