.lightbox-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.8);
    z-index: 2000 !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.hidden {
    display: none;
}

.lightbox-container {
    background-color: white;
    border: 2px solid black;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.2);
    width: 80%;
    max-width: 800px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Chicago', monospace;
}

.lightbox-header {
    height: 20px;
    background-color: white;
    border-bottom: 1px solid black;
    display: flex;
    align-items: center;
    padding: 3px 10px;
    cursor: move;
}

.lightbox-title {
    flex-grow: 1;
    text-align: center;
    font-size: 12px;
}

.lightbox-close {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}

.lightbox-close:hover {
    background-color: black;
    color: white;
}

.lightbox-content {
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}


.lightbox-overlay,
.lightbox-overlay *,
.lightbox-content *, 
.lightbox-pdf-container *,
.lightbox-image {
    image-rendering: auto !important;
    image-rendering: -webkit-optimize-contrast !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}


.resize-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
    z-index: 10;
}

.resize-handle::before {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 6px;
    height: 6px;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
}

.resize-handle::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 4px;
    height: 4px;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
}


.lightbox-pdf-container {
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 20px;
}

.lightbox-pdf-container.hidden {
    display: none !important;
}

#pdf-canvas {
    max-width: 90% !important;
    max-height: 70vh !important;
    width: auto !important;
    height: auto !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    background-color: white;
    border: 2px solid #333;
    margin-bottom: 15px;
    display: block !important;
    visibility: visible !important;
    
    image-rendering: auto !important;
    image-rendering: -webkit-optimize-contrast !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}


.lightbox-pdf-controls {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    font-family: 'Chicago', monospace;
    font-size: 12px;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid black;
    background-color: white;
    padding: 4px 8px;
}

.pdf-prev, .pdf-next {
    font-family: 'Chicago', monospace;
    background-color: white;
    border: 1px solid black;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 12px;
}

.pdf-prev:hover, .pdf-next:hover {
    background-color: black;
    color: white;
}

.pdf-page-info {
    display: inline-block;
    margin: 0 10px;
}


@keyframes pageFlipRight {
    0% { transform: rotateY(0); opacity: 1; }
    49% { opacity: 0.8; }
    50% { transform: rotateY(90deg); opacity: 0; }
    51% { transform: rotateY(-90deg); opacity: 0; }
    100% { transform: rotateY(0); opacity: 1; }
}

@keyframes pageFlipLeft {
    0% { transform: rotateY(0); opacity: 1; }
    49% { opacity: 0.8; }
    50% { transform: rotateY(-90deg); opacity: 0; }
    51% { transform: rotateY(90deg); opacity: 0; }
    100% { transform: rotateY(0); opacity: 1; }
}

.page-flip-right {
    animation: pageFlipRight 0.5s ease-in-out;
    transform-origin: right center;
}

.page-flip-left {
    animation: pageFlipLeft 0.5s ease-in-out;
    transform-origin: left center;
}


.hidden {
    display: none !important;
}