/**
 * No Scrolling Headers CSS
 * 
 * Global CSS overrides to completely disable scrolling/sticky headers
 * across all container types in the spaceship simulator
 */

/* ===== GLOBAL HEADER POSITIONING OVERRIDES ===== */

/* Disable ALL sticky and fixed positioning on potential headers */
.table-header,
.grid-header,
.list-header,
.container-header,
.scrolling-header,
.sticky-header,
.fixed-header,
thead,
thead th,
thead td,
.cargo-header,
.market-header,
.service-header,
.inventory-header {
    position: static !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    z-index: auto !important;
    transform: none !important;
    will-change: auto !important;
}

/* ===== VIRTUAL SCROLLING HEADER OVERRIDES ===== */

/* Disable virtual scroll sticky headers */
.virtual-scroll-viewport,
.virtual-scroll-content,
.virtual-scroll-visible {
    position: relative !important;
}

.virtual-scroll-viewport .header,
.virtual-scroll-content .header,
.virtual-scroll-visible .header,
.virtual-scroll-viewport thead,
.virtual-scroll-content thead,
.virtual-scroll-visible thead {
    position: static !important;
    position: relative !important;
    top: auto !important;
    transform: none !important;
}

/* ===== TABLE HEADER OVERRIDES ===== */

/* Force all table headers to be normal (non-sticky) */
table {
    position: relative !important;
}

table thead,
table thead th,
table thead td {
    position: static !important;
    position: relative !important;
    top: auto !important;
    z-index: auto !important;
    transform: none !important;
    background-attachment: scroll !important;
}

/* Disable any CSS that creates floating table headers */
table.sticky-header thead,
table.scrolling-table thead,
.sticky-table thead {
    position: static !important;
    position: relative !important;
}

/* ===== CONTAINER HEADER OVERRIDES ===== */

/* Ensure first children of scrollable containers are not sticky */
.cargo-items > *:first-child,
.market-items > *:first-child,
.grid-objects > *:first-child,
.service-list > *:first-child,
.inventory-list > *:first-child,
.scrollable-container > *:first-child {
    position: static !important;
    position: relative !important;
    top: auto !important;
    transform: none !important;
}

/* ===== LIST AND GRID HEADER OVERRIDES ===== */

/* Disable sticky behavior on list headers */
.list-container .header,
.grid-container .header,
.cargo-container .header,
.market-container .header {
    position: static !important;
    position: relative !important;
    top: auto !important;
    transform: none !important;
}

/* ===== PANEL HEADER OVERRIDES ===== */

/* Ensure panel headers don't stick */
.cargo-panel .cargo-header,
.station-modal .station-header,
.market-interface .market-header {
    position: static !important;
    position: relative !important;
    top: auto !important;
    transform: none !important;
}

/* ===== SCROLLING BEHAVIOR FIXES ===== */

/* Force normal scrolling on all containers */
.scrollable-container,
.cargo-items,
.market-items,
.grid-objects,
.service-list,
.inventory-list {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scroll-behavior: smooth !important;
    position: relative !important;
}

/* Remove any transform-based scrolling effects */
.scroll-transform,
.transform-scroll {
    transform: none !important;
    will-change: auto !important;
}

/* ===== GRID OBJECT VISIBILITY FIXES ===== */

/* Ensure grid objects are always visible and properly sized */
.grid-objects {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    contain: none !important;
}

.grid-object {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 40px !important;
    margin: 2px 0 !important;
    padding: 8px 10px !important;
    position: relative !important;
    transform: none !important;
    will-change: auto !important;
}

/* Ensure object components are visible */
.object-icon {
    display: flex !important;
    visibility: visible !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

.object-info {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-width: 0 !important;
    visibility: visible !important;
}

.object-name,
.object-distance,
.object-type {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
}

/* ===== EMPTY GRID MESSAGE ===== */

.grid-empty {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: center !important;
    padding: 20px !important;
    color: #79C0FF !important;
    position: relative !important;
}

/* ===== PERFORMANCE MODE OVERRIDES ===== */

/* Disable performance optimizations that might hide content */
.performance-mode .offscreen {
    display: block !important;
    visibility: visible !important;
    will-change: auto !important;
}

/* ===== ANIMATION BUDGET OVERRIDES ===== */

/* Ensure grid objects don't get hidden by animation budgets */
.animation-budget-exceeded .grid-object,
.animation-budget-exceeded .object-icon,
.animation-budget-exceeded .object-info {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ===== WEBKIT SCROLLBAR FIXES ===== */

/* Ensure scrollbars don't create sticky headers */
.grid-objects::-webkit-scrollbar,
.cargo-items::-webkit-scrollbar,
.market-items::-webkit-scrollbar {
    width: 6px;
    position: relative !important;
}

/* ===== RESPONSIVE OVERRIDES ===== */

/* Disable scrolling headers on all screen sizes */
@media (max-width: 1024px) {
    .table-header,
    .grid-header,
    .list-header,
    .container-header {
        position: static !important;
        position: relative !important;
    }
}

@media (max-width: 768px) {
    .sticky-header,
    .scrolling-header,
    .fixed-header {
        position: static !important;
        position: relative !important;
    }
}

/* ===== DEBUG INDICATORS ===== */

/* Optional: Add visual indicators for debugging */
.debug-no-scrolling-headers .grid-object {
    border-left: 2px solid #00ff00 !important;
}

.debug-no-scrolling-headers .grid-empty {
    border: 1px dashed #ffff00 !important;
}

/* ===== FORCED VISIBILITY ===== */

/* Nuclear option: force everything to be visible */
.force-visible * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
}

.force-visible .grid-object {
    display: flex !important;
}

.force-visible .object-icon {
    display: flex !important;
}

.force-visible .object-info {
    display: flex !important;
    flex-direction: column !important;
}