/* Gallery grid using Bootstrap rows */
#galleryimages {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.gallery-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    padding-right: 15px;
    padding-left: 15px;
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

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

.gallery-overlay i {
    color: white;
    font-size: 2rem;
}

/* Lightbox Modal Styles */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.close-lightbox:hover {
    color: #ccc;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255,255,255,0.2);
    color: white;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    z-index: 10000;
}

.nav-btn:hover {
    background-color: rgba(255,255,255,0.4);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.image-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.6);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
}

.image-caption {
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.6);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 14px;
    white-space: nowrap;
}

.lightbox-thumbnails {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    overflow-x: auto;
    max-width: 80%;
}

.lightbox-thumbnails img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s ease;
    border: 2px solid transparent;
}

.lightbox-thumbnails img:hover {
    transform: scale(1.05);
}

.lightbox-thumbnails img.active-thumbnail {
    border-color: #007bff;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-item img {
        height: 150px;
    }
    
    .nav-btn {
        padding: 10px 15px;
        font-size: 20px;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .lightbox-thumbnails img {
        width: 40px;
        height: 40px;
    }
    
    .image-caption {
        white-space: normal;
        font-size: 12px;
        bottom: -60px;
    }
}

@media (max-width: 576px) {
    .gallery-item img {
        height: 120px;
    }
}