/* Modern Table Styles */
.modern-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px 15px;
    border: none;
    position: relative;
}

.modern-table thead th i {
    color: white !important;
    margin-right: 8px;
    font-size: 16px;
}

.modern-table thead th span {
    color: white !important;
}

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

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

.modern-table thead th.sorting,
.modern-table thead th.sorting_asc,
.modern-table thead th.sorting_desc {
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-table thead th.sorting:hover,
.modern-table thead th.sorting_asc:hover,
.modern-table thead th.sorting_desc:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
}

.modern-table thead th.sorting:after,
.modern-table thead th.sorting_asc:after,
.modern-table thead th.sorting_desc:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.modern-table thead th.sorting:after {
    border-top: 5px solid rgba(255, 255, 255, 0.6);
}

.modern-table thead th.sorting_asc:after {
    border-bottom: 5px solid white;
}

.modern-table thead th.sorting_desc:after {
    border-top: 5px solid white;
}

/* Modern Table Body */
.modern-table tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
}

.modern-table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modern-table tbody td {
    padding: 18px 15px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

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

.modern-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 15px;
}

.modern-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 15px;
}

/* Specific table header styles for inline tables */
.modern-table-container .modern-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 20px 15px !important;
    border: none !important;
    position: relative !important;
}

.modern-table-container .modern-table thead th i {
    color: white !important;
    margin-right: 8px !important;
    font-size: 16px !important;
}

.modern-table-container .modern-table thead th span {
    color: white !important;
}

.modern-table-container .modern-table thead th:first-child {
    border-top-left-radius: 15px !important;
}

.modern-table-container .modern-table thead th:last-child {
    border-top-right-radius: 15px !important;
}

/* Override any conflicting styles */
.card-body .modern-table-container .modern-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

.card-body .modern-table-container .modern-table thead th i {
    color: white !important;
}

/* Bootstrap table override for specific structure */
.card-body .modern-table-container .table.modern-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    padding: 20px 15px !important;
    border: none !important;
    position: relative !important;
}

.card-body .modern-table-container .table.modern-table thead th i {
    color: white !important;
    margin-right: 8px !important;
    font-size: 16px !important;
}

.card-body .modern-table-container .table.modern-table thead th span {
    color: white !important;
}

/* Force override for any conflicting styles */
.card-body .modern-table-container .table.modern-table thead th,
.card-body .modern-table-container .table.modern-table thead th * {
    color: white !important;
}

/* Modern Table Container */
.modern-table-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

/* Modern DataTable Styles */
.dataTables_wrapper {
    font-family: 'Poppins', sans-serif;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Search Box Styling */
.dataTables_filter {
    margin-bottom: 25px;
    text-align: right;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0;
    font-size: 14px;
}

.dataTables_filter label::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f002";
    margin-right: 8px;
    font-size: 14px;
    color: #667eea;
}

.dataTables_filter input[type="search"] {
    width: 100%;
    max-width: 350px;
    padding: 15px 20px 15px 50px;
    border: 2px solid #667eea;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    margin-left: 15px;
}

.dataTables_filter input[type="search"]:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.2);
    transform: translateY(-2px);
    max-width: 400px;
}

.dataTables_filter input[type="search"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.dataTables_filter input[type="search"]::placeholder {
    color: #6c757d;
    font-style: italic;
    font-weight: 400;
}

/* Search icon inside input */
.dataTables_filter::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f002";
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
    z-index: 10;
    color: #667eea;
}

/* Length Selector */
.dataTables_length {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.dataTables_length label {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: #495057;
    margin-bottom: 0;
    font-size: 14px;
}

.dataTables_length label::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f0ca";
    margin-right: 8px;
    font-size: 14px;
    color: #667eea;
}

.dataTables_length select {
    padding: 12px 18px;
    border: 2px solid #667eea;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    background: white;
    margin: 0 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    min-width: 80px;
    cursor: pointer;
}

.dataTables_length select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 4px rgba(118, 75, 162, 0.2);
    transform: translateY(-2px);
}

.dataTables_length select:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

/* Table Styling */
.dataTables_wrapper table {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.dataTables_wrapper thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px 15px;
    border: none;
    position: relative;
}

.dataTables_wrapper thead th i {
    color: white !important;
    margin-right: 8px;
    font-size: 16px;
}

.dataTables_wrapper thead th span {
    color: white !important;
}

.dataTables_wrapper thead th:first-child {
    border-top-left-radius: 15px;
}

.dataTables_wrapper thead th:last-child {
    border-top-right-radius: 15px;
}

.dataTables_wrapper thead th.sorting,
.dataTables_wrapper thead th.sorting_asc,
.dataTables_wrapper thead th.sorting_desc {
    cursor: pointer;
    transition: all 0.3s ease;
}

.dataTables_wrapper thead th.sorting:hover,
.dataTables_wrapper thead th.sorting_asc:hover,
.dataTables_wrapper thead th.sorting_desc:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
}

