/*
 * Content Strips Unified Stylesheet
 * Description: Unified styling for content strips (image strips) across all pages
 * Used by: index.html, games-lounge.html, more/main.html, irls.html, fakes.html, tributes.html, captions.html, members-lounge.php
 * PERFORMANCE OPTIMIZED: GPU acceleration, reduced repaints, optimized video rendering
 */

/* ========================================================================== */
/* Variable Definitions */
/* ========================================================================== */

:root {
    --brand-purple: #4b0082;
    --brand-gold: #C8A000;
    --background-dark: #000;
    --background-light: #111;
    --text-light: #fff;
}

/* ========================================================================== */
/* Image Strip Container */
/* ========================================================================== */

.image-strip-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    height: 15.625rem; /* 250px */
    border: 2px solid var(--brand-purple);
    background: var(--background-light);
    touch-action: none; /* Prevent touch gestures from interfering with animation */
    box-sizing: border-box;
    /* Performance optimizations */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Force GPU compositing layer */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    /* Prevent layout shifts - use layout style paint (not strict) */
    contain: layout style paint;
}

#imageStrip3Container {
    border-color: var(--brand-gold);
}

/* ========================================================================== */
/* Image Strip */
/* ========================================================================== */

.image-strip {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    /* Ensure visibility */
    visibility: visible;
    opacity: 1;
    /* Critical: Use transform for animation (GPU accelerated) */
    animation: scroll 70s linear infinite;
    /* Force GPU acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    /* Optimize rendering */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Prevent layout shifts and repaints - use layout style paint (not strict) */
    contain: layout style paint;
    /* Additional mobile optimizations */
    -webkit-perspective: 1000;
    perspective: 1000;
}

.image-strip.paused {
    animation-play-state: paused;
}

.image-strip img {
    height: 15.625rem; /* 250px */
    margin-right: 0.625rem; /* 10px */
    object-fit: cover;
    border: 1px solid var(--brand-purple);
    flex-shrink: 0;
    user-select: none;
    pointer-events: auto;
    /* Ensure visibility */
    display: block;
    visibility: visible;
    opacity: 1;
    /* GPU acceleration for images */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    /* Optimize image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    /* Prevent repaints */
    contain: layout style paint;
}

#imageStrip3 img {
    border-color: var(--brand-gold);
}

/* ========================================================================== */
/* Video Wrapper - HEAVILY OPTIMIZED FOR PERFORMANCE */
/* ========================================================================== */

.image-strip .video-wrapper {
    height: 15.625rem; /* 250px */
    margin-right: 0.625rem; /* 10px */
    flex-shrink: 0;
    user-select: none;
    border: 1px solid var(--brand-purple);
    background: #000;
    position: relative;
    overflow: hidden;
    /* Ensure visibility */
    display: block;
    visibility: visible;
    opacity: 1;
    /* CRITICAL: Force GPU compositing layer for videos */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    /* Prevent layout thrashing - use layout style paint (not strict) */
    contain: layout style paint;
    /* Optimize for transform animations */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Additional GPU acceleration hints */
    -webkit-perspective: 1000;
    perspective: 1000;
    /* Prevent layout shifts */
    box-sizing: border-box;
}

.image-strip .video-wrapper video {
    height: 100%;
    width: auto;
    display: block;
    object-fit: cover;
    /* Ensure visibility */
    visibility: visible;
    opacity: 1;
    /* Prevent interaction that might block scrolling */
    pointer-events: none;
    /* CRITICAL: GPU acceleration for video */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    /* Prevent video repaints */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Prevent video from interfering with scroll */
    touch-action: none;
    -webkit-touch-callout: none;
    /* Optimize video rendering */
    image-rendering: auto;
    /* Prevent video from causing layout shifts */
    contain: layout style paint;
    /* Force hardware acceleration */
    will-change: transform;
    /* Additional mobile optimizations */
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Transparent Shield - Blocks browser controls but allows click-through navigation */
.image-strip .video-wrapper .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: transparent;
    cursor: pointer;
    /* Mobile touch optimizations */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Ensure overlay doesn't interfere with animation */
    pointer-events: auto;
    /* GPU acceleration for overlay */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    /* Prevent overlay from causing repaints */
    contain: layout style paint;
}

