﻿/* Add to your app CSS */
.text-layer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
    pointer-events: auto;
}

.text-layer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

.text-layer ::selection {
    background: rgba(0, 0, 255, 0.3);
}

.pdf-container {
    position: relative;
    display: inline-block;
}

/* Edit PDF annotation overlay */
.edit-pdf-annotation-overlay {
    user-select: none;
    -webkit-user-select: none;
}

.edit-pdf-annotation-overlay svg {
    pointer-events: none;
}

.edit-pdf-annotation-overlay svg > * {
    pointer-events: auto;
}

.pdf-page-row-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* ── PDF Viewer: highlight layer ── */
.pdf-highlight-layer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 5;
}

.pdf-search-highlight {
    background-color: yellow;
    opacity: 0.4;
    pointer-events: none;
    border-radius: 2px;
    transition: opacity 0.2s ease;
}

/* ── PDF Viewer: page spacing ── */
.pdf-viewer-page {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── pdf.js text layer: make spans invisible until actively selected ── */
.textLayer {
    opacity: 1;
    mix-blend-mode: normal;
}

.textLayer span,
.textLayer br {
    color: transparent !important;
    position: absolute;
    white-space: pre;
    transform-origin: 0% 0%;
    background: none !important;
    -webkit-text-fill-color: transparent !important;
}

/* pdf.js 4.x may also use .endOfContent or render into nested elements */
.textLayer .endOfContent {
    display: none;
}

/* Only show a highlight when the user is actively dragging to select */
.textLayer span::selection {
    background: rgba(0, 100, 255, 0.25);
}

.textLayer span::-moz-selection {
    background: rgba(0, 100, 255, 0.25);
}

/* Override pdf_viewer.min.css highlight styles that cause the purple boxes */
.textLayer .highlight,
.textLayer .highlight.selected {
    background: none;
    border: none;
    margin: 0;
    padding: 0;
}

.textLayer ::highlight(pdfjs-find-results),
.textLayer ::highlight(pdfjs-find-selected) {
    background-color: transparent;
}

/* ── PageHelpGuide: inline top-of-page collapsible banner ── */
.help-guide-banner {
    background: linear-gradient(135deg, #e8eaf6 0%, #e3f2fd 50%, #f3e5f5 100%);
    border-bottom: 2px solid #c5cae9;
    animation: helpGuideFadeIn 0.4s ease;
    flex-shrink: 0;
    z-index: 50;
}

.help-guide-banner.collapsed {
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f5f5f5 0%, #fafafa 100%);
}

.help-guide-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px 4px;
}

.help-guide-banner-body {
    padding: 0 16px 12px;
}

.help-guide-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 8px;
}

.help-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 200px;
    flex: 1 1 auto;
}

.help-guide-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 50%;
    background: #3f51b5;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 1px;
}

.help-guide-protip-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(2, 119, 189, 0.08);
    border-left: 3px solid #0277bd;
    border-radius: 0 6px 6px 0;
    margin-top: 4px;
}

.help-guide-expand-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #37474f;
    transition: background 0.15s ease;
}

    .help-guide-expand-btn:hover {
        background: rgba(0, 0, 0, 0.04);
    }

/* Re-open bar shown after user dismisses the guide */
.help-guide-reopen-bar {
    display: flex;
    justify-content: flex-end;
    padding: 2px 12px;
    background: #fafafa;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

@keyframes helpGuideFadeIn {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
    }
}

/* ── Dark Sidebar / Drawer ── */
.dark-drawer,
.dark-drawer .mud-drawer-content {
    background-color: #374151 !important;
    background: linear-gradient(180deg, #374151 0%, #2d3748 100%) !important;
}
