.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10002;
    padding: 0;
    backdrop-filter: blur(4px);
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.5);
}

.lightbox-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    position: relative;
}

.lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: opacity 0.3s;
}

.lightbox-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: lightbox-spin 0.8s linear infinite;
}

@keyframes lightbox-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lightbox-image {
    max-width: 90%;
    max-height: calc(90% - 60px);
    object-fit: contain;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform-origin: center center;
    transition: transform 0.05s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.lightbox-image.loaded {
    opacity: 1;
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 6px 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    background: rgba(20, 20, 20, 0.65);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 40px;
    width: fit-content;
    margin: 0 auto;
    max-width: calc(100% - 40px);
    pointer-events: none;
    z-index: 5;
}

.lightbox-filepath {
    word-break: break-all;
}

.lightbox-sep {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
    user-select: none;
}

.lightbox-scale-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 12px;
    border-radius: 20px;
    font-weight: 500;
    color: white;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    min-width: 70px;
    text-align: center;
    letter-spacing: 0.5px;
}

@media (max-width: 640px) {
    .lightbox-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .lightbox-info {
        bottom: 16px;
        left: 12px;
        right: 12px;
        font-size: 12px;
        padding: 6px 12px;
        gap: 4px 8px;
        justify-content: flex-start;
    }

    .lightbox-filepath {
        width: 100%;
        margin-bottom: 2px;
    }

    .lightbox-from {
        margin-right: 4px;
    }

    .lightbox-sep.mobile-hidden {
        display: none;
    }

    .lightbox-scale-badge {
        min-width: 64px;
        padding: 2px 8px;
    }
}