/* Hall of Fame Gold Border Support */
#imageStrip3 .video-wrapper {
    border-color: var(--brand-gold);
}

/* ========================================================================== */
/* Strip Context (Label below strip) */
/* ========================================================================== */

.strip-context {
    width: 100%;
    color: var(--text-light);
    font-size: 1.25rem; /* 20px */
    font-weight: bold;
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0.3125rem 0; /* 5px */
    background: var(--background-dark);
    border: 2px solid var(--brand-purple);
    border-top: none;
    box-sizing: border-box;
    /* Prevent layout shifts */
    contain: layout style;
}

#imageStrip3Container + .strip-context {
    border-color: var(--brand-gold);
}

/* ========================================================================== */
/* Recent Indicator */
/* ========================================================================== */

.recent-indicator {
    position: absolute;
    top: -0.9375rem; /* -15px */
    right: -0.9375rem; /* -15px */
    width: 1.875rem; /* 30px */
    height: 1.875rem; /* 30px */
    background-color: red;
    border-radius: 50%;
    display: none;
    /* GPU acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    contain: layout style paint;
}

.recent-indicator.active {
    display: block;
}

/* ========================================================================== */
/* Scroll Animation - OPTIMIZED FOR SMOOTH PERFORMANCE */
/* ========================================================================== */

@keyframes scroll {
    0% {
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-50%, 0, 0);
        -webkit-transform: translate3d(-50%, 0, 0);
    }
}

/* ========================================================================== */
/* Mobile Optimizations */
/* ========================================================================== */

@media (max-width: 768px) {
    .image-strip-container,
    .image-strip img,
    .image-strip .video-wrapper {
        height: 9.375rem; /* 150px */
    }

    .image-strip-container {
        /* Enhanced mobile container optimizations */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: none;
        overscroll-behavior-y: auto;
        touch-action: none;
    }

    .image-strip img,
    .image-strip .video-wrapper {
        margin-right: 0.3125rem; /* 5px */
    }

    .image-strip {
        /* Slower animation for mobile - increased from 35s to 50s for better viewing */
        animation-duration: 50s;
        /* Force hardware acceleration on mobile */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        will-change: transform;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        /* Containment for better performance */
        contain: layout style paint;
    }

    /* Optimize video rendering on mobile */
    .image-strip .video-wrapper video {
        /* Reduce video processing on mobile */
        image-rendering: auto;
        /* Force lower quality hints for better performance */
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }

    .recent-indicator {
        top: -0.4375rem; /* -7px */
        right: -0.4375rem; /* -7px */
        width: 0.9375rem; /* 15px */
        height: 0.9375rem; /* 15px */
    }

    #imageStrip3Container + .strip-context {
        border-color: var(--brand-gold);
        border-top: none;
    }
}

@media (max-width: 480px) {
    .image-strip-container,
    .image-strip img,
    .image-strip .video-wrapper {
        height: 7.5rem; /* 120px */
    }

    .image-strip-container {
        /* Enhanced small mobile container optimizations */
        touch-action: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: none;
    }

    .image-strip {
        /* Ensure smooth animation on small screens */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        will-change: transform;
        contain: layout style paint;
    }

    /* Further optimize videos on small screens */
    .image-strip .video-wrapper {
        contain: layout style paint;
    }

    .image-strip .video-wrapper video {
        /* Maximum performance optimizations for small screens */
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        contain: layout style paint;
    }

    #imageStrip3Container + .strip-context {
        border-color: var(--brand-gold);
        border-top: none;
    }
}

/* ========================================================================== */
/* Performance Hints for Browsers */
/* ========================================================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .image-strip {
        animation-duration: 120s; /* Slower animation */
    }
}

/* High performance mode hints */
@supports (contain: layout) {
    .image-strip {
        contain: layout style paint;
    }
    
    .image-strip .video-wrapper {
        contain: layout style paint;
    }
}
