/**
 * Table Controls CSS
 * Styling for pagination, sorting indicators, and page size selectors
 */

/* ===== PAGE SIZE SELECTOR ===== */
.table-page-size-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-page-size {
    min-width: 80px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.table-page-size:hover {
    border-color: #3b82f6;
}

.table-page-size:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== TABLE CONTROLS CONTAINER ===== */
.table-controls-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.table-controls-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ===== TABLE INFO ===== */
.table-info {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ===== PAGINATION ===== */
.table-pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.table-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
}

.table-pagination-btn:hover:not(.disabled):not(.active) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.table-pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

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

.table-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ===== SORTABLE HEADERS ===== */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
    position: relative;
    padding-right: 1.75rem !important;
}

th.sortable:hover {
    background-color: #e5e7eb;
}

th.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #9ca3af;
    opacity: 0.5;
}

th.sortable.asc::after {
    content: '↑';
    color: #3b82f6;
    opacity: 1;
}

th.sortable.desc::after {
    content: '↓';
    color: #3b82f6;
    opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .table-controls-top,
    .table-controls-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .table-page-size-wrapper {
        justify-content: center;
    }
    
    .table-pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .table-info {
        text-align: center;
    }
}

/* ===== FILTER BAR ENHANCEMENT ===== */
.table-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.table-filter-bar select,
.table-filter-bar input[type="text"],
.table-filter-bar input[type="month"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    min-width: 140px;
    background: white;
    transition: all 0.2s;
}

.table-filter-bar select:focus,
.table-filter-bar input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-filter-bar .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}
