/* Horizontal Scroll Carousel Component - EXACT implementation from horizontal-scroll-carouse.md */

/* Container styles - EXACT from spec */
.min-h-500vh {
    min-height: 500vh;
}

.mt-200vh {
    margin-top: 200vh;
}

.bg-stone-200 {
    background-color: #e7e5e4;
}

.dark-bg-stone-900 {
    background-color: #1c1917;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.text-center {
    text-align: center;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-gray-500 {
    color: #6b7280;
}

.dark-text-gray-600 {
    color: #4b5563;
}

/* HorizontalScrollCarousel component - EXACT from spec */
.horizontal-scroll-carousel {
    position: relative;
    height: 400vh; /* h-[400vh] */
    width: 100%;
}

.h-400vh {
    height: 400vh;
}

.w-full {
    width: 100%;
}

.relative {
    position: relative;
}

/* Sticky container - EXACT from spec: "sticky top-0 flex h-screen items-center overflow-hidden" */
.horizontal-scroll-carousel > div {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh; /* h-screen */
    align-items: center;
    overflow: hidden;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.flex {
    display: flex;
}

.h-screen {
    height: 100vh;
}

.items-center {
    align-items: center;
}

.overflow-hidden {
    overflow: hidden;
}

/* Track - EXACT from spec: "flex gap-4" with motion.div style={{ x }} */
.horizontal-scroll-track {
    display: flex;
    gap: 1rem; /* gap-4 */
    transform: translateX(5%); /* Initial position from useTransform [0, 1], ["5%", "-95%"] */
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.gap-4 {
    gap: 1rem;
}

/* Card component - EXACT from spec: "group relative h-[450px] w-[450px] overflow-hidden rounded-lg" */
.carousel-card {
    position: relative;
    height: 450px; /* h-[450px] */
    width: 450px; /* w-[450px] */
    overflow: hidden;
    border-radius: 0.5rem; /* rounded-lg */
    flex-shrink: 0; /* Prevent cards from shrinking */
}

.h-450px {
    height: 450px;
}

.w-450px {
    width: 450px;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.group {
    /* Group class for hover effects */
}

/* Image - EXACT from spec: fill objectFit="cover" */
.carousel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dark mode support - EXACT from spec */
@media (prefers-color-scheme: dark) {
    .bg-stone-200 {
        background-color: #1c1917; /* dark:bg-stone-900 */
    }
    
    .text-gray-500 {
        color: #4b5563; /* dark:text-gray-600 */
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .carousel-card {
        height: 350px;
        width: 350px;
    }
    
    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    .py-20 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

@media (max-width: 768px) {
    .min-h-500vh {
        min-height: 400vh;
    }
    
    .mt-200vh {
        margin-top: 150vh;
    }
    
    .h-400vh {
        height: 300vh;
    }
    
    .carousel-card {
        height: 280px;
        width: 280px;
    }
    
    .text-4xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
    
    .py-20 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    .gap-4 {
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .carousel-card {
        height: 220px;
        width: 220px;
    }
    
    .gap-4 {
        gap: 0.5rem;
    }
}

/* Performance optimizations */
.horizontal-scroll-track {
    transform: translateZ(0); /* GPU acceleration */
    backface-visibility: hidden;
}

.carousel-card {
    transform: translateZ(0); /* GPU acceleration */
}

.carousel-card img {
    transform: translateZ(0); /* GPU acceleration */
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .horizontal-scroll-track {
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus states */
.carousel-card:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states */
.carousel-card img {
    transition: opacity 0.3s ease;
}

.carousel-card img:not([src]) {
    opacity: 0;
}

/* Hover effects for enhanced interaction */
.carousel-card:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

.carousel-card:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* Ensure proper stacking context */
.horizontal-scroll-carousel {
    z-index: 1;
}

.horizontal-scroll-carousel > div {
    z-index: 2;
}

.horizontal-scroll-track {
    z-index: 3;
}

/* Additional utility classes for exact Tailwind compatibility */
.absolute { position: absolute; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