.dataTables_wrapper thead th.sorting:after,
.dataTables_wrapper thead th.sorting_asc:after,
.dataTables_wrapper thead th.sorting_desc:after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.dataTables_wrapper thead th.sorting:after {
    border-top: 5px solid rgba(255, 255, 255, 0.6);
}

.dataTables_wrapper thead th.sorting_asc:after {
    border-bottom: 5px solid white;
}

.dataTables_wrapper thead th.sorting_desc:after {
    border-top: 5px solid white;
}

/* Table Body */
.dataTables_wrapper tbody tr {
    transition: all 0.3s ease;
    cursor: pointer;
}

.dataTables_wrapper tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dataTables_wrapper tbody td {
    padding: 18px 15px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

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

.dataTables_wrapper tbody tr:last-child td:first-child {
    border-bottom-left-radius: 15px;
}

.dataTables_wrapper tbody tr:last-child td:last-child {
    border-bottom-right-radius: 15px;
}

/* Modern Pagination */
.dataTables_paginate {
    margin-top: 25px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.dataTables_paginate .paginate_button {
    display: inline-block;
    padding: 12px 18px;
    margin: 0 4px;
    border: 2px solid #667eea;
    border-radius: 12px;
    background: white;
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    min-width: 45px;
    text-align: center;
}

.dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #764ba2;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

/* Pagination ellipsis */
.dataTables_paginate .paginate_button.ellipsis {
    background: transparent;
    border: none;
    color: #6c757d;
    font-weight: 700;
    font-size: 16px;
    padding: 12px 8px;
    box-shadow: none;
}

.dataTables_paginate .paginate_button.ellipsis:hover {
    background: transparent;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Modern Info */
.dataTables_info {
    margin-top: 20px;
    text-align: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    color: #495057;
    font-size: 14px;
    font-weight: 600;
}

.dataTables_info::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f05a";
    margin-right: 8px;
    font-size: 14px;
    color: #667eea;
}

/* Processing */
.dataTables_processing {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Empty State */
.dataTables_empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-style: italic;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dataTables_wrapper {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .dataTables_filter {
        padding: 10px 15px;
        margin-bottom: 20px;
    }
    
    .dataTables_filter input[type="search"] {
        padding: 12px 15px 12px 40px;
        font-size: 14px;
        max-width: 280px;
        margin-left: 10px;
    }
    
    .dataTables_filter::after {
        right: 25px;
        font-size: 14px;
    }
    
    .dataTables_length {
        padding: 10px 15px;
        margin-bottom: 20px;
    }
    
    .dataTables_length select {
        padding: 10px 12px;
        font-size: 13px;
        margin: 0 8px;
    }
    
    .dataTables_paginate {
        padding: 15px;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 10px 14px;
        margin: 0 3px;
        font-size: 13px;
        min-width: 40px;
    }
    
    .dataTables_info {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .modern-table-container .modern-table thead th {
        padding: 15px 10px !important;
        font-size: 12px !important;
    }
    
    .modern-table-container .modern-table thead th i {
        font-size: 14px !important;
        margin-right: 6px !important;
    }
    
    .card-body .modern-table-container .modern-table thead th {
        padding: 15px 10px !important;
        font-size: 12px !important;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .dataTables_wrapper {
        padding: 15px 10px;
    }
    
    .dataTables_filter {
        padding: 8px 12px;
        margin-bottom: 15px;
    }
    
    .dataTables_filter input[type="search"] {
        padding: 10px 12px 10px 35px;
        font-size: 13px;
        max-width: 220px;
        margin-left: 8px;
    }
    
    .dataTables_filter::after {
        right: 20px;
        font-size: 13px;
    }
    
    .dataTables_length {
        padding: 8px 12px;
        margin-bottom: 15px;
    }
    
    .dataTables_length select {
        padding: 8px 10px;
        font-size: 12px;
        margin: 0 6px;
    }
    
    .dataTables_paginate {
        padding: 12px;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 8px 12px;
        margin: 0 2px;
        font-size: 12px;
        min-width: 35px;
    }
    
    .dataTables_info {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .modern-table-container .modern-table thead th {
        padding: 12px 8px !important;
        font-size: 11px !important;
    }
    
    .modern-table-container .modern-table thead th i {
        font-size: 12px !important;
        margin-right: 4px !important;
    }
    
    .card-body .modern-table-container .modern-table thead th {
        padding: 12px 8px !important;
        font-size: 11px !important;
    }
    
    .dataTables_paginate .paginate_button {
        padding: 6px 10px;
        font-size: 11px;
        margin: 0 2px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.dataTables_processing {
    animation: pulse 1.5s infinite;
}

/* Custom Scrollbar */
.dataTables_wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dataTables_wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.dataTables_wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.dataTables_wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}
