/**
 * Table Styles
 * Styles for the mistakes table
 */

.table-container {
    overflow-x: auto;
    margin: 0 calc(-1 * var(--spacing-lg));
    padding: 0 var(--spacing-lg);
}

#mistakes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}

#mistakes-table thead {
    background-color: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#mistakes-table th {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
    white-space: normal;
    line-height: 1.2;
}

#mistakes-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

#mistakes-table tbody tr:hover {
    background-color: #f8f9fa;
}

#mistakes-table tbody tr.no-data-row:hover {
    background-color: transparent;
}

#mistakes-table td {
    padding: var(--spacing-md);
    vertical-align: middle;
}

/* Column Widths */
.col-position {
    width: 180px;
    min-width: 180px;
}

.col-played-move,
.col-best-move {
    width: 70px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
}

.col-eval {
    width: 60px;
    font-weight: 500;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.col-severity {
    width: 90px;
    text-align: center;
}

.col-category {
    width: 90px;
}

.col-subcategory {
    width: 100px;
}

.col-game {
    width: 150px;
    max-width: 180px;
    font-size: 0.9em;
    line-height: 1.3;
}

.col-comment {
    width: 150px;
    max-width: 200px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.col-actions {
    width: 70px;
    text-align: center;
}

/* Mini Board Styling */
.mini-board {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Severity Badges */
.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 1rem;
    white-space: nowrap;
}

.severity-blunder {
    background-color: var(--blunder-color);
    color: #fff;
}

.severity-mistake {
    background-color: var(--mistake-color);
    color: #fff;
}

.severity-inaccuracy {
    background-color: var(--inaccuracy-color);
    color: #212529;
}

/* Empty State */
.no-data-row td {
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive Table */
@media (max-width: 1200px) {
    .table-container {
        margin: 0 calc(-1 * var(--spacing-md));
        padding: 0 var(--spacing-md);
    }

    .col-position {
        width: 150px;
        min-width: 150px;
    }

    .mini-board {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 768px) {
    #mistakes-table {
        font-size: 0.75rem;
    }

    #mistakes-table th,
    #mistakes-table td {
        padding: var(--spacing-sm);
    }

    .col-position {
        width: 120px;
        min-width: 120px;
    }

    .mini-board {
        width: 110px;
        height: 110px;
    }

    .col-played-move,
    .col-best-move,
    .col-eval {
        font-size: 0.7rem;
    }

    .severity-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Hide some columns on mobile */
    .col-subcategory {
        display: none;
    }
}

@media (max-width: 480px) {
    .col-category {
        display: none;
    }

    .col-eval {
        width: 70px;
        font-size: 0.65rem;
    }
}
