/* Dialog-based image lightbox */

.lightbox-dialog {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    position: fixed;
    inset: 0;
    margin: auto;
    overflow: visible;
}

.lightbox-dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.85);
    animation: lb-backdrop-fade 0.3s ease-out;
}

.lightbox-dialog .lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: lb-content-zoom 0.3s ease-out;
}

@keyframes lb-backdrop-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lb-content-zoom {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* Zoom controls */
.lightbox-dialog .lb-controls {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.lightbox-dialog .lb-controls button {
    background: rgba(50, 50, 50, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    width: 36px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-dialog .lb-controls button:hover {
    background: rgba(100, 100, 100, 0.9);
}

/* Scrollable image container */
.lightbox-dialog .lb-img-container {
    overflow: auto;
    max-width: 85vw;
    max-height: 80vh;
    background-color: white;
    padding: 10px;
    border-radius: 4px;
    cursor: grab;
}

.lightbox-dialog .lb-img-container.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.lightbox-dialog .lb-img-container img {
    display: block;
    max-width: calc(85vw - 20px);
    max-height: calc(80vh - 20px);
    width: auto;
    height: auto;
    transform-origin: 0 0;
}

.lightbox-dialog .lb-caption {
    color: #bbbbbb;
    font-family: "lucida grande", tahoma, verdana, arial, sans-serif;
    font-size: 13px;
    font-weight: bold;
    margin-top: 8px;
    text-align: center;
}

.lightbox-dialog .lb-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
}

.lightbox-dialog .lb-close:hover {
    background: #666;
}
