/* Table Styles */

/* Base Table */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 12px;
    text-align: right;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr:hover {
    background: rgba(79, 172, 254, 0.05);
    transition: background 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

/* Responsive Table Container */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.table-responsive .table {
    min-width: 600px;
}

/* Table Variants */
.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(0, 0, 0, 0.03);
}

.table-bordered {
    border: 1px solid #dee2e6;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2e6;
}

.table-sm th,
.table-sm td {
    padding: 8px;
}

/* Response Table Specific */
.response-table {
    margin-top: 20px;
}

.response-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    margin-bottom: -1px;
}

.response-row {
    background: white;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.response-student-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.response-content {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 10px;
}

.response-content p {
    margin-bottom: 8px;
}

.response-content strong {
    color: #495057;
}

/* Sheet View Table */
.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.sheet-table th {
    background: #343a40;
    color: white;
    padding: 10px;
    text-align: right;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 20;
}

.sheet-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
    text-align: right;
}

.sheet-table tbody tr:hover {
    background: #f1f3f5;
}

.sheet-cell-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Table Actions */
.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-search {
    flex: 1;
    max-width: 300px;
}

.table-buttons {
    display: flex;
    gap: 10px;
}

/* Empty State */
.table-empty {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.table-empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.3;
}

.table-empty-text {
    font-size: 1.1rem;
}

/* Table Loading */
.table-loading {
    text-align: center;
    padding: 40px;
}

.table-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* Sortable Headers */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

.table th.sortable:hover {
    background: #e9ecef;
}

.table th.sortable::after {
    content: '↕';
    position: absolute;
    right: 8px;
    opacity: 0.3;
}

.table th.sortable.sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.table th.sortable.sorted-desc::after {
    content: '↓';
    opacity: 1;
}

/* Pagination */
.table-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination-button {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
}
