/* DataTables Custom Styling with Fixed Column Widths */

/* Base container */
.dataTables_wrapper {
    padding: 0;
    background: transparent;
}

/* Table styling with fixed column widths */
table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed; /* Essential for fixed column widths */
}

/* Fixed column widths */
table.dataTable thead th:nth-child(1),
table.dataTable tbody td:nth-child(1) {
    width: 60% !important;
    max-width: 60% !important;
    min-width: 60% !important;
}

table.dataTable thead th:nth-child(2),
table.dataTable tbody td:nth-child(2) {
    width: 40% !important;
    max-width: 40% !important;
    min-width: 40% !important;
}

table.dataTable thead th {
    background: #f8fafc;
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

table.dataTable tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

table.dataTable tbody tr:hover {
    background: #f9fafb;
}

/* Content wrapping for long text */
table.dataTable td div,
table.dataTable th div {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    max-width: 100%;
}

/* Search styling */
.dt-search {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.dt-input {
    width: 100%;
    padding: 16px 50px 16px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #1e293b;
    transition: all 0.2s;
}

.dt-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Add search icon */
.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

/* Pagination styling */
.dt-paging {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 15px 0;
}

.dt-paging button {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 4px;
}

.dt-paging button:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.dt-paging button.dt-active {
    background: #dc2626;
    color: white;
    border-color: #dc2626;
}

.dt-paging button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info styling */
.dt-info {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin: 15px 0;
}

/* Page length selector */
.dt-length {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin: 15px 0;
}

.dt-length select {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #475569;
    margin: 0 5px;
}

/* Layout structure - custom positioning */
.dt-layout-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

/* Processing indicator */
.dt-processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
}

.dt-processing:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Custom styling for empty tables */
.dataTables_empty {
    text-align: center;
    color: #64748b;
    padding: 40px !important;
    font-style: italic;
}

/* Responsive styling */
@media (max-width: 768px) {
    .dt-layout-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dt-paging {
        justify-content: flex-start;
    }
    
    table.dataTable thead th, 
    table.dataTable tbody td {
        padding: 12px 16px;
    }
    
    /* Maintain column ratios on mobile */
    table.dataTable thead th:nth-child(1),
    table.dataTable tbody td:nth-child(1) {
        width: 60% !important;
    }
    
    table.dataTable thead th:nth-child(2),
    table.dataTable tbody td:nth-child(2) {
        width: 40% !important;
    }
}