/* Table Repeater Core Styles */
.table-repeater-component {
    width: 100% !important;
}

.table-repeater-component .choices input {
    min-width: 100% !important;
}

/* Sibling divider borders for grid columns (divide-x) */
@media (min-width: 641px) {
    .table-repeater-header tr > :not([hidden]) ~ :not([hidden]),
    .table-repeater-row > :not([hidden]) ~ :not([hidden]) {
        border-left: 1px solid rgba(229, 231, 235, 0.15) !important; /* light mode divider */
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .dark .table-repeater-header tr > :not([hidden]) ~ :not([hidden]),
    .dark .table-repeater-row > :not([hidden]) ~ :not([hidden]) {
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important; /* dark mode divider */
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    .table-repeater-row td:first-child,
    .table-repeater-header th:first-child {
        /* padding-left: 0 !important; */
    }

    .table-repeater-row-actions {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
}

/* Header Columns Styling */
.table-repeater-header-column {
    background-color: rgba(243, 244, 246, 0.5) !important;
    font-weight: 600 !important;
    color: #4b5563 !important;
    border-bottom: 1px solid rgba(229, 231, 235, 0.8) !important;
}
.dark .table-repeater-header-column {
    background-color: rgba(255, 255, 255, 0.03) !important; /* Neutral dark grey background */
    color: #d1d5db !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Container Border styling */
.table-repeater-container {
    border: 1px solid rgba(229, 231, 235, 0.8) !important;
    border-radius: 12px !important;
    overflow: visible !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}
.dark .table-repeater-container {
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

/* Row wrapper dividers */
.table-repeater-rows-wrapper {
    background-color: transparent !important;
}

/* Hidden Labels */
.table-repeater-column.has-hidden-label .fi-fo-field-wrp > label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

.table-repeater-column.has-hidden-label .fi-fo-field-wrp:has(.fi-checkbox-input) > label.fi-fo-checkbox-list-option-label {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
}

/* Responsive Collapsed Card Styles on Mobile */
@media (max-width: 768px) {
    .table-repeater-component table {
        display: block !important;
        width: 100% !important;
    }
    .table-repeater-component table thead {
        display: none !important;
    }
    .table-repeater-component table tbody,
    .table-repeater-component table th,
    .table-repeater-component table td {
        display: block !important;
        width: 100% !important;
    }
    .table-repeater-component table tr {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
        padding: 1.25rem !important;
        background-color: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        border-radius: 0.5rem !important;
        margin-bottom: 1.25rem !important;
    }
    .table-repeater-component table tr td {
        border-left: none !important;
        border-right: none !important;
        padding: 0 !important;
    }
}
