/* ==================== DATATABLES CUSTOM STYLING ==================== */
/* Dark theme styling for DataTables compatible with bg-gray-900 */

/* DataTables wrapper */
.dataTables_wrapper {
    color: #e5e7eb;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* DataTables length selector */
.dataTables_length {
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_length label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.755rem !important;
}

.dataTables_length select {
    background-color: #1e293b;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    color: #e5e7eb;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.dataTables_length select:hover {
    border-color: #4b5563;
}

.dataTables_length select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* DataTables filter/search */
.dataTables_filter {
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: flex-end;
    padding: 0.755rem !important;
}

.dataTables_filter label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_filter input {
    background-color: #1e293b;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    color: #e5e7eb;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    outline: none;
    width: 250px;
    transition: all 0.2s;
}

.dataTables_filter input:hover {
    border-color: #4b5563;
}

.dataTables_filter input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.dataTables_filter input::placeholder {
    color: #6b7280;
}

/* DataTables processing indicator */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(15, 23, 42, 0.95);
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1.5rem 2rem;
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dataTables_processing::before {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid #0ea5e9;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* DataTables info text */
.dataTables_info {
    color: #9ca3af;
    font-size: 0.875rem;
    padding: 0.755rem !important;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_info {
    padding-left: .755em !important;
}

/* DataTables pagination */
.dataTables_paginate {
    padding: 1rem 0;
    display: flex;
    justify-content: flex-end;
}

.dataTables_paginate.paging_simple_numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dataTables_paginate .paginate_button {
    background-color: transparent;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    color: #9ca3af !important;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    min-width: 2.5rem;
    text-align: center;
}

.dataTables_paginate .paginate_button:hover {
    background-color: #1e293b;
    border-color: #4b5563;
    color: #e5e7eb !important;
}

.dataTables_paginate .paginate_button.current {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff !important;
}

.dataTables_paginate .paginate_button.current:hover {
    background-color: #0284c7;
    border-color: #0284c7;
    color: #ffffff !important;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.dataTables_paginate .paginate_button.previous,
.dataTables_paginate .paginate_button.next {
    font-weight: 600;
}

/* DataTables empty state */
.dataTables_empty {
    color: #6b7280;
    text-align: center;
    padding: 3rem 1rem;
    font-size: 0.875rem;
}

/* DataTables table styling */
table.dataTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table.dataTable thead th {
    background-color: #1e293b;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #374151;
}

table.dataTable thead th:first-child {
    border-top-left-radius: 0.5rem;
}

table.dataTable thead th:last-child {
    border-top-right-radius: 0.5rem;
}

table.dataTable tbody td {
    padding: 1.25rem;
    border-bottom: 1px solid #374151;
    color: #e5e7eb;
    font-size: 0.875rem;
}

table.dataTable tbody tr {
    background-color: transparent;
    transition: background-color 0.15s;
}

table.dataTable tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.5);
}

table.dataTable tbody tr:last-child td {
    border-bottom: none;
}

/* Sorting indicators */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    position: relative;
    cursor: pointer;
    padding-right: 2rem;
}

table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 0.75rem;
}

table.dataTable thead .sorting::after {
    content: '⇅';
}

table.dataTable thead .sorting_asc::after {
    content: '↑';
    opacity: 1;
    color: #0ea5e9;
}

table.dataTable thead .sorting_desc::after {
    content: '↓';
    opacity: 1;
    color: #0ea5e9;
}

/* Responsive adjustments */
@media (max-width: 768px) {

    .dataTables_length,
    .dataTables_filter {
        margin-bottom: 1rem;
    }

    .dataTables_filter input {
        width: 100%;
    }

    .dataTables_info,
    .dataTables_paginate {
        text-align: center;
        justify-content: center;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.75rem;
    }
}