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

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 68, 68, 0.3);
    padding: 10px;
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-close:hover,
.lightbox-close:active {
    color: #ff4444;
}

.lightbox-image-wrapper {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightboxImage {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    touch-action: none;
    transform-origin: center center;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 50px;
        padding: 15px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .lightbox-image-wrapper {
        max-height: 80vh;
    }

    #lightboxImage {
        max-height: 80vh;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
}

#lightboxCaption {
    color: white;
    text-align: center;
    padding: 16px;
    font-size: 16px;
    max-width: 100%;
    word-break: break-word;
}