/* ==========================================================================
   Optisoins AI Hub — ingestion multiple & citation des sources
   Chargé par public/index.html en complément de style.css.
   ========================================================================== */

/* --- Zone de dépôt --- */

.rag-dropzone {
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.rag-dropzone.is-dragover {
    background: rgba(99, 102, 241, 0.08) !important;
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.45);
}

/* --- File d'attente d'import --- */

.rag-queue {
    border-color: rgba(99, 102, 241, 0.25) !important;
    max-height: 190px;
    overflow-y: auto;
}

.rag-queue-item + .rag-queue-item {
    border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.rag-progress {
    height: 4px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.rag-progress > span {
    display: block;
    height: 100%;
    background: #4f46e5;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rag-progress > span.is-failed {
    background: #dc2626;
}

/* --- Liste des documents --- */

.rag-doc-item {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rag-doc-item:hover {
    border-color: rgba(99, 102, 241, 0.4) !important;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.08);
}

/* --- Sources affichées sous une réponse IA --- */

.sources-bar {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.sources-toggle {
    background: none;
    border: 0;
    padding: 0;
    color: #4f46e5;
    font-size: 0.75rem;
    font-weight: 600;
}

.sources-toggle:hover { color: #3730a3; }
.sources-toggle:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; border-radius: 4px; }

.sources-chevron { font-size: 0.6rem; opacity: 0.6; }

.sources-bar.is-collapsed .sources-list { display: none !important; }

.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.25);
    background: rgba(99, 102, 241, 0.07);
    color: #1e293b;
    font-size: 0.75rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

a.source-chip:hover {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.5);
    color: #1e293b;
}

.source-chip.is-locked {
    border-style: dashed;
    border-color: rgba(100, 116, 139, 0.4);
    background: rgba(100, 116, 139, 0.08);
    color: #475569;
}

.source-chip-icon { color: #4f46e5; font-size: 0.8rem; }
.source-chip.is-locked .source-chip-icon { color: #64748b; }

.source-chip-name {
    max-width: 16rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.source-chip-meta { color: #64748b; font-size: 0.68rem; }
.source-chip-action { font-size: 0.65rem; opacity: 0.55; }

@media (prefers-reduced-motion: reduce) {
    .rag-progress > span,
    .rag-dropzone,
    .rag-doc-item,
    .source-chip { transition: none; }
}
