#customLightboxOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background-color: rgba(24, 24, 24, .98); */
    background-color: rgba(43, 43, 43, 1);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
    cursor: default;
    user-select: none;
    overflow: hidden;
}

#lightboxContainer {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

#lightboxBigImg {
    position: relative;
    max-width: 90vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
    cursor: zoom-out;
    transform: scale(0.95);
    transition: transform 0.25s ease-in-out;
    will-change: transform;
}

/* When in-window magnification (zoom) button is active, switch to native uncompressed size with grab cursor for panning */
#lightboxBigImg.zoomed {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    cursor: grab;
}

#lightboxBigImg.zoomed:active {
    cursor: grabbing;
}

/* When monitor fullscreen is active, switch to native uncompressed size with grab cursor for panning */
#customLightboxOverlay:fullscreen #lightboxBigImg,
#customLightboxOverlay:-webkit-full-screen #lightboxBigImg {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    cursor: grab;
}

#customLightboxOverlay:fullscreen #lightboxBigImg:active,
#customLightboxOverlay:-webkit-full-screen #lightboxBigImg:active {
    cursor: grabbing;
}

/* Opaque padded toolbar button styling */
#lightboxToolbar button, #lightboxToolbar a.toolbar-icon-btn {
    background: rgba(20, 24, 28, .75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: #fff;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

#lightboxToolbar button:hover, #lightboxToolbar a.toolbar-icon-btn:hover {
    background: rgba(35, 40, 48, 0.9);
    border-color: rgba(255, 255, 255, 0.35);
}

#lightboxToolbar button:active, #lightboxToolbar a.toolbar-icon-btn:active {
    transform: scale(0.95);
}

/* Action Caption Button Style */
#lightboxActionBtn {
    display: none;
    margin-top: 15px;
    background: rgba(20, 24, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    padding: 8px 22px;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    z-index: 100000;
}

#lightboxActionBtn:hover {
    background: rgba(40, 46, 54, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
}
