/* ===== MODERN TABLE DESIGN SYSTEM ===== */
/* Consistent across all platforms - Mac, Windows, Linux */

/* ===== CROSS-PLATFORM COMPATIBILITY ===== */
/* Ensure consistent rendering across all browsers and devices */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Force hardware acceleration for better performance */
.table-responsive,
.table {
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ===== MODERN TABLE CONTAINER ===== */
.table-responsive {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Top accent line */
.table-responsive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 16px 16px 0 0;
    z-index: 1;
}

/* ===== MODERN TABLE STYLING ===== */
.table-responsive .table {
    background: #ffffff;
    border-collapse: separate;
    border-spacing: 0;
    position: relative;
    z-index: 2;
    width: 100%;
    min-width: 100%;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== MODERN TABLE HEADER ===== */
.table-responsive .table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    border-radius: 0;
}

.table-responsive .table thead th {
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    padding: 20px 16px;
    position: relative;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    min-width: 120px;
}

.table-responsive .table thead th:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* ===== MODERN TABLE BODY ===== */
.table-responsive .table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    position: relative;
}

.table-responsive .table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(102, 126, 234, 0.12);
    border-radius: 8px;
    margin: 2px 4px;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.table-responsive .table tbody td {
    padding: 16px;
    border: none;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    vertical-align: middle;
    position: relative;
    z-index: 2;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
}

.table-responsive .table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== MODERN BUTTONS IN TABLE ===== */
.table-responsive .btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
    padding: 6px 12px;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-responsive .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.table-responsive .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table-responsive .btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.table-responsive .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.table-responsive .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* ===== MODERN BADGES ===== */
.table-responsive .badge {
    border-radius: 6px;
    font-weight: 500;
    font-size: 11px;
    padding: 4px 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== CUSTOM SCROLLBAR ===== */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* ===== MODERN PAGINATION ===== */
.pagination {
    justify-content: center;
    margin: 2rem auto;
    gap: 8px;
    padding: 1rem;
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.pagination .page-link {
    border: none;
    border-radius: 12px;
    padding: 12px 18px;
    margin: 0 3px;
    color: #6b7280;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    min-width: 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pagination .page-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.pagination .page-link:hover {
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.pagination .page-link:hover::before {
    left: 0;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px) scale(1.02);
    position: relative;
}

.pagination .page-item.active .page-link::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    z-index: -1;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.05); opacity: 0.1; }
    100% { transform: scale(1); opacity: 0.3; }
}

.pagination .page-item.disabled .page-link {
    color: #d1d5db;
    background: #f9fafb;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination .page-item.disabled .page-link:hover {
    color: #d1d5db;
    background: #f9fafb;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pagination .page-item.disabled .page-link::before {
    display: none;
}

/* ===== PAGINATION INFO STYLING ===== */
.text-sm.text-gray-700.leading-5 {
    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin: 1rem 0 !important;
}

.sm\:flex-1.sm\:items-center.sm\:justify-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    margin: 1rem 0 !important;
}

.flex.items-center.justify-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
    margin: 1rem 0 !important;
}

/* Catch-all for pagination info */
div:has-text("Showing") {
    color: #6b7280 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin: 1rem 0 !important;
    padding: 0.5rem 1rem !important;
    background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .table-responsive .table thead th {
        padding: 16px 12px;
        font-size: 12px;
        min-width: 100px;
    }
    
    .table-responsive .table tbody td {
        padding: 14px 12px;
        font-size: 13px;
        min-width: 100px;
    }
    
    .table-responsive .btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .pagination .page-link {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 40px;
    }
}

@media (max-width: 576px) {
    .table-responsive .table thead th {
        padding: 12px 8px;
        font-size: 11px;
        min-width: 80px;
    }
    
    .table-responsive .table tbody td {
        padding: 12px 8px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .pagination {
        gap: 4px;
    }
    
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 36px;
    }
}

/* ===== MODERN SUMMARY CARDS ===== */
.modern-summary-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 16px 16px 0 0;
}

.modern-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 8px 16px rgba(0, 0, 0, 0.06);
}

.summary-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modern-summary-card:hover .summary-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

.summary-icon i {
    font-size: 24px;
    transition: all 0.3s ease;
}

.modern-summary-card:hover .summary-icon i {
    transform: scale(1.1);
}

.modern-summary-card h6 {
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.modern-summary-card h3 {
    font-weight: 700;
    font-size: 24px;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.modern-summary-card:hover h3 {
    transform: scale(1.05);
}

/* ===== MODERN DATE INPUTS ===== */
.modern-date-input {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid #667eea !important;
    border-radius: 12px !important;
    color: #374151 !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.modern-date-input:focus {
    background: #ffffff !important;
    border-color: #764ba2 !important;
    box-shadow: 
        0 0 0 0.2rem rgba(102, 126, 234, 0.25),
        0 4px 12px rgba(0, 0, 0, 0.1) !important;
    outline: none !important;
}

.modern-date-input:hover {
    border-color: #764ba2 !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Fix for date input text visibility */
.modern-date-input::-webkit-datetime-edit-text {
    color: #374151 !important;
}

.modern-date-input::-webkit-datetime-edit-month-field,
.modern-date-input::-webkit-datetime-edit-day-field,
.modern-date-input::-webkit-datetime-edit-year-field {
    color: #374151 !important;
}

.modern-date-input::-webkit-calendar-picker-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
}

.modern-date-input::-webkit-calendar-picker-indicator:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* ===== FORCE OVERRIDES FOR CONSISTENCY ===== */
/* Ensure styling works across all platforms */
.table-responsive,
div.table-responsive {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
    border-radius: 16px !important;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    margin-bottom: 1.5rem !important;
    padding: 0.5rem !important;
    position: relative !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Remove top margin when table follows filter section directly */
.card-body .table-responsive:first-child {
    margin-top: 0 !important;
}

/* When table is in card-body after filter section, reduce spacing */
.card-body > .table-responsive {
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

.table-responsive::before,
div.table-responsive::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 3px !important;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
    border-radius: 16px 16px 0 0 !important;
    z-index: 1 !important;
}

.table thead tr,
.table-responsive .table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%) !important;
}

.table thead th,
.table-responsive .table thead th {
    color: #ffffff !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    padding: 20px 16px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

.table tbody tr:hover,
.table-responsive .table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06) 0%, rgba(118, 75, 162, 0.06) 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(102, 126, 234, 0.12) !important;
    border-radius: 8px !important;
    margin: 2px 4px !important;
    border: 1px solid rgba(102, 126, 234, 0.15) !important;
}

.table tbody td,
.table-responsive .table tbody td {
    border: none !important;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8) !important;
    padding: 16px !important;
    white-space: nowrap !important;
    min-width: 120px !important;
}
