.image-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: background 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.image-viewer-overlay.image-viewer-active {
    background: rgba(0, 0, 0, 0.55);
    opacity: 1;
    pointer-events: all;
}

.image-viewer-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    user-select: none;
}

.image-viewer-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.15s ease;
    border-radius: 4px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

/* Caption */
.image-viewer-caption {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    background: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    padding: 6px 18px;
    border-radius: 8px;
    max-width: 70vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toolbar */
.image-viewer-toolbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.image-viewer-toolbar-btn {
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Counter */
.image-viewer-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(10px);
    padding: 4px 14px;
    border-radius: 20px;
}

/* Make help topic images look clickable */
.help-topic-highlighted-image[data-image-viewer] {
    cursor: zoom-in;
}
