/* 
 * ICT NOTES - TABLE STANDARDS CSS
 * Consistent table styling and functionality across all modules
 */

/* Sortable column styling */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: background-color 0.2s;
}

.sortable:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.sortable i {
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.sortable:hover i {
    opacity: 0.8;
}

.sortable.sorted-asc i:before {
    content: "\f0de"; /* fa-sort-up */
    opacity: 1;
    color: #007bff;
}

.sortable.sorted-desc i:before {
    content: "\f0dd"; /* fa-sort-down */
    opacity: 1;
    color: #007bff;
}

/* Module-specific table header colors (Pastel) */
.table-warning {
    background-color: #f7ddb0 !important; /* KPI Management - soft orange */
    color: #856404 !important;
}

.table-info {
    background-color: #b8dbf5 !important; /* IT Assets - soft cyan */
    color: #055160 !important;
}

/* Pagination Icon Styling - Master Blueprint Compliant */
.pagination-icon {
    font-size: 14px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

.pagination-btn-square {
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    border-radius: 4px !important;
}

.pagination-btn-double {
    min-width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 8px !important;
    border-radius: 4px !important;
}

/* Pagination styling improvements */
.pagination .page-item:not(:last-child) .page-link {
    margin-right: 2px;
}

.pagination .page-link {
    border: 1px solid #dee2e6;
    color: #6c757d;
    transition: all 0.2s ease-in-out;
}

.pagination .page-item.active .page-link {
    background-color: #405189;
    border-color: #405189;
    color: white;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #405189;
}

.table-success {
    background-color: #b8e6d3 !important; /* Admin/Master Data - soft green */
    color: #0a3622 !important;
}

.table-primary {
    background-color: #b5c7f0 !important; /* User Management - soft blue */
    color: #084298 !important;
}

.table-secondary {
    background-color: #d5d7dc !important; /* Daily Entry - soft gray */
    color: #41464b !important;
}

.table-danger {
    background-color: #f7c6c6 !important; /* Reports/Analytics - soft red */
    color: #842029 !important;
}

/* Loading state for tables */
.table-loading {
    position: relative;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.table-loading::before {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    font-weight: 500;
    color: #666;
}

/* Search highlight */
.search-highlight {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
}

/* Empty state styling */
.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: #495057;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

/* Action button consistency */
.btn-group .btn {
    border-radius: 0.375rem !important;
    margin-right: 2px;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Responsive table enhancements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .sortable i {
        display: none;
    }
}

/* Status badges consistency */
.badge {
    font-size: 0.75em;
    padding: 0.35em 0.65em;
}

/* Avatar badge precision styling */
.avatar-title.rounded-circle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    border-radius: 50% !important;
    flex-shrink: 0;
}

/* Ensure perfect circle regardless of content */
.avatar-xs .avatar-title.rounded-circle {
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
}

/* Avatar-sm for dashboard cards */
.avatar-sm .avatar-title.rounded-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    max-width: 40px;
    min-height: 40px;
    max-height: 40px;
    font-size: 20px;
}

/* Pagination styling */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: #6c757d;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}
