/* ============================================
   PROFESSIONAL TABLE STYLES
   Modern, Sleek, and Beautiful Grid Design
   ============================================ */

/* Table Container */
.table-responsive {
    background: var(--card-bg);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-top: 1rem;
    position: relative;
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #667eea #f0f0f0;
    /* Add padding for scrollbar */
    padding-bottom: 2px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Added subtle border for definition */
}

/* Webkit browsers (Chrome, Safari, Edge) scrollbar */
.table-responsive::-webkit-scrollbar {
    height: 12px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
    margin: 0 12px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    border: 2px solid #f0f0f0;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border: 2px solid #e0e0e0;
}

/* Modern Table Base */
.modern-table {
    width: 100%;
    min-width: 800px;
    /* Ensures horizontal scroll on smaller screens */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
    background: transparent;
}

/* Table Header */
.modern-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modern-table thead tr {
    border-left: 4px solid transparent;
    /* Match body row spacing */
}

.modern-table thead th {
    padding: 0.75rem 1rem;
    /* Reduced from 1rem 1.25rem for compact headers */
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    border: none;
    white-space: nowrap;
}

/* Table Body */
.modern-table tbody {
    background: var(--card-bg);
}

.modern-table tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    border-left: 4px solid transparent;
    /* Reserve space for hover border */
}

/* Enhanced Sleek Hover Effect */
.modern-table tbody tr:hover {
    background: linear-gradient(90deg,
            rgba(102, 126, 234, 0.12) 0%,
            rgba(118, 75, 162, 0.12) 100%);
    border-left-color: #667eea;
    /* Show border on hover */
    transform: scale(1.002);
    box-shadow:
        0 4px 20px rgba(102, 126, 234, 0.2),
        0 2px 8px rgba(118, 75, 162, 0.15);
    z-index: 1;
    cursor: pointer;
}

.modern-table tbody tr:last-child {
    border-bottom: none;
}

.modern-table tbody td {
    padding: 0.5rem 1rem;
    /* Reduced from 1rem 1.25rem for compact rows */
    color: var(--text-color);
    vertical-align: middle;
    border: none;
    transition: all 0.3s ease;
}

/* Enhance text on hover */
.modern-table tbody tr:hover td {
    color: var(--text-color);
    font-weight: 500;
}

/* Alternating Row Colors (Subtle) */
.modern-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

.modern-table tbody tr:nth-child(even):hover {
    background: linear-gradient(90deg,
            rgba(102, 126, 234, 0.12) 0%,
            rgba(118, 75, 162, 0.12) 100%);
}

/* Avatar Circle in Tables */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 0.75rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

.avatar-circle:hover {
    transform: scale(1.1);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.badge-success {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.badge-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.badge-faculty {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.badge-student {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

/* Action Buttons in Tables */
.btn-icon-sm {
    background: transparent;
    border: none;
    padding: 0.5rem;
    margin: 0 0.25rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 1rem;
}

.btn-icon-sm:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    transform: scale(1.1);
}

.btn-icon-sm.edit:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.btn-icon-sm.delete:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

/* Fee Status Button - Colorful */
.btn-icon-sm.fee-paid {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(67, 233, 123, 0.3);
}

.btn-icon-sm.fee-paid:hover {
    background: linear-gradient(135deg, #38f9d7 0%, #43e97b 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.5);
}

.btn-icon-sm.fee-pending {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(250, 112, 154, 0.3);
}

.btn-icon-sm.fee-pending:hover {
    background: linear-gradient(135deg, #fee140 0%, #fa709a 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(250, 112, 154, 0.5);
}

/* Text Muted */
.text-muted {
    color: #6c757d;
    font-size: 0.875rem;
}

/* Deleted Row Style */
.deleted-row {
    opacity: 0.5;
    background: rgba(231, 76, 60, 0.05);
}

.deleted-row:hover {
    opacity: 0.7;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* Loading State */
.loading-spinner {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 3px solid rgba(102, 126, 234, 0.1);
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Table */
@media (max-width: 768px) {
    .modern-table {
        font-size: 0.85rem;
    }

    .modern-table thead th,
    .modern-table tbody td {
        padding: 0.75rem 0.5rem;
    }

    .avatar-circle {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }
}

/* Table Cell Alignment Helpers */
.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.text-left {
    text-align: left !important;
}

/* Pagination Styles (Enhanced) */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0 0 12px 12px;
}

.page-info {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
}

.pagination-container .btn {
    margin: 0 0.25rem;
}

/* Filter Section Styles */
.filter-section {
    background: linear-gradient(135deg,
            rgba(102, 126, 234, 0.05) 0%,
            rgba(118, 75, 162, 0.05) 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.filter-section:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Table Stats/Summary */
.table-stats {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(to right, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item i {
    color: #667eea;
    font-size: 1.2rem;
}

.stat-label {
    color: #6c757d;
    font-size: 0.85rem;
}

.stat-value {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Hover Effects for Interactive Elements */
.modern-table tbody tr td:first-child {
    font-weight: 500;
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.status-active {
    background: #43e97b;
}

.status-inactive {
    background: #e74c3c;
}

.status-pending {
    background: #f39c12;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Sortable Column Headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem !important;
}

.sortable:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sortable::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
    font-size: 0.8rem;
}

.sortable.asc::after {
    content: '↑';
    opacity: 1;
}

.sortable.desc::after {
    content: '↓';
    opacity: 1;
}