/* PDF Viewer - Unified Toolbar */
.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background: #f6f6f6;
    border-bottom: 1px solid #e0e0e0;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 44px;
    box-sizing: border-box;
}

.pdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pdf-toolbar-nav {
    flex: 1;
    justify-content: center;
}

.pdf-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #424242;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.15s, color 0.15s;
    padding: 0;
}

.pdf-toolbar-btn:hover:not(:disabled) {
    background: #e8e8e8;
    color: #222;
}

.pdf-toolbar-btn:active:not(:disabled) {
    background: #d8d8d8;
}

.pdf-toolbar-btn:disabled {
    opacity: 0.38;
    cursor: default;
}

.pdf-toolbar-btn.active {
    background: #ddeaf8;
    color: #2a72c3;
}

.pdf-page-info {
    font-size: 13px;
    color: #424242;
    min-width: 64px;
    text-align: center;
    padding: 0 4px;
    user-select: none;
}

.pdf-zoom-level {
    font-size: 13px;
    color: #424242;
    min-width: 46px;
    text-align: center;
    padding: 0 4px;
    user-select: none;
}

.pdf-toolbar-sep {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: #d6d6d6;
    margin: 0 4px;
    flex-shrink: 0;
}

.pdf-viewer-container {
    overflow-y: auto;
    background: #525659;
    height: calc(100vh - 200px);
    text-align: center;
    padding: 12px 8px;
    box-sizing: border-box;
}

/* Search bar */
.pdf-search-input {
    height: 28px;
    border: 1px solid #c8c8c8;
    border-radius: 4px;
    padding: 0 8px;
    font-size: 13px;
    width: 160px;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.pdf-search-input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.pdf-search-input.no-match {
    border-color: #e74c3c;
    background: #fff8f8;
}

.pdf-search-count {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    padding: 0 4px;
    user-select: none;
}

.pdf-search-count.no-match {
    color: #c0392b;
}

/* PDF.js text layer */
.pdfTextLayer {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    line-height: 1;
    z-index: 2;
}

.pdfTextLayer span,
.pdfTextLayer br {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* Search highlights */
mark.pdf-search-hl {
    background: rgba(255, 220, 0, 0.55);
    color: transparent;
    border-radius: 2px;
    padding: 0;
}

mark.pdf-search-hl.pdf-search-hl-current {
    background: rgba(255, 140, 0, 0.75);
    outline: 1px solid rgba(200, 100, 0, 0.6);
}
