/* ====================================
   IMAGE GALLERY FOR GAME DETAIL PAGES
   Add this to game-detail.css
   ==================================== */

/* --- Image Gallery Section --- */
.hero-image-section {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.main-image-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
}

.main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--accent-red);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 1rem;
}

.gallery-nav.next {
    right: 1rem;
}

.gallery-nav svg {
    width: 24px;
    height: 24px;
}

/* Thumbnail Gallery */
.thumbnail-gallery {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) var(--bg-card);
}

.thumbnail-gallery::-webkit-scrollbar {
    height: 8px;
}

.thumbnail-gallery::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 4px;
}

.thumbnail-container {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.thumbnail {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    background: var(--bg-card);
    border: 3px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
}

/* Image Counter */
.image-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 5;
}

/* --- Responsive Design --- */

/* Tablet */
@media (max-width: 1024px) {
    .thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
    }
    
    .gallery-nav svg {
        width: 20px;
        height: 20px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    /* Critical: Prevent image overflow on mobile */
    .hero-image-section {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .main-image-container {
        max-width: 100%;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .main-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        object-fit: contain;
    }
    
    .gallery-nav.prev {
        left: 0.5rem;
    }
    
    .gallery-nav.next {
        right: 0.5rem;
    }
    
    .thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .thumbnail-container {
        gap: 0.5rem;
    }
}

/* Touch device enhancements */
@media (hover: none) and (pointer: coarse) {
    .gallery-nav {
        background: rgba(0, 0, 0, 0.5);
        width: 44px;
        height: 44px;
    }
    
    .thumbnail {
        width: 90px;
        height: 90px;
    }
}

/* Loading state */
.main-image.loading {
    opacity: 0.5;
}

/* Fade transition for image changes */
@keyframes imageFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.main-image.fade-in {
    animation: imageFadeIn 0.3s ease;
}

/* ====================================
   HOW TO PLAY IMAGE SECTION
   For displaying convention/tutorial images
   ==================================== */

/* Container for the how-to-play image */
.how-to-play-image-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto 0;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* The actual image */
.how-to-play-image {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .how-to-play-image-container {
        margin: 1.5rem auto 0;
        border-radius: var(--radius-md);
    }
}
