/**
 * Filament Sticky Actions
 * Makes the actions column sticky when scrolling horizontally
 *
 * Only applies when [data-sticky-actions] attribute is present on the table
 * Colors are detected via JavaScript and set as CSS variables
 */

/* Header cell for actions column - inherits from thead tr */
.fi-ta[data-sticky-actions] .fi-ta-actions-header-cell {
    position: sticky;
    right: 0;
    z-index: 11;
    background: inherit;
}

/* Actions cell in table rows */
.fi-ta[data-sticky-actions] .fi-ta-row > td:has(.fi-ta-actions):last-child {
    position: sticky;
    right: 0;
    z-index: 10;
}

/* Non-striped rows: use detected container background */
.fi-ta[data-sticky-actions] .fi-ta-row:not(.fi-striped) > td:has(.fi-ta-actions):last-child {
    background-color: var(--fi-ta-bg);
}

/* Striped rows: use detected striped background */
.fi-ta[data-sticky-actions] .fi-ta-row.fi-striped > td:has(.fi-ta-actions):last-child {
    background-color: var(--fi-ta-bg-striped);
}

/* Shadow indicator - only shows when data-sticky-shadow is present */
.fi-ta[data-sticky-actions][data-sticky-shadow] .fi-ta-row > td:has(.fi-ta-actions):last-child::before,
.fi-ta[data-sticky-actions][data-sticky-shadow] .fi-ta-actions-header-cell::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.05));
    pointer-events: none;
}

.dark .fi-ta[data-sticky-actions][data-sticky-shadow] .fi-ta-row > td:has(.fi-ta-actions):last-child::before,
.dark .fi-ta[data-sticky-actions][data-sticky-shadow] .fi-ta-actions-header-cell::before {
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.15));
}
