/* 
 * Object Grid Scroll Fix
 * CRITICAL FIX: Completely disables automatic scrolling behavior in the OBJECT GRID
 * This fixes the left-to-right oscillating movement issue reported by users
 */

/* Disable ALL automatic scrolling behaviors in object grid */
#objectGrid,
#gridObjects,
.grid-panel,
.grid-objects {
    /* Force static positioning - no transform animations */
    transform: none !important;
    animation: none !important;
    transition: none !important;
    
    /* Lock scroll positions */
    scroll-behavior: auto !important;
    overscroll-behavior: none !important;
    
    /* Ensure container is stable */
    position: static !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

/* Disable virtual scrolling containers that cause oscillation */
.virtual-scroll-viewport {
    /* Completely disable automatic scrolling */
    overflow: hidden !important;
    scroll-behavior: auto !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    
    /* Lock position */
    position: static !important;
}

.virtual-scroll-content,
.virtual-scroll-visible {
    /* Remove all transforms that could cause movement */
    transform: none !important;
    animation: none !important;
    transition: none !important;
    position: static !important;
}

/* Disable performance test related scrolling */
.performance-test-active .virtual-scroll-viewport,
.performance-test-active #gridObjects {
    /* Block any test-induced scrolling */
    overflow: hidden !important;
    scroll-behavior: auto !important;
    pointer-events: none !important;
}

/* Grid object elements should not move automatically */
.grid-object {
    /* Disable hover transforms that might cause shifting */
    transform: none !important;
    animation: none !important;
    transition: opacity 0.2s ease !important; /* Only allow opacity transitions */
}

.grid-object:hover {
    /* Safe hover effect without movement */
    background: linear-gradient(90deg, rgba(45, 25, 100, 0.6) 0%, rgba(60, 35, 120, 0.4) 100%) !important;
    border-color: #8B5CF6 !important;
    transform: none !important; /* NO MOVEMENT ON HOVER */
}

/* Ensure grid panel animations don't affect scrolling */
.grid-panel {
    /* Keep glow animations but disable movement */
    animation: gridPulse 3s infinite ease-in-out !important;
}

/* Override any transform-based animations that could cause scrolling */
@keyframes gridPulse {
    0%, 100% { 
        opacity: 0.92;
        /* Remove any transform properties */
    }
    50% { 
        opacity: 0.98;
        /* Remove any transform properties */
    }
}

/* Disable CSS scroll snapping that might interfere */
#objectGrid *,
#gridObjects *,
.grid-objects * {
    scroll-snap-type: none !important;
    scroll-snap-align: none !important;
}

/* Emergency CSS class to force grid stability */
.grid-scroll-disabled {
    overflow: hidden !important;
    scroll-behavior: auto !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    position: static !important;
}

.grid-scroll-disabled * {
    transform: none !important;
    animation: none !important;
    transition: opacity 0.2s ease !important;
    scroll-behavior: auto !important;
}

/* Debug helper - shows when fix is active */
.grid-fix-active::before {
    content: "SCROLL FIX ACTIVE";
    position: absolute;
    top: -20px;
    left: 0;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    font-family: monospace;
    z-index: 1000;
    pointer-events: none;
}

/* Force normal scrollbar behavior */
#gridObjects::-webkit-scrollbar,
.grid-objects::-webkit-scrollbar {
    width: 6px !important;
    background: rgba(30, 15, 70, 0.5) !important;
}

#gridObjects::-webkit-scrollbar-thumb,
.grid-objects::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #8B5CF6, #A855F7) !important;
    border-radius: 3px !important;
}

/* Disable any smooth scrolling that might cause issues */
#gridObjects,
.grid-objects {
    scroll-behavior: auto !important;
}