/**
 * Events Gallery Styles
 * Modern horizontal scrollable image gallery with lightbox
 */

/* ============================================================================
   GALLERY CONTAINER
   ============================================================================ */

.events-gallery {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

.events-gallery-title {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
    font-weight: 500;
    font-size: 1.2rem;
}

/* ============================================================================
   THUMBNAIL STRIP (Horizontal Scroll)
   ============================================================================ */

.gallery-strip-container {
    position: relative;
    overflow: hidden;
}

.gallery-strip {
    overflow: hidden;
    display: flex;
    gap: 12px;
    /* overflow-x: auto;
    scroll-behavior: smooth; */
    padding: 10px 5px 15px 5px;
    /* -webkit-overflow-scrolling: touch; */
    /* scrollbar-width: thin; */
    /* scrollbar-color: #c1c1c1 #f1f1f1; */
}

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

.gallery-strip::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-strip::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.gallery-strip::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gallery-nav:hover {
    background: #1f56a3;
    color: white;
    border-color: #1f56a3;
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav-prev {
    left: -5px;
}

.gallery-nav-next {
    right: -5px;
}

/* ============================================================================
   THUMBNAIL ITEMS
   ============================================================================ */

.gallery-item {
    flex: 0 0 auto;
    width: 180px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

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

/* Hover overlay */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Zoom icon on hover */
.gallery-item::before {
    content: '⊕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-size: 28px;
    color: white;
    opacity: 0;
    z-index: 2;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.gallery-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ============================================================================
   LIGHTBOX MODAL
   ============================================================================ */

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.open {
    opacity: 1;
    visibility: visible;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10010;
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Main Image Container */
.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image.loaded {
    opacity: 1;
}

/* Loading Spinner */
.lightbox-loader {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
    to { transform: rotate(360deg); }
}

/* Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10005;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav-prev {
    left: 20px;
    border-radius: 4px;
}

.lightbox-nav-next {
    right: 20px;
    border-radius: 4px;
}

/* Image Counter */
.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Image Caption */
.lightbox-caption {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 15px;
    text-align: center;
    max-width: 80%;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-caption.visible {
    opacity: 1;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .gallery-item {
        width: 140px;
        height: 95px;
    }
    
    .gallery-nav {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 60px;
    }
    
    .lightbox-nav-prev {
        left: 10px;
    }
    
    .lightbox-nav-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 13px;
    }
    
    .lightbox-caption {
        bottom: 50px;
        font-size: 13px;
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .gallery-item {
        width: 120px;
        height: 80px;
    }
    
    .gallery-strip {
        gap: 8px;
    }
}
