/* ============================================================
   chatbot-source-scope.css — Selector de origen del chatbot general
   [2026-06-12] Extraído de chatbot-chat.css (regla Anti-Monolith:
   el archivo cruzaba el umbral rojo). Estilos del SourceScopeSelector
   (noticias vs espacios) + chips "Fuentes de tus espacios".
   NOTA: usa @keyframes citedCardIn definida en chatbot-chat.css
   (ambas hojas se cargan en index.html).
   ============================================================ */

/* ── Selector de origen (FAB feed — noticias vs espacios) ─────────────
   Control compacto bajo el header del chat. Colapsado: chip-resumen de
   una línea. Expandido: 3 radios + lista de checkboxes de espacios.
   Paleta violeta de marca (misma escala rgba(124,77,255,*) que
   chat-filters-toggle / chat-suggestion-btn). */
.chat-source-scope {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: var(--surface, #0e1117);
}
.chat-source-scope-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 10px;
    background: rgba(124, 77, 255, 0.08);
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 10px;
    color: #c4b5fd;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.chat-source-scope-summary:hover {
    background: rgba(124, 77, 255, 0.14);
    border-color: rgba(124, 77, 255, 0.35);
}
.chat-source-scope-text {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-source-scope-summary .scope-caret {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.chat-source-scope-summary.expanded .scope-caret { transform: rotate(180deg); }
.chat-source-scope-options {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 6px;
}
.chat-source-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-main, #e6edf3);
    transition: background 0.15s;
}
.chat-source-option:hover { background: rgba(124, 77, 255, 0.08); }
.chat-source-option input[type="radio"],
.chat-source-ws-item input[type="checkbox"] {
    accent-color: var(--accent, #7c3aed);
    margin: 2px 0 0;
    flex-shrink: 0;
    cursor: pointer;
}
.chat-source-option-sub {
    display: block;
    font-size: 0.68rem;
    color: var(--text-dim, #8b949e);
    margin-top: 1px;
}
.chat-source-ws-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 2px 0 2px 24px;
    max-height: 180px;
    overflow-y: auto;
}
.chat-source-ws-group {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.28);
    padding: 6px 6px 2px;
}
.chat-source-ws-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-main, #e6edf3);
    transition: background 0.15s;
}
.chat-source-ws-item:hover { background: rgba(124, 77, 255, 0.08); }
.chat-source-ws-owner {
    display: block;
    font-size: 0.66rem;
    color: var(--text-dim, #8b949e);
}
.chat-source-done-btn {
    align-self: flex-end;
    margin: 6px 6px 2px 0;
    padding: 4px 14px;
    background: var(--accent, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s;
}
.chat-source-done-btn:hover { filter: brightness(1.15); }

/* ── Fuentes de espacios en la respuesta (chips informativos) ────────── */
.chat-ws-source-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.chat-ws-source-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(124, 77, 255, 0.07);
    border: 1px solid rgba(124, 77, 255, 0.22);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.82);
    max-width: 100%;
    animation: citedCardIn 0.35s ease both;
}
.chat-ws-source-icon { flex-shrink: 0; }
.chat-ws-source-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}
.chat-ws-source-ws {
    color: #a78bfa;
    opacity: 0.85;
    white-space: nowrap;
    flex-shrink: 0;
}
.chat-ws-sources-note {
    margin-top: 6px;
    font-size: 0.66rem;
    color: var(--text-dim, #8b949e);
    opacity: 0.8;
}

/* ── Cierre manual de la barra de tendencias (insights) ───────────────
   [2026-06-12] Botón X junto al timer. Va aquí (no en chatbot-chat.css,
   que está al borde del umbral rojo Anti-Monolith). Discreto en reposo,
   violeta al hover — el cierre no es destructivo. */
.insights-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 8px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 6px;
    color: var(--text-dim, #8b949e);
    cursor: pointer;
    opacity: 0.7;
    transition: color 0.18s, background 0.18s, opacity 0.18s;
}
.insights-close:hover {
    opacity: 1;
    color: #c4b5fd;
    background: rgba(124, 77, 255, 0.14);
}
