/* Column resizer styles */
.column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background-color 0.15s ease;
}

.column-resizer:hover,
.column-resizer.resizing {
    background-color: rgba(34, 197, 94, 0.5);
}

/* Enable horizontal scroll for table */
#result_list {
    table-layout: auto;
    min-width: max-content;
}

/* Wrapper for horizontal scroll */
#result_list-wrapper,
.overflow-x-auto:has(#result_list),
#result_list:has(th) {
    overflow-x: auto !important;
}

#result_list th {
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f9fafb;
}

.dark #result_list th {
    background: #1f2937;
}

/* Sticky header clone styles */
#sticky-header-clone {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.dark #sticky-header-clone {
    background: #111827;
    border-bottom: 1px solid #374151;
}

#sticky-header-clone th {
    background: #f9fafb !important;
}

.dark #sticky-header-clone th {
    background: #111827 !important;
}

#result_list td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom checkbox styling */
.custom-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    vertical-align: middle;
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid #9ca3af;
    border-radius: 4px;
    background: transparent;
}

.custom-checkbox:checked {
    border-color: #22c55e;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* First column (checkbox) - sticky */
#result_list th:first-child,
#result_list td:first-child,
#sticky-header-clone th:first-child {
    text-align: center;
    overflow: visible;
    position: sticky !important;
    left: 0 !important;
    z-index: 20;
    vertical-align: middle;
    padding: 4px !important;
}

/* Second column (ID) */
#result_list th:nth-child(2),
#result_list td:nth-child(2) {
    text-align: center;
}

#result_list th:first-child,
#sticky-header-clone th:first-child {
    z-index: 40;
    top: 0 !important;
    left: 0 !important;
    background: #f9fafb !important;
}

#result_list th:first-child > * {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dark #result_list th:first-child,
.dark #sticky-header-clone th:first-child {
    background: #1f2937 !important;
}

#result_list td:first-child {
    background: #111827;
}

/* Light theme - match row background */
html:not(.dark) #result_list td:first-child {
    background: white;
}

html:not(.dark) #result_list tr:hover td:first-child {
    background: #f3f4f6;
}

.dark #result_list tr:hover td:first-child {
    background: #1f2937;
}

/* Hide Filters button for staff users */
.staff-user [x-on\:click="filterOpen = true"] {
    display: none !important;
}

/* Hide header for staff users */
.staff-user .border-b.border-base-200.mb-6 {
    display: none !important;
}

/* Hide sidebar container for staff users */
.staff-user #page > .relative.z-50 {
    display: none !important;
}

/* Make main content full width for staff users */
.staff-user #page > .min-w-0 {
    width: 100vw !important;
    max-width: 100vw !important;
}

.staff-user #main {
    width: 100% !important;
    padding-top: 1.5rem !important;
}

/* Hide date hierarchy for staff users */
.staff-user ul.toplinks {
    display: none !important;
}

/* Hide breadcrumbs for staff users */
.staff-user .container.mb-6 {
    display: none !important;
}

/* Make footer container full width for staff users */
.staff-user .container.mx-auto {
    max-width: 100% !important;
}

/* Override Alpine.js calculated footer width for staff users */
.staff-user #submit-row > div {
    width: 100vw !important;
}

.staff-user #submit-row .lg\:mx-auto {
    width: 100% !important;
}

/* Override xl:left-72 for footer and fixed elements */
.staff-user .xl\:left-72 {
    left: 0 !important;
}

/* Override lg:left-72 as well */
.staff-user .lg\:left-72 {
    left: 0 !important;
}

/* Make theme switcher dropdown open upwards */
.staff-user #staff-theme-switcher nav {
    bottom: 100% !important;
    top: auto !important;
    margin-bottom: 0.5rem;
}
