/* Scroll Offset for Anchor Links */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Adjust for fixed header height */
}

/* DataTables Custom Styling */

/* Wrapper Controls */
.dataTables_wrapper {
    font-family: system-ui, -apple-system, sans-serif;
}

.dataTables_info {
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #4b5563;
    padding: 0.75rem 0;
}

.dataTables_length, .dataTables_paginate, .dataTables_filter {
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.25rem;
    padding: 0.75rem 0;
}

/* Search Input Styling */
.dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    margin-left: 0.5rem;
    transition: all 0.2s;
}

.dataTables_filter input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Length Select Styling */
.dataTables_length select {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    margin: 0 0.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    appearance: none;
}

/* Table Header Styling */
table.dataTable thead {
    background: linear-gradient(to right, #eff6ff, #dbeafe);
    border-bottom: 2px solid #bfdbfe;
}

table.dataTable thead th {
    color: #1f2937;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem !important;
    border-bottom: 2px solid #bfdbfe !important;
}

table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    cursor: pointer;
}

table.dataTable thead th.sorting:hover,
table.dataTable thead th.sorting_asc:hover,
table.dataTable thead th.sorting_desc:hover {
    background: linear-gradient(to right, #dbeafe, #bfdbfe);
}

/* Table Body Styling */
table.dataTable tbody {
    font-size: 0.875rem;
}

table.dataTable tbody td {
    padding: 0.75rem 1rem !important;
    vertical-align: middle;
}

table.dataTable tbody tr {
    transition: background-color 0.15s ease;
}

table.dataTable tbody tr:hover {
    background-color: #f9fafb !important;
}

table.dataTable tbody tr.odd {
    background-color: #ffffff;
}

table.dataTable tbody tr.even {
    background-color: #f9fafb;
}

table.dataTable tbody tr.odd:hover,
table.dataTable tbody tr.even:hover {
    background-color: #f3f4f6 !important;
}

/* Pagination Styling */
.dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 0.125rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.dataTables_paginate .paginate_button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

.dataTables_paginate .paginate_button.current {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
    font-weight: 600;
}

.dataTables_paginate .paginate_button.current:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: white;
}

.dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dataTables_paginate .paginate_button.disabled:hover {
    background: white;
    border-color: #d1d5db;
    color: #4b5563;
}

/* Processing Indicator */
.dataTables_processing {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem 2rem;
    font-size: 0.875rem;
    color: #4b5563;
}

/* Empty Table Message */
.dataTables_empty {
    padding: 2rem !important;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .dataTables_length,
    .dataTables_filter,
    .dataTables_info,
    .dataTables_paginate {
        text-align: center;
        margin: 0.5rem 0;
    }

    .dataTables_filter input {
        width: 100%;
        max-width: 300px;
        margin: 0.5rem 0;
    }

    table.dataTable thead th,
    table.dataTable tbody td {
        padding: 0.5rem !important;
        font-size: 0.8125rem;
    }

    .dataTables_paginate .paginate_button {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }
}

/* Sorting Icons */
table.dataTable thead .sorting:before,
table.dataTable thead .sorting_asc:before,
table.dataTable thead .sorting_desc:before {
    opacity: 0.3;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    opacity: 0.3;
}

table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:before {
    opacity: 1;
}

/* Row Selection */
table.dataTable tbody tr.selected {
    background-color: #dbeafe !important;
}

table.dataTable tbody tr.selected:hover {
    background-color: #bfdbfe !important;
}