/* Ask Isvar AI - floating assistant (self-contained, no impact on existing styles) */

/* the site's bottom search pill is replaced by the AI dock on desktop
   (this stylesheet loads only on company pages, so other pages keep the search) */
@media (min-width: 601px) {
    .infyner-bottom-search { display: none !important; }
}

/* ---- bottom-center AI dock (desktop) ---- */
.isvar-dock {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    z-index: 99980;
    width: min(720px, calc(100vw - 28px));
    display: flex; align-items: center; gap: 8px;
    background: #fff; border-radius: 22px;
    padding: 4px 6px 4px 10px;
    border: 1.5px solid transparent;
    background-image: linear-gradient(#fff, #fff), linear-gradient(135deg, #4f46e5, #a855f7, #4f46e5);
    background-origin: border-box; background-clip: padding-box, border-box;
    box-shadow: 0 8px 26px rgba(79, 70, 229, .22);
    cursor: text;
    animation: isvarDockGlow 3s ease-in-out infinite;
}
@keyframes isvarDockGlow {
    0%, 100% { box-shadow: 0 8px 26px rgba(79, 70, 229, .18); }
    50%      { box-shadow: 0 8px 30px rgba(124, 58, 237, .38); }
}
.isvar-dock input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 12.5px; color: #1f2937; height: 26px; text-overflow: ellipsis;
}
.isvar-dock-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
    border: none; border-radius: 12px; padding: 5px 13px; font-size: 11px; font-weight: 700;
    letter-spacing: .04em; flex-shrink: 0; cursor: pointer;
}
.isvar-dock-badge:hover { opacity: .9; }
.isvar-dock-badge:disabled { opacity: .5; cursor: default; }
.isvar-ai-glyph {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px; border-radius: 50%;
    background: rgba(255, 255, 255, .22); font-size: 9.5px;
    animation: isvarGlyph 2.4s ease-in-out infinite;
}
@keyframes isvarGlyph {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50%      { transform: rotate(-12deg) scale(1.15); }
}

.isvar-fab-icon-wrap, .isvar-head-icon-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.isvar-fab-icon { width: 24px; height: 24px; border-radius: 50%; background: #fff; object-fit: contain; padding: 2px; border: 1px solid #eef2ff; }

/* "live" pulse ring around the icon */
.isvar-pulse {
    position: absolute; inset: -3px; border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, .65);
    animation: isvarPulse 1.8s ease-out infinite;
    pointer-events: none;
}
@keyframes isvarPulse {
    0%   { transform: scale(.8); opacity: .9; }
    70%  { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* green "online" dot */
.isvar-live-dot {
    position: absolute; right: -1px; bottom: -1px;
    width: 9px; height: 9px; border-radius: 50%;
    background: #22c55e; border: 2px solid #fff;
    animation: isvarLive 1.6s ease-in-out infinite;
}
.isvar-live-dot-head { right: 0; bottom: 0; }
@keyframes isvarLive { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); } }

.isvar-live-label {
    display: inline-block; vertical-align: middle; margin-left: 6px;
    background: rgba(255,255,255,.2); color: #d1fae5;
    font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    border-radius: 8px; padding: 1px 7px;
}

.isvar-panel {
    /* opens centered, just above the AI dock */
    position: fixed; left: 50%; bottom: 62px; transform: translateX(-50%);
    z-index: 99990;
    width: min(720px, calc(100vw - 28px));   /* matches the dock width exactly */
    height: 560px; max-height: calc(100vh - 110px);
    background: #fff; border-radius: 16px; overflow: hidden;
    display: flex; flex-direction: column;
    /* shadow cast upwards only, so the dock input below stays fully clear */
    box-shadow: 0 -14px 44px rgba(17, 24, 39, .22);
    border: 1px solid #e5e7eb;
    transition: width .25s ease, height .25s ease;
}

/* expanded: centered premium mode */
.isvar-panel.isvar-expanded {
    right: auto; bottom: auto; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    width: 820px; max-width: calc(100vw - 40px);
    height: 84vh; max-height: calc(100vh - 40px);
    box-shadow: 0 30px 90px rgba(17, 24, 39, .45);
}
.isvar-panel.isvar-expanded .isvar-bubble { max-width: 75%; }

