/* SemanticNet Presenter — common styles */

/* Full-width layout */
gradio-app, .gradio-container {
    max-width: 100vw !important;
    width: 100% !important;
    padding: 0 16px !important;
    overflow-x: hidden !important;
}
.gradio-container > .main { max-width: 100% !important; width: 100% !important; }

/* Hide orange loading borders */
.pending, .generating { border-color: transparent !important; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 16px 0;
}
.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}
.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #1e293b;
}
.stat-label {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 4px;
}

/* Bar chart */
.bar-chart { margin: 12px 0; }
.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}
.bar-label {
    min-width: 150px;
    font-size: 0.85em;
    text-align: right;
    color: #475569;
}
.bar-track {
    flex: 1;
    height: 20px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 4px;
    transition: width 0.3s ease;
}
.bar-count {
    min-width: 40px;
    font-size: 0.85em;
    color: #64748b;
}

/* Topic pills */
.topic-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.topic-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.82em;
    color: #475569;
}
.topic-pill b {
    color: #1e293b;
}

/* Processing table */
.proc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    margin: 8px 0;
}
.proc-table th, .proc-table td {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
}
.proc-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
}

/* Neighbors table */
.neighbors-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    margin: 8px 0;
}
.neighbors-table th, .neighbors-table td {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}
.neighbors-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
}
.neighbors-table tr:hover {
    background: #f8fafc;
}

/* Search results */
.search-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}
.result-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}
.result-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}
.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.result-rank {
    font-weight: 700;
    color: #3b82f6;
    font-size: 0.9em;
}
.result-score {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}
.result-meta {
    font-size: 0.8em;
    color: #64748b;
}
.result-text {
    font-size: 0.9em;
    line-height: 1.5;
    color: #334155;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.78em;
    font-weight: 500;
}
.badge-cat { background: #dbeafe; color: #1d4ed8; }
.badge-dir { background: #dcfce7; color: #166534; }
.badge-sub { background: #fef3c7; color: #92400e; }
.badge-conf { background: #f1f5f9; color: #475569; }
.badge-topic { background: #e0e7ff; color: #3730a3; }

/* Document view */
.doc-stats {
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 0.9em;
}
.doc-chunks, .doc-claims {
    margin: 8px 0;
}

/* Chapter groups */
.chapter-group {
    margin: 16px 0 8px;
}
.chapter-group h4 {
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

/* Chunk cards */
.chunk-card {
    border-left: 3px solid #93c5fd;
    padding: 8px 12px;
    margin: 6px 0;
    background: #fff;
}
.chunk-time {
    font-size: 0.8em;
    color: #64748b;
    margin-bottom: 4px;
}
.chunk-text {
    font-size: 0.88em;
    line-height: 1.5;
    color: #334155;
}

/* Claim cards */
.claim-category h4 {
    color: #1e293b;
    margin: 16px 0 8px;
}
.claim-card {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    margin: 6px 0;
    background: #fff;
}
.claim-header {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.claim-text {
    font-size: 0.9em;
    line-height: 1.5;
    color: #1e293b;
}
.claim-evidence {
    margin-top: 6px;
    font-size: 0.82em;
    color: #64748b;
    font-style: italic;
    padding-left: 12px;
    border-left: 2px solid #e2e8f0;
}
