/* 
 * Custom DataTable styling
 * This stylesheet provides enhanced styling for all DataTables
 * Apply to all tables with class .dataTable or .table.dataTable
 */

/* Base table styling */
table.dataTable,
table.table.dataTable {
    width: 100% !important;
    border-collapse: collapse;
    border: 1px solid var(--bs-border-color);
    margin-bottom: 1rem;
}

/* Header styling */
table.dataTable thead th,
table.table.dataTable thead th {
    background-color: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    font-weight: bold;
    vertical-align: middle;
    position: relative;
    padding: 0.75rem;
}

/* Header hover effect for sortable columns */
table.dataTable thead th.sorting:hover,
table.dataTable thead th.dt-orderable-asc:hover, 
table.dataTable thead th.dt-orderable-desc:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Body cell styling */
table.dataTable tbody td,
table.table.dataTable tbody td {
    border: 1px solid var(--bs-border-color);
    vertical-align: middle;
    padding: 0.75rem;
}

/* Ensure proper border rendering with Bootstrap */
table.dataTable.table-bordered > :not(caption) > * {
    border-width: 1px 0;
}

table.dataTable.table-bordered > :not(caption) > * > * {
    border-width: 0 1px;
}

/* Row hover effect */
table.dataTable tbody tr:hover,
table.table.dataTable tbody tr:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

/* Selected row styling */
table.dataTable tbody tr.selected,
table.table.dataTable tbody tr.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* Striped row styling */
table.dataTable.table-striped > tbody > tr:nth-of-type(odd),
table.table.dataTable.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Button styling inside tables */
table.dataTable .btn-sm,
table.table.dataTable .btn-sm {
    border-radius: 4px;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

/* DataTable wrapper styling */
.dataTables_wrapper {
    padding: 0.5rem 0;
}

/* Search input styling */
.dataTables_filter input {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
}

/* Pagination styling */
.dataTables_paginate .pagination {
    margin: 0.5rem 0;
}

.dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
}

.dataTables_paginate .paginate_button.current {
    background-color: var(--bs-primary);
    color: white !important;
    border-color: var(--bs-primary);
}

.dataTables_paginate .paginate_button:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary) !important;
}

/* Length selector styling */
.dataTables_length select {
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none;
}

/* Button styling */
.dt-buttons .btn {
    margin-right: 0.25rem;
}

/* Responsive table adjustments */
@media (max-width: 767px) {
    .dataTables_wrapper .dt-buttons,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100%;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_filter {
        margin-top: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .dataTables_wrapper .dataTables_info {
        text-align: center;
    }
    
    .dataTables_wrapper .dt-buttons {
        display: flex;
        flex-wrap: wrap;
    }
    
    .dataTables_wrapper .dt-buttons .btn {
        margin-bottom: 0.25rem;
    }
} 