/**
 * DocsImageZoom - Lightbox Styles
 *
 * Fullscreen image viewer with zoom controls, drag-to-pan,
 * caption display, and hint bar.
 *
 * @author  An Cao
 * @date    2026-02-11
 */

/* ==========================================================================
   Body lock when lightbox is open
   ========================================================================== */

body.docs-img-zoom-active {
    overflow: hidden;
}

/* Make content images clickable */
.docs-article-content img,
.docs-page-content img {
    cursor: zoom-in;
    transition: opacity 0.2s;
}

.docs-article-content img:hover,
.docs-page-content img:hover {
    opacity: 0.85;
}

/* ==========================================================================
   Overlay
   ========================================================================== */

.docs-img-zoom-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.docs-img-zoom-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Toolbar (top bar)
   ========================================================================== */

.docs-img-zoom-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    flex-shrink: 0;
    z-index: 2;
}

.docs-img-zoom-title {
    color: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

.docs-img-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.docs-img-zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.docs-img-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.docs-img-zoom-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

.docs-img-zoom-close {
    margin-left: 8px;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.docs-img-zoom-close:hover {
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.5);
}

.docs-img-zoom-level {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 48px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Image body (main viewport)
   ========================================================================== */

.docs-img-zoom-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: default;
}

.docs-img-zoom-image {
    max-width: none;
    max-height: none;
    transform-origin: center center;
    transition: transform 0.15s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

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

/* ==========================================================================
   Caption
   ========================================================================== */

.docs-img-zoom-caption {
    text-align: center;
    padding: 8px 16px;
    color: #9ca3af;
    font-size: 0.8125rem;
    background: rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.docs-img-zoom-caption:empty {
    display: none;
}

/* ==========================================================================
   Hint bar (bottom)
   ========================================================================== */

.docs-img-zoom-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

.docs-img-zoom-hint span {
    color: #6b7280;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.06);
}

.docs-img-zoom-hint span:nth-child(odd) {
    font-weight: 600;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .docs-img-zoom-toolbar {
        padding: 6px 10px;
    }

    .docs-img-zoom-title {
        display: none;
    }

    .docs-img-zoom-btn {
        min-width: 32px;
        height: 28px;
        padding: 0 8px;
        font-size: 0.75rem;
    }

    .docs-img-zoom-hint {
        display: none;
    }
}