/**
 * Infinite Carousel Gallery Styles
 * Barbarian Lands
 */

/* Carousel Section */
.infinite-carousel-section {
    width: 100%;
    height: 350px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.8) 100%);
    padding: 0;
    margin: 0;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: 30px;
    height: 100%;
    padding: 0 30px;
    animation: scroll-left 60s linear infinite;
    will-change: transform;
}

/* Pause animation on hover or when item is focused/hovered */
.carousel-track:hover,
.carousel-track.paused {
    animation-play-state: paused;
}

/* Carousel Items */
.carousel-item {
    flex-shrink: 0;
    height: 350px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Different Shapes */
.carousel-item.shape-square {
    width: 350px;
    border-radius: 8px;
}

.carousel-item.shape-circle {
    width: 350px;
    border-radius: 50%;
    border: 4px solid var(--primary-color, #c9a23e);
}

.carousel-item.shape-rectangle {
    width: 500px;
    border-radius: 12px;
}

/* Images */
.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effects */
.carousel-item:hover,
.carousel-item.hovered,
.carousel-item.focused {
    transform: scale(1.08);
    box-shadow: 0 8px 40px rgba(201, 162, 62, 0.4);
    z-index: 10;
}

.carousel-item:hover img,
.carousel-item.hovered img,
.carousel-item.focused img {
    transform: scale(1.1);
}

/* Focus outline for keyboard navigation */
.carousel-item:focus {
    outline: 2px solid var(--primary-color, #c9a23e);
    outline-offset: 4px;
}

/* Active state */
.carousel-item:active {
    transform: scale(1.05);
}

/* Gradient Overlays on Sides */
.carousel-container::before,
.carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 200px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.carousel-container::before {
    left: 0;
    background: linear-gradient(90deg, rgba(10, 10, 10, 1) 0%, rgba(10, 10, 10, 0) 100%);
}

.carousel-container::after {
    right: 0;
    background: linear-gradient(270deg, rgba(10, 10, 10, 1) 0%, rgba(10, 10, 10, 0) 100%);
}

/* Scroll Animation */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .carousel-item.shape-rectangle {
        width: 450px;
    }
}

@media (max-width: 992px) {
    .infinite-carousel-section {
        height: 280px;
    }
    
    .carousel-item {
        height: 280px;
    }
    
    .carousel-item.shape-square,
    .carousel-item.shape-circle {
        width: 280px;
    }
    
    .carousel-item.shape-rectangle {
        width: 400px;
    }
    
    .carousel-track {
        gap: 20px;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .infinite-carousel-section {
        height: 220px;
    }
    
    .carousel-item {
        height: 220px;
    }
    
    .carousel-item.shape-square,
    .carousel-item.shape-circle {
        width: 220px;
    }
    
    .carousel-item.shape-rectangle {
        width: 320px;
    }
    
    .carousel-track {
        gap: 15px;
        padding: 0 15px;
        animation: scroll-left 40s linear infinite;
    }
    
    .carousel-item:hover {
        transform: scale(1.05);
    }
}

@media (max-width: 480px) {
    .infinite-carousel-section {
        height: 180px;
    }
    
    .carousel-item {
        height: 180px;
    }
    
    .carousel-item.shape-square,
    .carousel-item.shape-circle {
        width: 180px;
    }
    
    .carousel-item.shape-rectangle {
        width: 260px;
    }
    
    .carousel-track {
        gap: 10px;
        padding: 0 10px;
        animation: scroll-left 30s linear infinite;
    }
    
    .carousel-container::before,
    .carousel-container::after {
        width: 100px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        animation-duration: 120s;
    }
    
    .carousel-item,
    .carousel-item img {
        transition-duration: 0.2s;
    }
}

/* Loading State for Images */
.carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 200%;
    animation: shimmer 2s ease-in-out infinite;
    z-index: -1;
}

.carousel-item img[src] + ::before {
    display: none;
}

@keyframes shimmer {
    0% {
        background-position: 200% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

