/*
  Keep posters the SAME size even when a category/package contains many items (15+).
  Tweak only these two values to match your screenshot:
    --vod-card-width (poster/card width)
    --vod-grid-gap   (space between cards)
*/
:root {
    --vod-columns: 5; /* posters per row in gallery */
    --vod-card-width: 280px; /* change to 260px if you want a slightly tighter grid */
    --vod-grid-gap: 5px;
}

/* Container for VOD items - replaces .scrollja-list */
.vod-grid {
    display: grid;
    /* Fixed card width so it doesn't shrink when the list gets large */
    grid-template-columns: repeat(var(--vod-columns), var(--vod-card-width));
    justify-content: center;
    gap: var(--vod-grid-gap);
    padding: var(--vod-grid-gap);
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    align-content: flex-start;
    list-style: none !important;
    margin: 0;
}

/* Card Item */
/* Card Item */
.vod-card {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    background: #0a0e17;
    /* transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; */
    cursor: pointer;
    /* Poster ratio like your screenshot (portrait). Keeps height consistent. */
    aspect-ratio: 2 / 3;
    min-height: calc(var(--vod-card-width) * 1.35); /* safety for older engines */
    border: 15px solid transparent; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

/* If your app adds classes like .compact/.dense when items are many, force same sizing */
.vod-grid.compact,
.vod-grid.dense,
.vod-grid.large,
.vod-grid.many {
    grid-template-columns: repeat(var(--vod-columns), var(--vod-card-width)) !important;
}

/* Focus / Hover State */
.vod-card:focus, 
.vod-card:hover,
.vod-card.active { 
    /* transform: scale(1.05); */
    /* box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8); */
    border-color: var(--accent-yellow, #ff9f43);
    z-index: 10;
    outline: none;
}

.img-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #1a1a1a;
}

/* Image Styling */
.vod-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crucial: No stretching */
    object-position: center; /* Center focus */
    display: block;
    opacity: 0; 
    /* transition: opacity 0.4s ease-out; */
}

.vod-card img.loaded {
    opacity: 1;
}

/* Overlay Gradient - Full width bottom */
.vod-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Gradient covers mostly bottom but container is full height */
    background: linear-gradient(to top, 
        rgba(0,0,0,0.95) 0%, 
        rgba(0,0,0,0.7) 40%, 
        rgba(0,0,0,0.1) 80%, 
        rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 15px;
    pointer-events: none;
}

/* Title */
.vod-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 4px rgba(0,0,0,0.9);
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

/* Rating Badge (Top Left) */
.rating-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 159, 67, 0.95); /* Orange/Yellow */
    color: #000;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 5;
    pointer-events: none;
}

.rating-badge i {
    font-size: 0.75rem;
}

/* Favorite Heart */
.fav-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #ff4757;
    font-size: 1.2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    z-index: 5;
}

/* Scrollbar customization */
.vod-grid::-webkit-scrollbar {
    width: 8px;
}
.vod-grid::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.vod-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}
.vod-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Layout Adjustments for VOD Mode */
.content-wrapper.vod-mode .channels-column {
    flex: 1; /* Expand to fill */
    width: auto !important;
    max-width: none !important;
    border: none;
    background: transparent;
}

.content-wrapper.vod-mode .preview-column {
    display: none !important;
}

/* Fallback for missing image */
.vod-card.no-image .img-container {
    background: linear-gradient(135deg, #1e2535 0%, #0f1525 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vod-card.no-image .vod-title {
    white-space: normal;
    text-align: center;
    font-size: 1.2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0;
}

/* Watched Badge (Top Right, shifted left of Fav) */
.watched-badge {
    position: absolute;
    top: 12px;
    right: 48px; /* Shifted so it doesn't overlap heart if visible */
    background: rgba(46, 204, 113, 0.9); /* Green */
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    z-index: 5;
    pointer-events: none;
}

