html {
    overflow-y: scroll;
    height: 100%;
}

header.sticky-top {
    z-index: 1030; /* Higher than default sticky z-index to prevent overlap */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
    padding-top: 70px; /* Adjust this value based on the actual height of your sticky header */
}

footer {
    flex-shrink: 0;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.main-content-row {
    overflow: visible;
}

aside.col-lg-2 {
    top: 70px; /* Height of the sticky header */
    height: calc(100vh - 70px);
    align-self: flex-start;
}

.list-group-item + .list-group-item {
    margin-top: 0.5rem;
    border-top-width: 1px;
}

/* Game Card Image Sizing */
.game-card-img-container {
    position: relative;
    height: 0;
    padding-top: 133.33%; /* 4:3 Portrait Aspect Ratio */
    background-color: var(--bs-secondary-bg);
}

.game-card-img-container .card-img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop images to fit without distortion */
}

.cover-image-wrapper {
    position: relative;
    display: inline-block; /* To wrap tightly around the image */
}

.cover-image-wrapper::after {
    content: '\F505'; /* Bootstrap Icons 'arrows-fullscreen' */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: white;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 0.75rem;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none; /* Make sure the icon doesn't block the link */
}

.cover-image-wrapper:hover::after {
    opacity: 1;
}

/* Sort Feedback Animation */
.sort-feedback {
    animation: sortFlash 0.5s ease-out;
}

@keyframes sortFlash {
    0% {
        background-color: var(--bs-tertiary-bg);
    }
    50% {
        background-color: var(--bs-primary-bg-subtle); /* A subtle highlight color */
    }
    100% {
        background-color: var(--bs-tertiary-bg);
    }
}

/* Skeleton Loading Styles */
.skeleton-img {
    width: 100%;
    height: 180px; /* Adjust as needed */
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 100px;
    animation: shimmer 1.5s infinite linear;
}

.skeleton-list-item-template .skeleton-img {
    height: 100px;
}

.placeholder-glow .placeholder {
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 100px;
    animation: shimmer 1.5s infinite linear;
}

/* noUiSlider Customization */
.noUi-target {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: none;
}

.noUi-connect {
    background: var(--bs-primary);
}

.noUi-target .noUi-handle {
    width: 6px;
    height: 20px;
    top: -7px;
    right: -3px;
    border: 1px solid var(--bs-primary);
    background: var(--bs-primary);
    border-radius: 3px;
    box-shadow: none;
    cursor: grab;
}

.noUi-handle:focus {
    outline: none;
}

.noUi-handle:after, .noUi-handle:before {
    display: none; /* Hide default handle lines */
}

.noUi-tooltip {
    border: none;
    background: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    font-size: 0.75rem;
    padding: 2px 4px;
    border-radius: 0.25rem;
}

@keyframes shimmer {
    0% {
        background-position: -800px 0;
    }
    100% {
        background-position: 800px 0;
    }
}

/* Apply the fixed position only on large screens (the same breakpoint as col-lg-*) */
@media (min-width: 992px) {
    .fixed-sidebar {
        position: fixed;
        top: 70px; /* Adjust this value for any top navigation bar you have */
        
        /* This is the critical part: we set the width to match the col-lg-2.
         A 'col-2' in Bootstrap is 16.66667% of its parent row's width.
         We also add a max-width to prevent it from becoming too wide in very
         large containers. You may need to adjust this max-width slightly
         to match your design perfectly.
        */
        width: 16.66667%; 
        overflow-y: auto;
        max-width: 230px; /* Example max-width, adjust as needed */
        max-height: 500px;
    }
}