/* Hide overlay by default on larger screens */
.ctsh-overlay {
    display: none;
}

/* Apply styles only for screens smaller than 1024px */
@media screen and (max-width: 1023px) {
    .ctsh-table-wrapper {
        position: relative;
        display: block; /* Ensure it's a block for positioning */
    }

    /* Ensure the table is scrollable if not already handled by theme */
    .up-program-properties-table {
        display: block;
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .ctsh-overlay {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(255, 255, 255, 0.85);
        z-index: 2;
        display: block; /* Show on mobile */
        transition: opacity 0.3s ease;
        pointer-events: none; /* Allow touch to pass through to table so scroll works immediately */
        cursor: grab;
    }

    .ctsh-sticky-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        will-change: transform;
    }

    /* Ensure table header stays above overlay */
    .up-program-properties-table thead {
        position: relative;
        z-index: 3;
        background-color: #fff; /* Ensure it's not transparent */
    }
    .up-program-properties-table thead th {
        position: relative;
        z-index: 3;
    }

    .ctsh-overlay.ctsh-hidden {
        opacity: 0;
        pointer-events: none;
    }

    .ctsh-lottie {
        width: 250px;
        height: 250px;
        max-width: 80%;
    }

    .ctsh-text {
        font-size: 16px;
        font-weight: 600;
        color: #333;
        text-align: center;
        margin-top: -20px;
        padding: 0 20px;
    }
}
