/* ── Jobs VS AI Chatbot Widget ── */
/* Accent colors are injected as --jvc-accent, --jvc-accent-dark, --jvc-accent-darker via inline CSS */

/* ── Launcher wrapper ── */
.jvc-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}
.jvc-launcher > * { pointer-events: auto; }

/* ── Floating robot button ── */
.jvc-btn {
    position: relative;
    width: 68px;
    height: 68px;
    background: linear-gradient(145deg, var(--jvc-accent, #1a56db) 0%, var(--jvc-accent-darker, #0e3a9e) 100%);
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.22);
    cursor: pointer;
    box-shadow: 0 6px 28px color-mix(in srgb, var(--jvc-accent, #1a56db) 55%, transparent),
                inset 0 1px 0 rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    animation: jvc-float 3.5s ease-in-out infinite;
    flex-shrink: 0;
}
.jvc-btn::before,
.jvc-btn::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--jvc-accent, #1a56db) 28%, transparent);
    animation: jvc-pulse-ring 2.8s ease-out infinite;
    pointer-events: none;
    z-index: -1;
}
.jvc-btn::after { animation-delay: 1.4s; }

.jvc-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 10px 36px color-mix(in srgb, var(--jvc-accent, #1a56db) 68%, transparent),
                inset 0 1px 0 rgba(255,255,255,0.2);
    animation-play-state: paused;
}
.jvc-btn svg { pointer-events: none; }

/* ── Robot SVG element colors ── */
.jvc-robot-pupil   { fill: var(--jvc-accent-dark, #1240a4); }
.jvc-robot-antenna { fill: color-mix(in srgb, var(--jvc-accent, #1a56db) 45%, white); }

.jvc-eye {
    animation: jvc-blink 5s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}
.jvc-eye-r { animation-delay: 0.15s; }

.jvc-antenna-dot {
    animation: jvc-antenna-pulse 2s ease-in-out infinite;
    transform-box: fill-box;
    transform-origin: center;
}

/* ── Unread badge ── */
.jvc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* ── Speech bubble ── */
.jvc-bubble {
    background: #fff;
    border-radius: 14px 14px 4px 14px;
    padding: 11px 15px 11px 13px;
    box-shadow: 0 4px 22px rgba(0,0,0,0.13), 0 1px 4px rgba(0,0,0,0.07);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: #111827;
    max-width: 220px;
    margin-bottom: 10px;
    position: relative;
    border: 1px solid color-mix(in srgb, var(--jvc-accent, #1a56db) 11%, transparent);
    transform-origin: bottom right;
    display: flex;
    align-items: center;
    gap: 9px;
}
.jvc-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 26px;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 8px solid #fff;
}
.jvc-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 9px solid color-mix(in srgb, var(--jvc-accent, #1a56db) 11%, transparent);
    z-index: -1;
}
.jvc-bubble-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--jvc-accent, #1a56db), var(--jvc-accent-dark, #1240a4));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.jvc-bubble-body { flex: 1; }
.jvc-bubble-name {
    font-weight: 700;
    font-size: 11.5px;
    color: var(--jvc-accent, #1a56db);
    margin-bottom: 2px;
    letter-spacing: 0.01em;
}
.jvc-bubble-text { font-size: 12.5px; color: #374151; }

.jvc-bubble-show {
    animation: jvc-bubble-pop 0.38s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
}
.jvc-bubble-hide {
    animation: jvc-bubble-fade 0.25s ease forwards;
}

/* ── Keyframes ── */
@keyframes jvc-float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
@keyframes jvc-pulse-ring {
    0%   { transform: scale(1);    opacity: 0.55; }
    100% { transform: scale(1.72); opacity: 0; }
}
@keyframes jvc-blink {
    0%,88%,100% { transform: scaleY(1); }
    92%          { transform: scaleY(0.07); }
}
@keyframes jvc-antenna-pulse {
    0%,100% { opacity: 0.65; transform: scale(1); }
    50%      { opacity: 1;    transform: scale(1.45); }
}
@keyframes jvc-bubble-pop {
    from { opacity: 0; transform: scale(0.72) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes jvc-bubble-fade {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.88) translateY(5px); }
}
@keyframes jvc-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes jvc-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Chat window ── */
.jvc-window {
    position: fixed;
    bottom: 104px;
    right: 24px;
    width: 360px;
    max-height: 560px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    z-index: 9991;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
    animation: jvc-slide-up 0.22s ease;
}

/* ── Header ── */
.jvc-header {
    background: linear-gradient(135deg, var(--jvc-accent, #1a56db) 0%, var(--jvc-accent-dark, #1240a4) 100%);
    color: #fff;
    padding: 13px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
}
.jvc-header-info { display: flex; align-items: center; gap: 10px; }
.jvc-avatar {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.jvc-header-name { font-weight: 600; font-size: 14px; }
.jvc-header-sub  { font-size: 11px; opacity: 0.82; margin-top: 1px; }

.jvc-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* CV upload icon button in header */
.jvc-cv-btn {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    padding: 0;
    flex-shrink: 0;
    border-radius: 6px;
}
.jvc-cv-btn:hover,
.jvc-cv-btn:focus,
.jvc-cv-btn:active { color: #fff; border: none !important; outline: none !important; box-shadow: none !important; }
.jvc-cv-btn svg { pointer-events: none; }

/* Global tooltip rendered at document level (avoids overflow:hidden clipping) */
.jvc-cv-tooltip-global {
    position: fixed;
    background: rgba(17,24,39,0.92);
    color: #fff;
    font-size: 11.5px;
    line-height: 1.4;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s, transform 0.15s;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.jvc-cv-tooltip-global::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 10px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid rgba(17,24,39,0.92);
}
.jvc-cv-tooltip-global.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.jvc-close-btn {
    background: none; border: none; color: rgba(255,255,255,0.85);
    cursor: pointer; font-size: 20px; line-height: 1; padding: 4px;
    border-radius: 4px; transition: color 0.15s; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
}
.jvc-close-btn:hover { color: #fff; }

/* ── Messages scroll area ── */
.jvc-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}
.jvc-msgs::-webkit-scrollbar { width: 4px; }
.jvc-msgs::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

/* ── Bubbles ── */
.jvc-msg {
    max-width: 88%;
    padding: 10px 13px;
    border-radius: 14px;
    word-break: break-word;
    font-size: 13.5px;
}
.jvc-msg a { color: var(--jvc-accent, #1a56db); word-break: break-all; }
.jvc-msg-user {
    background: var(--jvc-accent, #1a56db);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.jvc-msg-user a { color: color-mix(in srgb, var(--jvc-accent, #1a56db) 30%, white); }
.jvc-msg-bot {
    background: #f3f4f6;
    color: #111827;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* ── Typing dots ── */
.jvc-typing {
    align-self: flex-start;
    display: flex;
    gap: 5px;
    padding: 12px 14px;
    background: #f3f4f6;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}
.jvc-typing span {
    width: 7px; height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: jvc-bounce 1.3s ease-in-out infinite;
}
.jvc-typing span:nth-child(2) { animation-delay: .18s; }
.jvc-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes jvc-bounce {
    0%,80%,100% { transform: translateY(0); }
    40%          { transform: translateY(-6px); }
}

/* ── Input area ── */
.jvc-footer {
    border-top: 1px solid #e5e7eb;
    padding: 10px 12px;
    flex-shrink: 0;
    background: #fff;
}
.jvc-input-row { display: flex; gap: 8px; align-items: flex-end; }
.jvc-input {
    flex: 1;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 110px;
    outline: none;
    transition: border-color 0.15s;
    line-height: 1.45;
}
.jvc-input:focus { border-color: var(--jvc-accent, #1a56db); }
.jvc-send {
    background: var(--jvc-accent, #1a56db);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.15s;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.jvc-send:hover:not(:disabled) { background: var(--jvc-accent-dark, #1240a4); }
.jvc-send:disabled { background: color-mix(in srgb, var(--jvc-accent, #1a56db) 45%, white); cursor: default; }


/* ── Exit-intent overlay ── */
.jvc-exit-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.52);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: jvc-fade 0.2s ease;
}
.jvc-exit-box {
    background: #fff;
    border-radius: 18px;
    padding: 36px 32px 28px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.22);
    animation: jvc-slide-up 0.25s ease;
}
.jvc-exit-emoji { font-size: 48px; margin-bottom: 8px; }
.jvc-exit-box h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: #111827; }
.jvc-exit-box p  { margin: 0 0 22px; color: #6b7280; font-size: 15px; line-height: 1.55; }
.jvc-exit-cta {
    display: block; width: 100%;
    background: var(--jvc-accent, #1a56db); color: #fff;
    border: none; border-radius: 10px;
    padding: 13px 20px; font-size: 15px; font-weight: 600;
    cursor: pointer; margin-bottom: 10px; transition: background 0.15s;
}
.jvc-exit-cta:hover { background: var(--jvc-accent-dark, #1240a4); }
.jvc-exit-dismiss {
    background: none; border: none; color: #9ca3af;
    font-size: 13px; cursor: pointer; transition: color 0.15s;
}
.jvc-exit-dismiss:hover { color: #6b7280; }

/* ── Subscription panel ── */
.jvc-sub-panel {
    border-top: 1px solid #e5e7eb;
    background: color-mix(in srgb, var(--jvc-accent, #1a56db) 6%, white);
    padding: 12px 14px;
    flex-shrink: 0;
}
.jvc-sub-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--jvc-accent, #1a56db); }
.jvc-sub-email,
.jvc-sub-field {
    width: 100%;
    border: 1.5px solid color-mix(in srgb, var(--jvc-accent, #1a56db) 35%, white);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    margin-bottom: 6px;
    box-sizing: border-box;
}
.jvc-sub-email:focus,
.jvc-sub-field:focus { border-color: var(--jvc-accent, #1a56db); }
.jvc-sub-types { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.jvc-sub-types-label { font-size: 12px; color: #374151; font-weight: 600; width: 100%; }
.jvc-sub-type-label {
    display: flex; align-items: center; gap: 4px;
    font-size: 12.5px; color: #374151; cursor: pointer; user-select: none;
}
.jvc-sub-type-label input[type="checkbox"] {
    accent-color: var(--jvc-accent, #1a56db); width: 14px; height: 14px; cursor: pointer;
}
.jvc-sub-consent { margin: 0 0 8px; font-size: 11px; color: #6b7280; line-height: 1.4; }
.jvc-sub-row { display: flex; gap: 8px; }
.jvc-sub-confirm {
    flex: 1; background: var(--jvc-accent, #1a56db); color: #fff;
    border: none; border-radius: 7px;
    padding: 8px 12px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: background 0.15s;
}
.jvc-sub-confirm:hover:not(:disabled) { background: var(--jvc-accent-dark, #1240a4); }
.jvc-sub-confirm:disabled { background: color-mix(in srgb, var(--jvc-accent, #1a56db) 45%, white); cursor: default; }
.jvc-sub-skip {
    background: none; border: 1.5px solid color-mix(in srgb, var(--jvc-accent, #1a56db) 35%, white);
    border-radius: 7px; color: #6b7280; font-size: 13px; padding: 8px 12px; cursor: pointer;
    transition: border-color 0.15s;
}
.jvc-sub-skip:hover { border-color: #9ca3af; color: #374151; }

/* ── Quick-reply buttons ── */
.jvc-quick-replies {
    display: flex; flex-wrap: wrap; gap: 7px;
    padding: 2px 0 4px; align-self: flex-start; max-width: 100%;
}
.jvc-quick-reply-btn {
    background: #fff;
    border: 1.5px solid var(--jvc-accent, #1a56db);
    color: var(--jvc-accent, #1a56db);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.jvc-quick-reply-btn:hover { background: var(--jvc-accent, #1a56db); color: #fff; }

/* ── Utility ── */
.jvc-hidden { display: none !important; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .jvc-window {
        bottom: 0; right: 0; left: 0;
        width: 100%; max-height: 100dvh;
        border-radius: 0;
    }
    .jvc-launcher { bottom: 16px; right: 16px; }
}
