/* Enhanced Modern Table Styles */

/* Base Table Styling */
.enhanced-table {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* Allow overlays like dropdowns to render above the table */
    overflow: visible;
    border: none;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.enhanced-table:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Table Header Enhancements */
.enhanced-table thead th {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    /* color: #ffffff; */
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border: none;
    position: relative;
    white-space: nowrap;
}

.enhanced-table thead th:first-child {
    border-top-left-radius: 12px;
}

.enhanced-table thead th:last-child {
    border-top-right-radius: 12px;
}

.enhanced-table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

/* Table Body Styling */
.enhanced-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.enhanced-table tbody tr:hover {
    background: linear-gradient(90deg, #f8f9ff 0%, #ffffff 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.enhanced-table tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border: none;
    font-size: 0.9rem;
    color: #495057;
}

/* Alternating Row Colors */
.enhanced-table.striped tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.enhanced-table.striped tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 100%);
}

/* Action Buttons */
.table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    margin: 0 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 14px;
}

.table-action-btn.edit {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.table-action-btn.edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.table-action-btn.delete {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.table-action-btn.delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.table-action-btn.view {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #495057;
}

.table-action-btn.view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 237, 234, 0.4);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    justify-content: center;
}

.status-badge.success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: #ffffff;
}

.status-badge.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
}

.status-badge.danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: #ffffff;
}

.status-badge.info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #ffffff;
}

.status-badge.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

/* Progress Bars */
.table-progress {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.table-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
    position: relative;
}

.table-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Checkbox Styling */
.table-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-checkbox:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
    .enhanced-table {
        font-size: 0.8rem;
    }
    
    .enhanced-table thead th,
    .enhanced-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    .table-action-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* Ensure dropdowns appear above table content */
.enhanced-dropdown {
    z-index: 2000; /* higher than table/headers */
}

/* DataTable Wrapper Enhancements */
.dataTables_wrapper {
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.dataTables_filter input {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.dataTables_filter input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

.dataTables_length select {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    margin: 0 0.5rem;
    transition: all 0.2s ease;
}

.dataTables_length select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* Pagination Styling */
.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #ffffff;
    color: #495057;
    transition: all 0.2s ease;
    text-decoration: none;
}

.dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #667eea;
    transform: translateY(-1px);
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #667eea;
}

/* Loading Animation */
.table-loading {
    position: relative;
    overflow: hidden;
}

.table-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Card Integration */
.table-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.table-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.table-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
}

.table-card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #495057;
}

.table-card-body {
    padding: 0;
}

/* Icon Enhancements */
.table-icon {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    opacity: 0.8;
}

/* Utility Classes */
.text-truncate-table {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-center {
    text-align: center;
    vertical-align: middle;
}

.table-nowrap {
    white-space: nowrap;
}