.isvar-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff;
}
.isvar-head-icon { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: contain; padding: 3px; }
.isvar-head-text { flex: 1; min-width: 0; }
.isvar-title { font-size: 14.5px; font-weight: 700; }
.isvar-sub { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isvar-icon-btn {
    background: rgba(255,255,255,.15); border: none; color: #fff;
    width: 28px; height: 28px; border-radius: 8px; font-size: 16px; line-height: 1;
    cursor: pointer;
}
.isvar-icon-btn:hover { background: rgba(255,255,255,.3); }

.isvar-body {
    flex: 1; overflow-y: auto; padding: 14px 12px;
    background: #f8fafc; display: flex; flex-direction: column; gap: 10px;
}

.isvar-msg { display: flex; gap: 8px; align-items: flex-end; }
.isvar-msg-user { justify-content: flex-end; }
.isvar-avatar {
    width: 24px; height: 24px; border-radius: 50%; background: #fff;
    border: 1px solid #e5e7eb; object-fit: contain; padding: 2px; flex-shrink: 0;
}
.isvar-bubble {
    max-width: 84%; padding: 9px 12px; font-size: 13px; line-height: 1.55;
    border-radius: 14px 14px 14px 3px; background: #fff; color: #1f2937;
    border: 1px solid #eceef2; word-wrap: break-word;
}
.isvar-msg-user .isvar-bubble {
    background: #4f46e5; color: #fff; border: none;
    border-radius: 14px 14px 3px 14px;
}
.isvar-bubble a { color: #4f46e5; font-weight: 600; text-decoration: none; }
.isvar-bubble a:hover { text-decoration: underline; }
.isvar-msg-user .isvar-bubble a { color: #e0e7ff; }

.isvar-caret {
    display: inline-block; width: 7px; height: 14px; margin-left: 2px;
    background: #4f46e5; vertical-align: text-bottom; border-radius: 1px;
    animation: isvarCaret .8s step-end infinite;
}
@keyframes isvarCaret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.isvar-typing span {
    display: inline-block; width: 6px; height: 6px; margin-right: 3px;
    background: #a5b4fc; border-radius: 50%; animation: isvarBlink 1.2s infinite;
}
.isvar-typing span:nth-child(2) { animation-delay: .2s; }
.isvar-typing span:nth-child(3) { animation-delay: .4s; }
.isvar-typing em { font-size: 11px; color: #9ca3af; margin-left: 6px; font-style: normal; }
@keyframes isvarBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.isvar-chart-wrap { margin-top: 10px; background: #fff; border-radius: 8px; max-height: 220px; }
.isvar-chart-wrap canvas { max-height: 210px; }

.isvar-table-wrap { overflow-x: auto; margin: 9px 0; -webkit-overflow-scrolling: touch; }
.isvar-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.isvar-table th, .isvar-table td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: right; white-space: nowrap; }
.isvar-table th:first-child, .isvar-table td:first-child { text-align: left; }
.isvar-table thead th { background: #f3f4f6; color: #111827; font-weight: 700; }
.isvar-table tbody tr:nth-child(even) { background: #fafafa; }

.isvar-sources { margin-top: 9px; font-size: 11px; color: #6b7280; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.isvar-source-chip {
    display: inline-block; background: #eef2ff; color: #4f46e5 !important;
    border-radius: 10px; padding: 2px 9px; font-size: 11px; font-weight: 600; text-decoration: none;
}
.isvar-source-chip:hover { background: #e0e7ff; text-decoration: none; }

.isvar-upsell { margin-top: 10px; }
.isvar-upgrade-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff !important;
    border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 700; text-decoration: none;
}
.isvar-upgrade-btn:hover { opacity: .92; text-decoration: none; }

.isvar-chips { display: flex; gap: 6px; flex-wrap: wrap; padding-left: 32px; }
.isvar-chip {
    background: #fff; border: 1px solid #dbe2ea; color: #4b5563;
    border-radius: 14px; padding: 5px 11px; font-size: 11.5px; cursor: pointer;
    transition: all .15s;
}
.isvar-chip:hover { border-color: #4f46e5; color: #4f46e5; }

.isvar-foot {
    display: flex; gap: 8px; padding: 8px 12px 4px; background: #fff;
    border-top: 1px solid #eceef2; align-items: center;
}
.isvar-input-wrap { position: relative; flex: 1; display: flex; align-items: center; }
.isvar-input-icon {
    position: absolute; left: 9px; width: 18px; height: 18px;
    border-radius: 50%; object-fit: contain; pointer-events: none;
}
.isvar-foot input {
    flex: 1; width: 100%; border: 1px solid #dbe2ea; border-radius: 14px;
    padding: 3px 12px 3px 30px; font-size: 12.5px; height: 28px; outline: none;
    text-overflow: ellipsis;
}
.isvar-foot input:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.isvar-send {
    width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font-size: 12.5px;
    flex-shrink: 0;
}
.isvar-send:disabled { opacity: .5; cursor: default; }

.isvar-disclaimer {
    text-align: center; font-size: 10px; color: #9ca3af;
    padding: 2px 0 8px; background: #fff;
}

/* ---- mobile: AI hidden entirely, the site's search pill stays (slimmer) ---- */
@media (max-width: 600px) {
    .isvar-dock, .isvar-panel { display: none !important; }

    .infyner-bottom-search-pill { padding: 3px 6px 3px 10px !important; }
    .infyner-bottom-search-input { height: 32px !important; font-size: 13px !important; }
    .infyner-bottom-search-pill-brand img { width: 22px !important; height: 22px !important; }
}
