/* Gallery Section */
#gallery {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05) 0%, rgba(99, 102, 241, 0.02) 100%);
    padding-top: 3rem;
}

.scrollable-gallery {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scroll-behavior: smooth;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
}

.scrollable-gallery::-webkit-scrollbar {
    display: none; /* Hide scrollbar */
}

.gallery-track {
    display: inline-block;
    white-space: nowrap;
    animation: scroll 60s linear infinite;
}

.gallery-item {
    display: inline-block;
    position: relative;
    width: 300px;
    height: 350px;
    margin-right: 1.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    vertical-align: top;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.8rem;
    text-align: center;
    font-size: 0.9rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}
.scrollable-gallery {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
}

.gallery-item {
    scroll-snap-align: start;
}

@media (max-width: 768px) {
    .scrollable-gallery {
        padding-bottom: 15px; /* Extra space for scroll */
    }
    
    .gallery-item {
        width: 280px; /* Slightly larger for touch */
        margin-right: 1rem;
    }
}
/* Pause animation when user interacts */
.scrollable-gallery:hover .gallery-track {
    animation-play-state: paused;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-item {
        width: 250px;
        height: 300px;
        margin-right: 1rem;
    }
}

@media (max-width: 576px) {
    .gallery-item {
        width: 250px;
        height: 300px;
        margin-right: 1rem;
    }
    
    .gallery-caption {
        font-size: 0.8rem;
        padding: 0.6rem;
    }
}