/* Base table styling - works without JavaScript */
.display {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 100, 164, 0.1);
}

.display thead {
    background-image: linear-gradient(to right, #1b3d6d 0%, #255799 50%, #0083b3 80%, #00b0ca 100%);
    color: white;
}

.display th {
    padding: 15px 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 3px solid var(--color-uci-gold);
}

.th-label {
    white-space: nowrap;
}

.th-label i {
    margin-right: 8px;
}

.display tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.display tbody tr:nth-child(even) {
    background: rgba(198, 190, 181, 0.1);
}

.display tbody tr:hover {
    background: rgba(0, 100, 164, 0.05) !important;
}

.display td {
    padding: 12px;
    vertical-align: top;
    line-height: 1.4;
}

.display td:first-child {
    font-family: var(--font-family-slab);
    font-weight: bold;
    color: var(--color-dark-blue);
}

.display a {
    color: var(--color-uci-blue);
    text-decoration: none;
    font-weight: 500;
}

.display a:hover {
    color: var(--color-dark-blue);
    text-decoration: underline;
}

/* Enhanced features - only appear when JavaScript loads */
.table-enhanced {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table-controls {
    background-image: linear-gradient(to right, #1b3d6d 0%, #255799 50%, #0083b3 80%, #00b0ca 100%);
    padding: 20px;
    color: white;
    border-radius: var(--border-radius);
    display: none;
    /* Hidden until JS enables */
}

.table-controls.active {
    display: block;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.search-box, .filter-select {
    padding: 8px 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    min-width: 200px;
}

.search-box {
    flex: 1;
    max-width: 300px;
}

.filter-select {
    background: white;
    color: var(--color-dark-blue);
}

.clear-filters {
    background: var(--color-uci-gold);
    color: var(--color-gray-900);
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: var(--color-yellow);
    transform: translateY(-1px);
}

.results-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* Enhanced table features */
.table-enhanced thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-enhanced th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.3s ease;
}

.table-enhanced th.sortable:hover {
    background: var(--color-dark-blue);
}

.table-enhanced th.sortable::after {
    content: "\f0dc";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: 5px;
    opacity: 0.7;
    font-size: 12px;
}

.table-enhanced th.sort-asc::after {
    content: "\f0de";
    opacity: 1;
    color: #f0ab00;
}

.table-enhanced th.sort-desc::after {
    content: "\f0dd";
    opacity: 1;
    color: #f0ab00;
}

/* Table wrapper for enhanced features */
.training-table-wrapper {
    overflow-x: auto;
}

/* Pagination */
.pagination {
    display: none;
    /* Hidden until JS enables */
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    gap: 10px;
}

.pagination.active {
    display: flex;
}

.pagination button {
    background: var(--color-uci-blue);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--color-dark-blue);
}

.pagination button:disabled {
    background: var(--color-light-gray);
    cursor: not-allowed;
}

.page-info {
    color: var(--color-dark-gray);
    margin: 0 15px;
}

/* Hidden rows for pagination */
.row-hidden {
    display: none !important;
}

/* No results message */
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--color-dark-gray);
    font-style: italic;
    display: none;
}

.no-results.active {
    display: table-row;
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box, .filter-select {
        min-width: auto;
        width: 100%;
    }
    
    .display {
        font-size: 12px;
    }
    
    .display th, .display td {
        padding: 8px 6px;
    }
}

/* Loading indicator */
.loading-indicator {
    text-align: center;
    padding: 20px;
    color: var(--color-uci-blue);
    font-style: italic;
}