/* pdf_view_in_browser: "Find in this document" on the resource view page */

.PdfVibFind {
    max-width: 740px;
    margin: 0 auto 12px auto;
    text-align: left;
    font-size: 0.875rem;
}

.PdfVibFind [hidden],
.PdfVibOverlay [hidden] {
    display: none !important;
}

.PdfVibFindBar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px 4px 12px;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 8px;
    background: rgba(127, 127, 127, 0.06);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.PdfVibFindBar:focus-within {
    border-color: #E08E00;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.25);
}

.PdfVibFindBar > .fa-magnifying-glass {
    opacity: 0.5;
}

.PdfVibFind input.PdfVibInput {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 6px 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font-size: 0.9375rem;
    outline: none;
}

.PdfVibStatus {
    padding: 0 6px;
    white-space: nowrap;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.PdfVibStatus.PdfVibNoMatches {
    opacity: 0.9;
    color: #B26B00;
}

.PdfVibFind button {
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 6px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    line-height: 1;
    cursor: pointer;
}

.PdfVibFind button:hover:not([disabled]) {
    background: rgba(127, 127, 127, 0.15);
}

.PdfVibFind button[disabled] {
    opacity: 0.3;
    cursor: default;
}

/* Pages with matches */
.PdfVibPages {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.PdfVibFind button.PdfVibPage {
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid rgba(127, 127, 127, 0.35);
    border-radius: 999px;
    font-size: 0.75rem;
}

.PdfVibFind button.PdfVibPage.PdfVibActive {
    border-color: #E08E00;
    background: #FFC107;
    color: #1A1A1A;
}

.PdfVibPageCount {
    margin-left: 5px;
    opacity: 0.65;
}

/* The match in context, and a link to open the PDF at its page */
.PdfVibDetail {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-top: 8px;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.PdfVibSnippet {
    flex: 1 1 auto;
    opacity: 0.85;
}

.PdfVibSnippet mark {
    padding: 0 2px;
    border-radius: 3px;
    background: rgba(255, 193, 7, 0.55);
    color: inherit;
}

.PdfVibApproxIcon {
    margin-left: 6px;
    opacity: 0.6;
    cursor: help;
}

.PdfVibOpen {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* The preview link wraps the page image exactly, so highlights can be placed in fractions of the page */
#previewimagelink.PdfVibLink {
    display: block;
    width: fit-content;
    margin: 0 auto;
}

#previewimagelink.PdfVibLink #previewimage {
    display: block;
    transition: opacity 0.2s;
}

#previewimagelink.PdfVibLink #previewimage.PdfVibSwitching {
    opacity: 0.35;
}

.PdfVibOverlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.PdfVibHit,
.PdfVibCurrent {
    position: absolute;
    border-radius: 6px;
}

.PdfVibHit {
    background: rgba(255, 193, 7, 0.14);
    box-shadow: 0 0 0 1px rgba(224, 142, 0, 0.45);
}

.PdfVibCurrent {
    background: rgba(255, 193, 7, 0.26);
    box-shadow: 0 0 0 2px #E08E00, 0 0 0 6px rgba(255, 193, 7, 0.22);
    transition: top 0.35s ease, left 0.35s ease, width 0.35s ease, height 0.35s ease;
}

/* Placed from the surrounding words because the scanned text differs: shown as a dashed outline */
.PdfVibCurrent.PdfVibApproximate {
    box-shadow: 0 0 0 6px rgba(255, 193, 7, 0.22);
    outline: 2px dashed #E08E00;
}

.PdfVibCurrent.PdfVibInstant {
    transition: none;
}

.PdfVibCurrent.PdfVibPulse {
    animation: PdfVibPulse 0.9s ease-out 1;
}

@keyframes PdfVibPulse {
    0% {
        background: rgba(255, 193, 7, 0.5);
        box-shadow: 0 0 0 2px #E08E00, 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    100% {
        background: rgba(255, 193, 7, 0.26);
        box-shadow: 0 0 0 2px #E08E00, 0 0 0 18px rgba(255, 193, 7, 0);
    }
}
