/* Website chat assistant (elements/assistant-chat) */

.assistant-chat {
    --ac-ink: #0e1111;
    --ac-muted: #6b7280;
    --ac-line: rgba(14, 17, 17, .08);
    --ac-brand: #523be4;
    --ac-brand-soft: #f1eeff;
    --ac-bubble: #f1f4f9;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1040;
    font-size: .95rem;
    color: var(--ac-ink);
}

.assistant-launcher {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: var(--ac-brand);
    color: #fff;
    box-shadow: 0 8px 24px rgba(82, 59, 228, .35);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.assistant-launcher:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(82, 59, 228, .4); }
.assistant-launcher:focus-visible { outline: 3px solid rgba(82, 59, 228, .35); outline-offset: 3px; }
.assistant-launcher-close { display: none; }
.assistant-chat.is-open .assistant-launcher-open { display: none; }
.assistant-chat.is-open .assistant-launcher-close { display: flex; }

.assistant-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: flex;
    flex-direction: column;
    width: 390px;
    height: min(620px, calc(100vh - 120px));
    overflow: hidden;
    border: 1px solid var(--ac-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(14, 17, 17, .18);
}
.assistant-panel[hidden] { display: none; }

.assistant-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .85rem .9rem .85rem 1rem;
    background: var(--ac-ink);
    color: #fff;
}
.assistant-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ac-brand);
}
.assistant-header-text { flex: 1; min-width: 0; }
.assistant-title { font-weight: 700; line-height: 1.2; }
.assistant-subtitle { font-size: .78rem; color: rgba(255, 255, 255, .65); }
.assistant-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
}
.assistant-icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
}

.assistant-msg { display: flex; margin-bottom: .75rem; }
.assistant-msg.is-user { justify-content: flex-end; }
.assistant-bubble {
    max-width: 85%;
    padding: .65rem .85rem;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}
.assistant-msg.is-bot .assistant-bubble { background: var(--ac-bubble); border-top-left-radius: 6px; }
.assistant-msg.is-user .assistant-bubble { background: var(--ac-brand); color: #fff; border-top-right-radius: 6px; }
.assistant-bubble ul { margin: .35rem 0 0; padding-left: 1.1rem; }
.assistant-bubble li { margin-bottom: .2rem; }
.assistant-bubble a { color: var(--ac-brand); font-weight: 600; }
.assistant-msg.is-user .assistant-bubble a { color: #fff; }

.assistant-typing { display: inline-flex; gap: 4px; padding: .2rem 0; }
.assistant-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ac-muted);
    animation: assistant-bounce 1.2s infinite ease-in-out;
}
.assistant-typing span:nth-child(2) { animation-delay: .15s; }
.assistant-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes assistant-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* Job cards + links under an answer */
.assistant-results { margin: -.25rem 0 .9rem; }
.assistant-job {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .7rem;
    margin-bottom: .45rem;
    border: 1px solid var(--ac-line);
    border-radius: 12px;
    background: #fff;
    color: var(--ac-ink);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.assistant-job:hover { border-color: rgba(82, 59, 228, .4); box-shadow: 0 4px 12px rgba(14, 17, 17, .06); color: var(--ac-ink); text-decoration: none; }
.assistant-job-logo {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--ac-bubble) center / contain no-repeat;
}
.assistant-job-text { min-width: 0; }
.assistant-job-title { font-weight: 600; font-size: .9rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.assistant-job-meta { font-size: .78rem; color: var(--ac-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assistant-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.assistant-link {
    display: inline-flex;
    align-items: center;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: var(--ac-brand-soft);
    color: var(--ac-brand);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
}
.assistant-link:hover { background: #e4ddff; color: var(--ac-brand); text-decoration: none; }

.assistant-quick { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1rem .6rem; }
.assistant-quick[hidden] { display: none; }
.assistant-quick button {
    padding: .4rem .8rem;
    border: 1px solid rgba(14, 17, 17, .2);
    border-radius: 999px;
    background: #fff;
    color: var(--ac-ink);
    font-size: .85rem;
    cursor: pointer;
}
.assistant-quick button:hover { border-color: var(--ac-brand); color: var(--ac-brand); }

.assistant-form {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 0 .75rem;
    padding: .35rem .35rem .35rem 1rem;
    border: 1px solid var(--ac-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(14, 17, 17, .05);
}
.assistant-form:focus-within { border-color: var(--ac-brand); }
.assistant-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ac-ink); }
.assistant-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: var(--ac-brand);
    color: #fff;
    cursor: pointer;
}
.assistant-form button:disabled { opacity: .5; cursor: default; }
.assistant-footnote { padding: .45rem 1rem .7rem; font-size: .72rem; color: var(--ac-muted); text-align: center; }

@media (max-width: 575.98px) {
    .assistant-chat { right: 14px; bottom: 14px; }
    .assistant-chat.is-open .assistant-launcher { display: none; }
    .assistant-panel {
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        border: 0;
        border-radius: 0;
    }
}
