/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 10px;
    cursor: zoom-in;
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    
    /* Enhanced image quality settings */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: high-quality;
    
    /* Prevent image compression artifacts */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    
    /* Better scaling */
    -webkit-interpolation-mode: bicubic;
    -ms-interpolation-mode: bicubic;
    interpolation-mode: bicubic;
}

.lightbox-image.zoomed {
    cursor: zoom-out;
    transition: transform 0.1s ease;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(153, 227, 46, 0.8);
    color: #151d2a;
    border: none;
    padding: 15px 20px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 3001;
}

.lightbox-nav:hover {
    background: #99e32e;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 3001;
}

.lightbox-close:hover {
    color: #99e32e;
}

/* Prevent text selection during navigation */
.lightbox-image::-moz-selection {
    background: transparent;
}

.lightbox-image::selection {
    background: transparent;
}

/* Loading state styles */
.lightbox-image[style*="opacity: 0.5"] {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .lightbox-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Retina display optimization */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
    .lightbox-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: pixelated;
    }
}