/* Self-contained colour tokens — no dependency on a global CSS variable file. */
.pdfjs-wrapper {
    --clr-canvas-bg: #E8EAF0;
    --clr-toolbar-bg: rgba(255, 255, 255, 0.88);
    --clr-toolbar-border: rgba(0, 0, 0, 0.09);
    --clr-accent-500: #7DA5A8;
    --clr-accent-400: #5C8689;
    --clr-text-secondary: #444444;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.12);
}

[data-theme="dark"] .pdfjs-wrapper {
    --clr-canvas-bg: #1a1c22;
    --clr-toolbar-bg: rgba(26, 28, 38, 0.92);
    --clr-toolbar-border: rgba(255, 255, 255, 0.07);
    --clr-accent-500: #9FC5C7;
    --clr-accent-400: #7DA5A8;
    --clr-text-secondary: #b0b0b0;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.40);
}

.pdfjs-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: var(--clr-canvas-bg);
}

/* ── Zoom sidebar ─────────────────────────────────────────────────────────── */

.pdfjs-zoom-sidebar {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pdfjs-zoom-sidebar button {
    width: 32px;
    height: 32px;
    background: var(--clr-accent-500);
    color: #ffffff;
    border: 1px solid var(--clr-accent-400);
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

    .pdfjs-zoom-sidebar button:hover:not(:disabled) {
        background: var(--clr-accent-400);
        border-color: var(--clr-accent-400);
    }

    .pdfjs-zoom-sidebar button:disabled {
        opacity: 0.38;
        cursor: not-allowed;
    }

/* ── Canvas scroll area ───────────────────────────────────────────────────── */

.pdfjs-canvas-scroll {
    flex: 1;
    overflow: auto;
    position: relative;
    user-select: none;
    background: var(--clr-canvas-bg);
}

    .pdfjs-canvas-scroll.panning {
        cursor: grabbing;
    }

.pdfjs-page {
    position: relative;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 1px 4px rgba(0, 0, 0, 0.10);
    margin: 20px auto;
}

.pdfjs-tile-layer {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.pdfjs-stale-wrap {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.pdfjs-tile {
    display: block;
}

.pdfjs-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 2;
}

.pdfjs-mark {
    cursor: pointer;
}

    .pdfjs-mark.dragging {
        cursor: grabbing;
    }

/* ── Status overlays ──────────────────────────────────────────────────────── */

.pdfjs-loading,
.pdfjs-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--clr-text-secondary);
    background: var(--clr-toolbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--clr-toolbar-border);
    box-shadow: var(--shadow-card);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.pdfjs-error {
    color: #9A4A4A;
    background: rgba(160, 60, 60, 0.07);
    border-color: rgba(160, 60, 60, 0.18);
}

[data-theme="dark"] .pdfjs-error {
    color: #C47070;
    background: rgba(160, 60, 60, 0.10);
    border-color: rgba(160, 60, 60, 0.25);
}

.pdfjs-render-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--clr-toolbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--clr-toolbar-border);
    box-shadow: var(--shadow-card);
    color: var(--clr-text-secondary);
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    pointer-events: none;
    z-index: 3;
}

.pdfjs-render-spinner {
    width: 13px;
    height: 13px;
    border: 1.5px solid rgba(125, 165, 168, 0.18);
    border-top-color: var(--clr-accent-500);
    border-radius: 50%;
    animation: pdfjs-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes pdfjs-spin {
    to {
        transform: rotate(360deg);
    }
}

