/**
 * data-table.css — Styles for the DataTable utility component.
 *
 * Extracted from perceptron.css and generalized for reuse.
 * Uses CSS custom properties from tokens.css for theming.
 */

/* ===== WRAPPER ===== */
.data-table-wrapper {
    overflow-y: auto;
    flex: 1;
}

/* ===== TABLE ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table th,
.data-table td {
    padding: 4px 6px;
    text-align: center;
    border-bottom: 1px solid var(--border-light, #eee);
}

/* ===== HEADER ===== */
.data-table th {
    position: sticky;
    top: 0;
    background: var(--bg-subtle, #f8f9fa);
    color: var(--text-muted, #7f8c8d);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    z-index: 1;
    user-select: none;
}

.data-table th[data-sort] {
    cursor: pointer;
}

.data-table th[data-sort]:hover {
    color: var(--text-primary, #2c3e50);
}

/* Sort indicators */
.data-table th.sort-asc::after {
    content: ' ▲';
    font-size: 0.6rem;
}

.data-table th.sort-desc::after {
    content: ' ▼';
    font-size: 0.6rem;
}

/* ===== ROWS ===== */
.data-table tr {
    background: var(--bg-white, #fff);
    transition: background 0.15s ease;
}

.data-table tr:hover {
    background: var(--bg-hover, #f0f7ff);
}

/* Row state classes */
.data-table tr.row-correct {
    background: rgba(46, 204, 113, 0.08);
}

.data-table tr.row-correct:hover {
    background: rgba(46, 204, 113, 0.14);
}

.data-table tr.row-error {
    background: rgba(231, 76, 60, 0.10);
}

.data-table tr.row-error:hover {
    background: rgba(231, 76, 60, 0.16);
}

.data-table tr.row-selected {
    background: rgba(241, 196, 15, 0.18);
    outline: 2px solid var(--accent-yellow, #f1c40f);
    outline-offset: -2px;
}

/* ===== BADGES ===== */
.data-table .label-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.74rem;
    color: #fff;
}

.data-table .label-badge.class-0 {
    background: var(--accent-blue, #3498db);
}

.data-table .label-badge.class-1 {
    background: var(--accent-orange, #e67e22);
}

.data-table .pred-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.74rem;
}

.data-table .pred-badge.correct {
    color: var(--accent-green, #2ecc71);
    background: rgba(46, 204, 113, 0.12);
}

.data-table .pred-badge.wrong {
    color: var(--accent-red, #e74c3c);
    background: rgba(231, 76, 60, 0.12);
    text-decoration: line-through;
}
