/* analyst-bubble.css — change `analyst-bubble` (2026-09-30).

   Principio: el VIOLETA queda reservado para el Analista IA. Todo lo que
   habla el asistente (burbuja del FAB) usa la superficie violeta clara; los
   elementos informativos del feed (tooltip de tarjetas) van en gris neutro
   para no confundirse con él. Se carga después de jobs-ui.css y
   chatbot-fab.css. */

/* ── Tooltip de tarjetas del feed: gris neutro (variante `card`) ── */
.premium-tooltip.premium-tooltip--card {
    background: #1b1b22;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    max-width: 280px;
}
.premium-tooltip.premium-tooltip--card .tip-label {
    color: var(--text-muted);
    font-weight: 500;
}
.premium-tooltip.premium-tooltip--card .tip-arrow::after {
    background: #1b1b22;
    border-right-color: rgba(255, 255, 255, 0.14);
    border-bottom-color: rgba(255, 255, 255, 0.14);
}

/* ── Burbuja del Analista IA (FabInsightsPanel, desktop) ──
   Se diferencia de las tarjetas del feed por FORMA (globo con colita al FAB,
   esquina inferior derecha casi recta), VOZ (avatar + primera persona) y
   SUPERFICIE (--analyst-surface, más clara que la página). */
.fab-insight-panel.analyst-bubble {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 400px;
    box-sizing: border-box;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    border-radius: 20px 20px 6px 20px;
    background: var(--analyst-surface);
    border: 1px solid rgba(167, 139, 250, 0.55);
    box-shadow: 0 0 0 4px var(--sbr-violet-soft), 0 18px 48px rgba(0, 0, 0, 0.6);
    color: var(--cv-text);
    font-size: 13px;
    line-height: 1.5;
    z-index: 1001;
    transform-origin: bottom right;
    animation: analyst-bubble-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
body.cookie-banner-active .fab-insight-panel.analyst-bubble { bottom: 152px; }

/* Colita apuntando al FAB: el centro del FAB queda 28px a la izquierda del
   borde derecho de la burbuja (ambos a right:24px). Sin overflow en la
   burbuja para que la colita no se recorte. */
.fab-insight-panel.analyst-bubble::after {
    content: '';
    position: absolute;
    right: 20px;
    bottom: -9px;
    width: 16px;
    height: 16px;
    background: var(--analyst-surface);
    border-right: 1px solid rgba(167, 139, 250, 0.55);
    border-bottom: 1px solid rgba(167, 139, 250, 0.55);
    transform: rotate(45deg);
}

@keyframes analyst-bubble-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.analyst-bubble__header { display: flex; align-items: center; gap: 10px; }
.analyst-bubble__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.analyst-bubble__heading { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }
.analyst-bubble__title { font-size: 14px; font-weight: 700; color: #fff; }
.analyst-bubble__subtitle { font-size: 11px; color: var(--cv-violet-bright); }
.analyst-bubble__close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--cv-violet-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.analyst-bubble__close:hover { background: rgba(255, 255, 255, 0.12); }
.analyst-bubble__close:focus-visible,
.analyst-chip:focus-visible,
.analyst-cta:focus-visible,
.analyst-rec__main:focus-visible,
.analyst-rec__arrow:focus-visible {
    outline: 2px solid var(--cv-violet-bright);
    outline-offset: 2px;
}

.analyst-bubble__text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--cv-text); }
.analyst-bubble__empty { margin: 0; font-size: 12px; color: var(--cv-text-dim); }

.analyst-bubble__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.analyst-chip {
    font: inherit;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: rgba(139, 92, 246, 0.22);
    color: #ede9fe;
    cursor: pointer;
}
.analyst-chip:hover { background: rgba(139, 92, 246, 0.34); }
.analyst-chip.active { background: var(--accent); color: #fff; }
.analyst-chip--more { background: transparent; border-color: var(--sbr-violet-border); color: var(--cv-violet-bright); }

/* Recomendación compacta (FabCarousel) — miniatura, nunca imagen a sangre. */
.analyst-rec {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(10, 7, 18, 0.55);
}
.analyst-rec__main {
    font: inherit;
    display: flex;
    gap: 12px;
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.analyst-rec__thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--cv-panel); }
.analyst-rec__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.analyst-rec__source { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cv-violet-bright); }
.analyst-rec__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.analyst-rec__main:hover .analyst-rec__title { text-decoration: underline; }
.analyst-rec__nav { display: flex; align-items: center; gap: 4px; }
.analyst-rec__count { font-size: 11px; color: var(--cv-text-dim); margin-right: auto; }
.analyst-rec__arrow {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--cv-violet-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.analyst-rec__arrow:hover { background: rgba(255, 255, 255, 0.12); }

/* Dos acciones con el MISMO peso (decisión del owner). */
.analyst-bubble__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.analyst-bubble__actions--single { grid-template-columns: minmax(0, 1fr); }
.analyst-cta {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    min-height: 44px;
    border-radius: 10px;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}
.analyst-cta:hover { background: var(--cv-violet-deep); }
.analyst-cta:disabled { opacity: 0.45; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
    .fab-insight-panel.analyst-bubble { animation: none; }
}

/* ── Móvil (≤767px) — change `mobile-analyst-bubble` ──
   La pregunta y la burbuja se apilan ENCIMA del FAB (a la izquierda, como en
   desktop, chocarían con el FAB "Grabar"). La burbuja ocupa el ancho con
   12px de margen; la colita sigue apuntando al FAB (centro a right:52px). */
@media (max-width: 767px) {
    .fab-rec-prompt {
        right: 24px;
        bottom: 92px;
        transform: translateY(8px);
        white-space: normal;
        max-width: calc(100vw - 48px);
    }
    .fab-rec-prompt.visible { transform: none; }
    .fab-rec-prompt-yes,
    .fab-rec-prompt-no {
        min-height: 40px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    body.cookie-banner-active .fab-rec-prompt { bottom: 148px; }

    .fab-insight-panel.analyst-bubble {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: 96px;
    }
    .fab-insight-panel.analyst-bubble::after { right: 32px; }
    body.cookie-banner-active .fab-insight-panel.analyst-bubble { bottom: 152px; }

    .fab-longpress-hint {
        position: fixed;
        right: 24px;
        bottom: 92px;
        max-width: calc(100vw - 48px);
        padding: 10px 14px;
        border-radius: 12px;
        border: 1px solid rgba(167, 139, 250, 0.55);
        background: var(--analyst-surface);
        color: var(--cv-text);
        font: inherit;
        font-size: 13px;
        text-align: left;
        z-index: 1050;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
        animation: analyst-bubble-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
    body.cookie-banner-active .fab-longpress-hint { bottom: 148px; }
    /* El FAB se oculta con el scroll: su aviso también. */
    body.view-feed.feed-chrome-hidden .fab-longpress-hint { display: none; }

    /* El toque largo no debe seleccionar texto ni abrir el menú del sistema. */
    .chatbot-fab {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}
@media (min-width: 768px) {
    .fab-longpress-hint { display: none; }
}
