/* APCORE 2026 - Visualizador de imagens (lightbox com zoom) */

#imageLightbox.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(2, 6, 23, 0.82);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

#imageLightbox.image-lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-lightbox__backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    cursor: zoom-out;
}

.image-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.image-lightbox__close:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.image-lightbox__toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transform: translateX(-50%);
}

.image-lightbox__toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.image-lightbox__toolbar button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #eab308;
}

.image-lightbox__zoom {
    min-width: 52px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.image-lightbox__stage {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    margin: 0;
}

.image-lightbox__stage img {
    max-width: 90vw;
    max-height: calc(100vh - 190px);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
    transform-origin: center center;
    transition: transform 0.18s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

.image-lightbox__stage img.is-zoomed {
    cursor: grab;
}

.image-lightbox__stage img.is-dragging {
    cursor: grabbing;
    transition: none;
}

.image-lightbox__caption {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    margin: 16px 0 0;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.image-lightbox__caption:empty {
    display: none;
}

body.lightbox-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    #imageLightbox.image-lightbox {
        padding: 12px;
    }

    .image-lightbox__close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }

    .image-lightbox__stage img {
        max-width: 94vw;
        max-height: calc(100vh - 220px);
    }

    .image-lightbox__toolbar {
        bottom: 12px;
    }
}
