/* Atomquark AI assistant widget (wwwroot/js/chat-widget.js) - "midnight aurora" theme */
.aqc-root {
    --aqc-bg: #070a17;
    --aqc-bg-2: #0d1226;
    --aqc-glass: rgba(255, 255, 255, 0.055);
    --aqc-glass-2: rgba(255, 255, 255, 0.09);
    --aqc-line: rgba(255, 255, 255, 0.09);
    --aqc-text: #e8ebff;
    --aqc-muted: #8b93b8;
    --aqc-indigo: #6366f1;
    --aqc-violet: #a855f7;
    --aqc-cyan: #22d3ee;
    --aqc-pink: #ec4899;
    --aqc-grad: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #22d3ee 100%);
    --aqc-ring: conic-gradient(from var(--aqc-angle, 0deg), #6366f1, #a855f7, #ec4899, #22d3ee, #6366f1);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.aqc-root *, .aqc-root *::before, .aqc-root *::after { box-sizing: border-box; }
/* The site's theme styles p/li/h3 globally; pin the widget's own typography so it never inherits them. */
.aqc-root p, .aqc-root li, .aqc-root span, .aqc-root h3 { font-family: inherit; letter-spacing: normal; text-transform: none; }
.aqc-panel p, .aqc-panel li { color: inherit; font-size: inherit; line-height: inherit; }
@property --aqc-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes aqc-rotate { to { --aqc-angle: 360deg; } }
@keyframes aqc-spin { to { transform: rotate(360deg); } }

/* The template's scroll-to-top button shares this corner; lift it above the launcher. */
#scrollTop { bottom: 112px !important; }

/* ================= The orb (launcher, header, hero, avatars) ================= */
.aqc-orb {
    position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
    isolation: isolate;
}
.aqc-orb::before {               /* morphing plasma */
    content: ""; position: absolute; inset: 0; border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, 0) 32%),
        radial-gradient(circle at 70% 70%, #22d3ee 0%, rgba(34, 211, 238, 0) 55%),
        radial-gradient(circle at 75% 25%, #ec4899 0%, rgba(236, 72, 153, 0) 50%),
        linear-gradient(135deg, #4f46e5, #a855f7);
    animation: aqc-morph 7s ease-in-out infinite, aqc-spin 14s linear infinite;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, .35);
}
.aqc-orb::after {                /* glow */
    content: ""; position: absolute; inset: -30%; border-radius: 50%; z-index: -1;
    background: radial-gradient(circle, rgba(139, 92, 246, .55), rgba(34, 211, 238, .15) 50%, transparent 70%);
    filter: blur(8px); animation: aqc-breathe 3.2s ease-in-out infinite;
}
@keyframes aqc-morph {
    0%, 100% { border-radius: 42% 58% 63% 37% / 45% 40% 60% 55%; }
    33% { border-radius: 63% 37% 45% 55% / 55% 62% 38% 45%; }
    66% { border-radius: 38% 62% 52% 48% / 38% 50% 50% 62%; }
}
@keyframes aqc-breathe { 0%, 100% { opacity: .6; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.08); } }
.aqc-orb.sm { width: 26px; height: 26px; }
.aqc-orb.sm::after { inset: -20%; filter: blur(5px); }
.aqc-orb.xl { width: 112px; height: 112px; }
.aqc-orb.xl::after { inset: -45%; filter: blur(20px); }
.aqc-thinking .aqc-orb::before, .aqc-busy .aqc-head .aqc-orb::before { animation-duration: 1.6s, 3s; }
.aqc-thinking .aqc-orb::after, .aqc-busy .aqc-head .aqc-orb::after { animation-duration: 1s; }

/* ================= Launcher ================= */
.aqc-launcher {
    position: fixed; right: 26px; bottom: 26px; z-index: 9998;
    display: flex; align-items: center; gap: 0; height: 68px; padding: 0 12px;
    border: 0; border-radius: 34px; cursor: pointer; color: #fff;
    background: rgba(7, 10, 23, .92);
    box-shadow: 0 18px 50px rgba(79, 70, 229, .45), 0 0 0 1px rgba(255, 255, 255, .08) inset;
    transition: gap .35s ease, padding .35s ease, transform .25s ease, box-shadow .25s ease;
}
.aqc-launcher::before {          /* animated neon ring */
    content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1;
    background: var(--aqc-ring); animation: aqc-rotate 4s linear infinite;
}
.aqc-launcher::after {           /* halo */
    content: ""; position: absolute; inset: -14px; border-radius: inherit; z-index: -2;
    background: var(--aqc-grad); filter: blur(24px); opacity: .5; animation: aqc-breathe 3.2s ease-in-out infinite;
}
.aqc-launcher .aqc-label {
    max-width: 0; overflow: hidden; white-space: nowrap; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
    transition: max-width .4s ease, opacity .3s ease; opacity: 0;
}
.aqc-launcher:hover, .aqc-launcher.aqc-wide { gap: 12px; padding: 0 22px 0 12px; transform: translateY(-2px); }
.aqc-launcher:hover .aqc-label, .aqc-launcher.aqc-wide .aqc-label { max-width: 200px; opacity: 1; }
.aqc-launcher .aqc-spark {     /* floating particles */
    position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; opacity: 0;
    animation: aqc-float 3.6s ease-in-out infinite;
}
.aqc-launcher .aqc-spark:nth-of-type(1) { left: 14px; top: 10px; animation-delay: 0s; }
.aqc-launcher .aqc-spark:nth-of-type(2) { left: 46px; top: 14px; animation-delay: 1.2s; background: #22d3ee; }
.aqc-launcher .aqc-spark:nth-of-type(3) { left: 30px; top: 50px; animation-delay: 2.4s; background: #f0abfc; }
@keyframes aqc-float { 0% { opacity: 0; transform: translateY(0) scale(.5); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scale(1.2); } }

.aqc-nudge {
    position: fixed; right: 26px; bottom: 110px; z-index: 9998; max-width: 260px;
    padding: 14px 16px; border-radius: 18px 18px 6px 18px;
    background: rgba(13, 18, 38, .92); color: var(--aqc-text); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 20px 50px rgba(7, 10, 23, .45);
    font-size: 14px; font-weight: 500; line-height: 1.45; cursor: pointer;
    opacity: 0; transform: translateY(10px) scale(.96); pointer-events: none; transition: opacity .4s ease, transform .4s ease;
}
.aqc-nudge.show { opacity: 1; transform: none; pointer-events: auto; }
.aqc-nudge b { background: var(--aqc-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.aqc-open .aqc-launcher, .aqc-open .aqc-nudge { display: none; }

/* ================= Panel ================= */
.aqc-panel {
    position: fixed; right: 24px; bottom: 24px; z-index: 9999;
    width: 420px; height: min(700px, calc(100vh - 48px));
    display: none; flex-direction: column; overflow: hidden;
    background: var(--aqc-bg); color: var(--aqc-text);
    border-radius: 28px; font-size: 14.5px; line-height: 1.62;
    box-shadow: 0 40px 100px rgba(7, 10, 23, .55), 0 0 0 1px rgba(255, 255, 255, .08) inset;
    isolation: isolate;
}
.aqc-panel::before {             /* neon border */
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 3; pointer-events: none;
    background: var(--aqc-ring); animation: aqc-rotate 6s linear infinite;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7;
}
.aqc-aurora {                    /* drifting aurora behind everything */
    position: absolute; inset: -20% -20% auto -20%; height: 70%; z-index: -1; pointer-events: none; filter: blur(50px); opacity: .55;
    background:
        radial-gradient(40% 50% at 20% 30%, rgba(99, 102, 241, .9), transparent 70%),
        radial-gradient(35% 45% at 80% 20%, rgba(236, 72, 153, .55), transparent 70%),
        radial-gradient(45% 50% at 60% 60%, rgba(34, 211, 238, .5), transparent 70%);
    animation: aqc-drift 16s ease-in-out infinite alternate;
}
@keyframes aqc-drift { from { transform: translate3d(-4%, -2%, 0) rotate(0deg); } to { transform: translate3d(6%, 4%, 0) rotate(8deg); } }
.aqc-grid {                      /* faint tech grid */
    position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
    background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 55%); mask-image: linear-gradient(to bottom, #000 0%, transparent 55%);
}
.aqc-open .aqc-panel { display: flex; animation: aqc-pop .45s cubic-bezier(.16, 1, .3, 1); transform-origin: bottom right; }
@keyframes aqc-pop { from { opacity: 0; transform: translateY(30px) scale(.9); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

.aqc-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px 20px; }
.aqc-head-text { min-width: 0; }
.aqc-panel .aqc-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: #fff; display: flex; align-items: center; gap: 8px; }
.aqc-badge {
    font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px;
    background: rgba(99, 102, 241, .18); color: #c7d2fe; border: 1px solid rgba(129, 140, 248, .35);
}
.aqc-panel .aqc-status { margin: 2px 0 0; font-size: 12.5px; color: var(--aqc-muted); display: flex; align-items: center; gap: 7px; }
.aqc-status i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 10px #34d399; }
.aqc-head-actions { margin-left: auto; display: flex; gap: 4px; }
.aqc-icon-btn {
    width: 38px; height: 38px; padding: 0; border: 0; border-radius: 12px; cursor: pointer;
    background: transparent; color: var(--aqc-muted); display: grid; place-items: center; transition: background .2s, color .2s;
}
.aqc-icon-btn:hover { background: var(--aqc-glass-2); color: #fff; }
.aqc-icon-btn svg { width: 18px; height: 18px; }

/* ================= Body / welcome ================= */
.aqc-body { flex: 1; overflow-y: auto; scroll-behavior: smooth; overscroll-behavior: contain; }
.aqc-body::-webkit-scrollbar { width: 6px; }
.aqc-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 3px; }

.aqc-welcome { padding: 22px 22px 6px; text-align: center; }
.aqc-welcome .aqc-orb { margin: 18px auto 26px; }
.aqc-welcome h3 { margin: 0 0 8px; font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; color: #fff; }
.aqc-welcome h3 span {
    background: linear-gradient(90deg, #a5b4fc, #f0abfc, #67e8f9, #a5b4fc); background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: aqc-shine 5s linear infinite;
}
@keyframes aqc-shine { to { background-position: 200% center; } }
.aqc-panel .aqc-welcome p { margin: 0 auto 22px; max-width: 320px; color: var(--aqc-muted); font-size: 14px; }
.aqc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.aqc-card {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow: hidden;
    background: var(--aqc-glass); border: 1px solid var(--aqc-line); border-radius: 18px;
    color: var(--aqc-text); font: 600 13.5px/1.35 inherit; cursor: pointer;
    transition: transform .25s ease, border-color .25s ease, background .25s ease;
    animation: aqc-rise .5s ease-out both;
}
.aqc-card:nth-child(2) { animation-delay: .06s; } .aqc-card:nth-child(3) { animation-delay: .12s; } .aqc-card:nth-child(4) { animation-delay: .18s; }
.aqc-card::after {               /* hover sheen */
    content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%);
    transform: translateX(-100%); transition: transform .6s ease;
}
.aqc-card:hover { transform: translateY(-3px); border-color: rgba(165, 180, 252, .45); background: var(--aqc-glass-2); }
.aqc-card:hover::after { transform: translateX(100%); }
.aqc-card i {
    width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 14px; color: #fff;
    background: var(--aqc-grad); box-shadow: 0 6px 18px rgba(139, 92, 246, .4);
}

/* ================= Messages ================= */
.aqc-messages { padding: 8px 16px 10px; }
.aqc-msg { display: flex; gap: 10px; margin-bottom: 16px; animation: aqc-rise .35s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes aqc-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.aqc-msg.user { justify-content: flex-end; }
.aqc-msg.bot .aqc-orb { margin-top: 4px; }
.aqc-bubble { max-width: 84%; padding: 11px 15px; border-radius: 20px; overflow-wrap: anywhere; }
.aqc-msg.bot .aqc-bubble {
    color: var(--aqc-text);
    background: var(--aqc-glass); border: 1px solid var(--aqc-line); border-top-left-radius: 6px;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.aqc-msg.user .aqc-bubble {
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border-top-right-radius: 6px;
    box-shadow: 0 10px 26px rgba(99, 102, 241, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.aqc-bubble p { margin: 0 0 8px; }
.aqc-bubble p:last-child { margin-bottom: 0; }
.aqc-bubble ul { margin: 6px 0 8px; padding: 0; list-style: none; }
.aqc-bubble li { position: relative; padding-left: 18px; margin-bottom: 5px; }
.aqc-bubble li::before {
    content: ""; position: absolute; left: 3px; top: .6em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg);
    background: var(--aqc-grad); box-shadow: 0 0 8px rgba(139, 92, 246, .7);
}
.aqc-bubble strong { color: #fff; font-weight: 650; }
.aqc-bubble a:not(.aqc-linkcard) { color: #a5b4fc; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(165, 180, 252, .4); }
.aqc-bubble a:not(.aqc-linkcard):hover { color: #c7d2fe; border-bottom-color: #c7d2fe; }
.aqc-cursor { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: text-bottom; border-radius: 2px; background: var(--aqc-grad); animation: aqc-blink .8s steps(2) infinite; }
@keyframes aqc-blink { 50% { opacity: 0; } }

.aqc-linkcard {
    display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 11px 12px;
    border-radius: 14px; background: rgba(99, 102, 241, .12); border: 1px solid rgba(129, 140, 248, .3);
    color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; transition: background .2s, border-color .2s, transform .2s;
}
.aqc-linkcard:hover { background: rgba(99, 102, 241, .22); border-color: rgba(165, 180, 252, .6); transform: translateX(2px); color: #fff; }
.aqc-linkcard .aqc-lc-icon { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--aqc-grad); font-size: 12px; }
.aqc-linkcard .aqc-lc-text { flex: 1; min-width: 0; }
.aqc-linkcard .aqc-lc-text small { display: block; color: var(--aqc-muted); font-weight: 500; font-size: 11.5px; }
.aqc-linkcard .aqc-lc-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.aqc-lead-ok {
    position: relative; display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 14px;
    background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .35); color: #6ee7b7; font-size: 13px; font-weight: 600;
}
.aqc-burst { position: absolute; left: 22px; top: 50%; width: 0; height: 0; pointer-events: none; }
.aqc-burst i {
    position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--c);
    animation: aqc-burst .9s cubic-bezier(.16, 1, .3, 1) forwards; transform: rotate(var(--a)) translateX(0);
}
@keyframes aqc-burst { to { transform: rotate(var(--a)) translateX(46px) scale(.3); opacity: 0; } }

/* Thinking state */
.aqc-thinking .aqc-bubble { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.aqc-think-text {
    font-size: 13.5px; font-weight: 500;
    background: linear-gradient(90deg, var(--aqc-muted) 0%, #fff 50%, var(--aqc-muted) 100%); background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: aqc-shine 1.8s linear infinite;
}

/* ================= Composer ================= */
.aqc-composer { padding: 10px 14px 12px; }
.aqc-form {
    position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 18px;
    border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid var(--aqc-line);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.aqc-form:focus-within { border-color: rgba(165, 180, 252, .55); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 4px rgba(99, 102, 241, .18), 0 0 30px rgba(139, 92, 246, .25); }
.aqc-input {
    flex: 1; min-height: 38px; max-height: 120px; padding: 8px 0; border: 0; outline: none; resize: none;
    background: transparent; color: #fff; font: inherit; font-size: 14.5px; line-height: 1.5;
}
.aqc-input::placeholder { color: #6b7399; }
.aqc-send {
    flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--aqc-grad); color: #fff; display: grid; place-items: center;
    box-shadow: 0 6px 20px rgba(139, 92, 246, .55); transition: transform .2s, opacity .2s, box-shadow .2s;
}
.aqc-send:hover:not(:disabled) { transform: scale(1.08) rotate(-8deg); }
.aqc-send:disabled { opacity: .3; cursor: default; box-shadow: none; }
.aqc-send svg { width: 18px; height: 18px; }
.aqc-panel .aqc-foot { margin: 9px 0 0; text-align: center; font-size: 11px; color: #5d6489; }
.aqc-foot a { color: var(--aqc-muted); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 520px) {
    .aqc-launcher { right: 16px; bottom: 16px; height: 62px; }
    .aqc-nudge { right: 16px; bottom: 92px; max-width: 230px; }
    .aqc-panel .aqc-status { font-size: 12px; }
    .aqc-status .aqc-hide-sm { display: none; }
    .aqc-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
    .aqc-panel::before { display: none; }
    .aqc-welcome .aqc-orb.xl { width: 92px; height: 92px; }
    .aqc-cards { grid-template-columns: 1fr 1fr; }
    #scrollTop { bottom: 96px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .aqc-root *, .aqc-root *::before, .aqc-root *::after { animation: none !important; transition: none !important; }
}
