/**
 * Sortable Table Styles for RockOps T&M Portal
 */

/* Controls Container */
.sortable-table-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Search Input */
.table-search {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.table-search:focus {
    outline: none;
    border-color: #2B3A59;
    box-shadow: 0 0 0 3px rgba(43, 58, 89, 0.1);
}

.table-search::placeholder {
    color: #999;
}

/* Filter Dropdowns Container */
.table-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Filter Dropdown */
.table-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    min-width: 120px;
    transition: border-color 0.15s;
}

.table-filter:focus {
    outline: none;
    border-color: #2B3A59;
}

.table-filter:hover {
    border-color: #aaa;
}

/* Row Counter */
.row-count {
    font-size: 13px;
    color: #666;
    margin-left: auto;
    white-space: nowrap;
}

/* Sortable Header Styles */
th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background 0.15s;
}

th.sortable:hover {
    background: #3d4f6f !important;
}

th.sortable:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: -2px;
}

/* Sort Indicator */
.sort-indicator {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.8;
    display: inline-block;
    vertical-align: middle;
}

th.sortable:not(.sort-asc):not(.sort-desc):hover .sort-indicator::after {
    content: ' ⇅';
    opacity: 0.5;
}

th.sort-asc {
    background: #3d4f6f !important;
}

th.sort-desc {
    background: #3d4f6f !important;
}

/* Hidden rows */
tr[style*="display: none"] {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sortable-table-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-search {
        min-width: 100%;
    }
    
    .table-filters {
        flex-direction: column;
    }
    
    .table-filter {
        min-width: 100%;
    }
    
    .row-count {
        margin-left: 0;
        text-align: center;
    }
}

/* Keyboard hint (shown briefly on page load) */
.table-search:focus::after {
    content: 'Press / to search';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #999;
}

