/* Add Bookmark: 북마크 아이콘 옆에 "Add Bookmark" 텍스트 표기 (겹치지 않도록) */
#bookmark_add {
    width: auto !important;
    min-width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 2px 8px 0 6px;
    box-sizing: border-box;
}
#bookmark_add > span {
    width: auto !important;
    min-width: 0;
    height: auto;
    overflow: visible;
    font-size: 12px;
    line-height: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* pdfjs .toolbarButton::before의 position:absolute 덮어써 아이콘이 레이아웃 공간을 차지하도록 */
#bookmark_add::before {
    content: "";
    position: static !important;
    top: auto;
    left: auto;
    display: block;
    width: 16px;
    min-width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-right: 8px;
    background-color: var(--main-color);
    -webkit-mask-image: url(../pdfjs/images/toolbarButton-bookmark.svg);
    mask-image: url(../pdfjs/images/toolbarButton-bookmark.svg);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* PDF Annotation Application Styles */

/* Use pdf.js viewer theme variables */
:root {
    --main-color: rgba(12, 12, 13, 1);
    --body-bg-color: rgba(212, 212, 215, 1);
    --button-hover-color: rgba(0, 0, 0, 0.1);
    --toggled-btn-bg-color: rgba(0, 0, 0, 0.1);
    --toggled-btn-color: rgba(12, 12, 13, 1);
    --toolbar-icon-opacity: 0.7;
    --toolbar-icon-bg-color: rgba(0, 0, 0, 1);
    --toolbar-icon-hover-bg-color: rgba(0, 0, 0, 1);
    --toolbar-bg-color: rgba(249, 249, 250, 1);
    --toolbar-border-bottom: 1px solid rgba(184, 184, 184, 1);
    --sidebar-toolbar-bg-color: rgba(245, 246, 247, 1);
    --separator-color: rgba(102, 102, 102, 1);
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--body-bg-color);
    overflow: hidden;
}

#outerContainer {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    --toolbar-offset: 0px;
    --sidebar-width: 186px;
}

#outerContainer.sidebarOpen #sidebarContainer {
    visibility: visible;
    inset-inline-start: 0;
}

#outerContainer.sidebarOpen #viewerContainer {
    inset-inline-start: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    inset-block-start: 0;
}

#viewerContainer {
    inset-block-start: 0;
}

/* Sidebar */
#sidebarContainer {
    position: absolute;
    top: var(--toolbar-offset, 0px);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100% - var(--toolbar-offset, 0px));
    background-color: var(--sidebar-toolbar-bg-color);
    border-right: 1px solid var(--separator-color);
    transition: transform 0.2s ease;
    z-index: 1000;
}

#sidebarContainer.hidden {
    transform: translateX(calc(var(--sidebar-width) * -1));
}

#toolbarSidebar {
    display: flex;
    height: 32px;
    background-color: var(--sidebar-toolbar-bg-color);
}

#sidebarViewButtons {
    display: flex;
}

.toolbarButton {
    border: none;
    background: none;
    width: 28px;
    height: 28px;
    margin: 2px 1px;
    padding: 2px 6px 0;
    color: var(--main-color);
    font-size: 12px;
    line-height: 14px;
    cursor: default;
    box-sizing: border-box;
}

.toolbarButton > span {
    display: inline-block;
    width: 0;
    height: 0;
    overflow: hidden;
}

.toolbarButton:hover {
    background-color: var(--button-hover-color);
}

.toolbarButton.toggled {
    background-color: var(--toggled-btn-bg-color);
}

.toolbarButton.annotation.toggled,
.toolbarButton.annotation.selected {
    background-color: var(--toggled-btn-bg-color);
    color: var(--toggled-btn-color);
}

#sidebarContent {
    height: calc(100% - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#sidebarContent::-webkit-scrollbar {
    display: none;
}

.sidebarView.hidden {
    display: none;
}

/* Thumbnails - pdfjs viewer.css의 width: calc(100% - 60px), padding 우측 30px 덮어써 스크롤 우측 빈 영역 제거 */
#thumbnailView {
    width: 100% !important;
    padding: 10px 0 10px 10px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    box-sizing: border-box;
    flex: 1;
    min-height: 0;
}

#thumbnailView .thumbnailLink {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

/* 컨테이너 높이를 이미지에 맞춰 pdf.js처럼 번호가 문서 바로 위(이미지 하단)에 오도록 함 */
.thumbnail {
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 5px 5px 2px 5px;
    width: 100%;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
    position: relative;
}

.thumbnail:hover {
    border-color: #007bff;
}

#thumbnailView .thumbnailLink.current .thumbnail {
    border-color: #007bff;
    background: rgba(0, 123, 255, 0.08);
}

.thumbnail canvas {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail .thumbnail-page-num {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #007bff;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 11px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Main Container */
#mainContainer {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#mainContainer.sidebarHidden {
    left: 0;
}

/* Toolbar */
.toolbar {
    background-color: var(--toolbar-bg-color);
    border-bottom: var(--toolbar-border-bottom);
    padding: 4px;
    flex-shrink: 0; /* Toolbar는 항상 보이도록 고정 */
    z-index: 100;
    position: relative;
}

#toolbarContainer {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: auto;
}

#toolbarViewer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
}

#toolbarViewerLeft,
#toolbarViewerMiddle,
#toolbarViewerRight {
    display: flex;
    align-items: center;
    gap: 4px;
}

#toolbarViewerMiddle {
    flex: 1;
    justify-content: center;
}

.toolbarField {
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 2px 4px;
    font-size: 12px;
}

.toolbarLabel {
    color: var(--main-color);
    font-size: 12px;
    margin: 0 4px;
}

.splitToolbarButton {
    display: flex;
    border: 1px solid #000;
    border-radius: 2px;
}

.splitToolbarButtonSeparator {
    width: 1px;
    background-color: #000;
}

/* Annotation Toolbar */
#toolbarAnnotations {
    background-color: var(--toolbar-bg-color);
    border-top: var(--toolbar-border-bottom);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
    height: 32px;
    overflow-x: auto;
}

#viewAnnotations::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/annotations.svg);
    mask-image: url(../pdfjs/annotationeer-icons/annotations.svg);
}

/* Annotations 항목이 1개 이상일 때 Show Annotations 버튼 깜빡임 */
#viewAnnotations.annotations-has-items {
    animation: annotations-has-items-blink 1.2s ease-in-out infinite;
}
@keyframes annotations-has-items-blink {
    0%, 100% { background-color: transparent; opacity: 1; }
    50% { background-color: rgba(0, 123, 255, 0.25); opacity: 0.9; }
}

#viewBookmarks::before {
    -webkit-mask-image: url(../pdfjs/images/toolbarButton-bookmark.svg);
    mask-image: url(../pdfjs/images/toolbarButton-bookmark.svg);
}

/* Secondary toolbar annotation icons */
#secondaryTextHighlight::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_highlight.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_highlight.svg);
}

#secondaryTextUnderline::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_underline.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_underline.svg);
}

#secondaryTextStrikeThrough::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_strike_through.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_strike_through.svg);
}

#secondaryHandTool::before {
    -webkit-mask-image: url(../pdfjs/images/secondaryToolbarButton-handTool.svg);
    mask-image: url(../pdfjs/images/secondaryToolbarButton-handTool.svg);
}

#secondaryComment::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/comment.svg);
    mask-image: url(../pdfjs/annotationeer-icons/comment.svg);
}

#secondaryDraw::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/pencil.svg);
    mask-image: url(../pdfjs/annotationeer-icons/pencil.svg);
}

#secondaryLine::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/line.svg);
    mask-image: url(../pdfjs/annotationeer-icons/line.svg);
}

#secondaryArrow::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/arrow.svg);
    mask-image: url(../pdfjs/annotationeer-icons/arrow.svg);
}

#secondaryStamp::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/stamp.svg);
    mask-image: url(../pdfjs/annotationeer-icons/stamp.svg);
}

#secondaryDigitalSignature::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/digital_signature.svg);
    mask-image: url(../pdfjs/annotationeer-icons/digital_signature.svg);
}

#secondaryShowHide::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/eye_hide.svg);
    mask-image: url(../pdfjs/annotationeer-icons/eye_hide.svg);
}

#secondarySave::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/save.svg);
    mask-image: url(../pdfjs/annotationeer-icons/save.svg);
}

#secondaryExport::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/export.svg);
    mask-image: url(../pdfjs/annotationeer-icons/export.svg);
}

#secondaryClose::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/close.svg);
    mask-image: url(../pdfjs/annotationeer-icons/close.svg);
}

#toolbarAnnotationsLeft,
#toolbarAnnotationsMiddle,
#toolbarAnnotationsRight {
    display: flex;
    align-items: center;
    gap: 4px;
}

#toolbarAnnotationsLeft > *,
#toolbarAnnotationsMiddle > *,
#toolbarAnnotationsRight > * {
    position: relative;
}

#toolbarAnnotationsRight {
    margin-left: auto;
}

#toolbarAnnotations .toolbarButton {
    position: relative;
}

#toolbarAnnotations .toolbarButton::before {
    content: "";
    position: absolute;
    display: inline-block;
    width: 16px;
    height: 16px;
    top: 6px;
    left: 6px;
    background-color: var(--toolbar-icon-bg-color);
    -webkit-mask-size: cover;
    mask-size: cover;
    opacity: 1;
}

#toolbarAnnotations .toolbarButton:hover::before {
    background-color: var(--toolbar-icon-hover-bg-color);
}

/* Annotation toolbar icons (annotationeer icons) */
#colorPickerBackground::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/color_bg.svg);
    mask-image: url(../pdfjs/annotationeer-icons/color_bg.svg);
}

#colorPickerForeground::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/color_fg.svg);
    mask-image: url(../pdfjs/annotationeer-icons/color_fg.svg);
}

#text::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text.svg);
}

#textHighlight::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_highlight.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_highlight.svg);
}

#textUnderline::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_underline.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_underline.svg);
}

#textStrikeThrough::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_strike_through.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_strike_through.svg);
}

#aHandTool::before {
    -webkit-mask-image: url(../pdfjs/images/secondaryToolbarButton-handTool.svg);
    mask-image: url(../pdfjs/images/secondaryToolbarButton-handTool.svg);
}

#custom::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/comment.svg);
    mask-image: url(../pdfjs/annotationeer-icons/comment.svg);
}

#toggleDraw::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/pencil.svg);
    mask-image: url(../pdfjs/annotationeer-icons/pencil.svg);
}

#line::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/line.svg);
    mask-image: url(../pdfjs/annotationeer-icons/line.svg);
}

#arrow::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/arrow.svg);
    mask-image: url(../pdfjs/annotationeer-icons/arrow.svg);
}

#stamp::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/stamp.svg);
    mask-image: url(../pdfjs/annotationeer-icons/stamp.svg);
}

#digitalSignature::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/digital_signature.svg);
    mask-image: url(../pdfjs/annotationeer-icons/digital_signature.svg);
}

#show_hide.eyes-hide::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/eye_hide.svg);
    mask-image: url(../pdfjs/annotationeer-icons/eye_hide.svg);
}

#show_hide.eyes-show::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/eye_show.svg);
    mask-image: url(../pdfjs/annotationeer-icons/eye_show.svg);
}

#save::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/save.svg);
    mask-image: url(../pdfjs/annotationeer-icons/save.svg);
}

#export::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/export.svg);
    mask-image: url(../pdfjs/annotationeer-icons/export.svg);
}

#close::before {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/close.svg);
    mask-image: url(../pdfjs/annotationeer-icons/close.svg);
}

#pageRotateCw::before {
    -webkit-mask-image: url(../pdfjs/images/secondaryToolbarButton-rotateCw.svg);
    mask-image: url(../pdfjs/images/secondaryToolbarButton-rotateCw.svg);
}

#pageRotateCcw::before {
    -webkit-mask-image: url(../pdfjs/images/secondaryToolbarButton-rotateCcw.svg);
    mask-image: url(../pdfjs/images/secondaryToolbarButton-rotateCcw.svg);
}

#toolbarAnnotations::-webkit-scrollbar {
    height: 6px;
}

#toolbarAnnotations::-webkit-scrollbar-track {
    background: #474747;
}

#toolbarAnnotations::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

#toolbarAnnotationsMiddle {
    display: flex;
    align-items: center;
    gap: 4px;
}

.colorPicker {
    width: 30px;
    height: 30px;
    border: 1px solid #000;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.colorPicker div {
    width: 100%;
    height: 100%;
    border-radius: 3px;
}

.colorPickerHidden {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.separator {
    width: 1px;
    height: 24px;
    background-color: #666;
    margin: 0 4px;
}

.annotation.selected {
    background-color: #007bff;
    color: #fff;
}

/* Viewer */
#viewerContainer {
    flex: 1;
    overflow: auto;
    background-color: #525252;
    position: relative;
    min-height: 0; /* Flexbox에서 overflow 작동하도록 */
    flex-shrink: 1;
}

#viewer {
    position: relative;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    text-align: center;
}

.pdfPage {
    display: block;
    margin: 0 auto 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.pageContainer {
    position: relative;
    display: inline-block;
    margin: 0 auto 20px;
    max-width: 100%;
    box-sizing: border-box;
    text-align: left;
}

.pageContainer canvas {
    max-width: 100% !important;
    height: auto !important;
    display: block;
}

.annotationLayer {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: auto;
    cursor: default;
}

.annotation-preview {
    z-index: 1000;
}

.annotation-element {
    position: absolute;
    pointer-events: auto;
    box-sizing: border-box;
}

.annotation-user-label {
    position: absolute;
    top: -10px;
    left: 0;
    background: #f39c12;
    color: #fff;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
}

.annotation-text-content {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    outline: none;
    cursor: text;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 2px;
}

.annotation-text-content.editing {
    outline: 1px dashed rgba(0, 0, 0, 0.5);
}

.annotation-working {
    animation: annotation-working-blink 1s infinite;
}

@keyframes annotation-working-blink {
    0%, 55% {
        opacity: 1;
    }
    56%, 100% {
        opacity: 0.2;
    }
}

.annotation-element:hover {
    border-color: #007bff !important;
    z-index: 1000;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.annotation-element.selected {
    border-color: #007bff !important;
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.7);
}

.annotation-element.remote-selected {
    border-color: #f39c12 !important;
    box-shadow: 0 0 6px rgba(243, 156, 18, 0.7);
}

.annotation-element .remote-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: #f39c12;
    color: #fff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 10;
}

.text-highlight-rect {
    position: absolute;
    pointer-events: none;
}

.text-underline-rect,
.text-strike-rect {
    position: absolute;
    pointer-events: none;
}

.annotation-handle {
    width: 8px;
    height: 8px;
    background: #fff;
    border: 1px solid #007bff;
    position: absolute;
    z-index: 2;
}

.annotation-handle.nw { left: -4px; top: -4px; cursor: nwse-resize; }
.annotation-handle.ne { right: -4px; top: -4px; cursor: nesw-resize; }
.annotation-handle.sw { left: -4px; bottom: -4px; cursor: nesw-resize; }
.annotation-handle.se { right: -4px; bottom: -4px; cursor: nwse-resize; }

.annotation-preview {
    position: absolute;
    pointer-events: none;
    z-index: 999;
}

/* Loading */
.loadingInProgress #loadingBar {
    display: block;
}

#loadingBar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #474747;
    display: none;
}

.progress {
    height: 100%;
    background-color: #007bff;
    width: 0;
    animation: progress 1s infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 50%; }
    100% { width: 100%; }
}

/* Error */
#errorWrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 10000;
}

#errorWrapper[hidden] {
    display: none;
}

/* Dialog */
.dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 10000;
    min-width: 300px;
}

.dialog.hidden {
    display: none;
}

.dialogContent h3 {
    margin-bottom: 10px;
}

.dialogButtons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dialogButtons button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.dialogButtons button:first-child {
    background-color: #007bff;
    color: #fff;
}

.dialogButtons button:last-child {
    background-color: #ccc;
}

/* Annotations list (left panel) */
#annotationsView {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 6px;
}

.annotation-item {
    background: #3a3f43;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #2b2f32;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.annotation-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.5);
}

.annotation-item.remote-selected {
    border-color: #f39c12;
    box-shadow: 0 0 0 1px rgba(243, 156, 18, 0.5);
}

.annotation-item .remote-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    background: #f39c12;
    color: #fff;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    pointer-events: none;
}

.annotation-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.annotation-type {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 12px;
}

.annotation-type-icon {
    width: 14px;
    height: 14px;
    display: inline-block;
    background-color: var(--toolbar-icon-bg-color);
    -webkit-mask-size: cover;
    mask-size: cover;
    flex: 0 0 auto;
}

.annotation-icon-2,
.annotation-icon-5 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_highlight.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_highlight.svg);
}

.annotation-icon-6 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text.svg);
}

.annotation-icon-7 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_underline.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_underline.svg);
}

.annotation-icon-8 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/text_strike_through.svg);
    mask-image: url(../pdfjs/annotationeer-icons/text_strike_through.svg);
}

.annotation-icon-9 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/comment.svg);
    mask-image: url(../pdfjs/annotationeer-icons/comment.svg);
}

.annotation-icon-4 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/pencil.svg);
    mask-image: url(../pdfjs/annotationeer-icons/pencil.svg);
}

.annotation-icon-24 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/line.svg);
    mask-image: url(../pdfjs/annotationeer-icons/line.svg);
}

.annotation-icon-13 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/arrow.svg);
    mask-image: url(../pdfjs/annotationeer-icons/arrow.svg);
}

.annotation-icon-12 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/stamp.svg);
    mask-image: url(../pdfjs/annotationeer-icons/stamp.svg);
}

.annotation-icon-23 {
    -webkit-mask-image: url(../pdfjs/annotationeer-icons/digital_signature.svg);
    mask-image: url(../pdfjs/annotationeer-icons/digital_signature.svg);
}

.annotation-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

.annotation-action-btn,
.comment-edit-btn,
.comment-delete-btn,
.comment-add-btn {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    padding: 0 2px;
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
}

.annotation-action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Signature panel */
.signature-panel {
    position: fixed;
    top: 90px;
    right: 248px;
    width: 240px;
    max-height: 60vh;
    background: #2f3336;
    border: 1px solid #1f2124;
    border-radius: 8px;
    padding: 8px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #fff;
}

.signature-panel.hidden {
    display: none;
}

.signature-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.signature-panel-title {
    font-size: 12px;
    font-weight: 600;
}

.signature-panel-close {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

.signature-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.signature-panel-draw,
.signature-panel-upload {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    font-size: 8px;
    padding: 0 2px;
    line-height: 1;
    cursor: pointer;
}

.signature-upload-input {
    display: none;
}

.signature-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
    padding-right: 2px;
}

.signature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: #3a3f43;
    border: 1px solid #2b2f32;
    border-radius: 6px;
    cursor: pointer;
}

.signature-item.selected {
    border-color: #4a90e2;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.6);
}

.signature-thumb {
    width: 50px;
    height: 30px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
}

.signature-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.signature-label {
    font-size: 11px;
    font-weight: 600;
}

.signature-meta {
    font-size: 10px;
    color: #c9c9c9;
}

.signature-actions {
    display: flex;
    gap: 4px;
}

.signature-btn {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    font-size: 8px;
    padding: 0 2px;
    line-height: 1;
    cursor: pointer;
}

.signature-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.signature-modal.hidden {
    display: none;
}

.signature-modal-content {
    background: #2f3336;
    border: 1px solid #1f2124;
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.signature-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
}

#signatureCanvas {
    background: #fff;
    border-radius: 4px;
    border: 1px solid #444;
}

.signature-modal-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

#presenceCount {
    margin: 0 6px;
    font-size: 11px;
    color: var(--toolbar-icon-bg-color);
}

/* Force smaller action buttons in annotations sidebar */
#annotationsView .annotation-actions .annotation-action-btn,
#annotationsView .comment-actions .comment-edit-btn,
#annotationsView .comment-actions .comment-delete-btn,
#annotationsView .comment-add .comment-add-btn {
    font-size: 8px !important;
    padding: 0 2px !important;
    line-height: 1 !important;
}

.annotation-action-btn:hover,
.comment-edit-btn:hover,
.comment-delete-btn:hover,
.comment-add-btn:hover {
    background: #5b6269;
}

.annotation-action-btn.annotation-delete-btn {
    background: #4a5056;
    border-color: #2b2f32;
}

.comment-panel {
    margin-top: 8px;
    padding: 6px;
    background: #2f3336;
    border-radius: 4px;
}

.comment-row {
    border-bottom: 1px solid #444;
    padding: 4px 0;
}

.comment-text {
    font-size: 12px;
    color: #fff;
}

.comment-meta {
    font-size: 10px;
    color: #c9c9c9;
}

.comment-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
}

.comment-edit-btn,
.comment-delete-btn,
.comment-add-btn {
    padding: 0 2px;
    font-size: 8px;
    line-height: 1;
}

.comment-input {
    width: 100%;
    margin-top: 6px;
    padding: 4px;
    border-radius: 3px;
    border: 1px solid #444;
    background: #1f2124;
    color: #fff;
    font-size: 12px;
}

.comment-add {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comment-add .comment-add-user {
    margin-bottom: 2px;
}

.comment-empty {
    color: #c9c9c9;
    font-size: 11px;
    padding: 4px 0;
}

.annotation-item:hover {
    background: #4a5056;
}

.annotation-title {
    font-size: 12px;
    font-weight: 600;
}

.annotation-meta {
    font-size: 11px;
    color: #c9c9c9;
    line-height: 1.2;
}

.annotation-preview-text {
    font-size: 11px;
    color: #d7d7d7;
    line-height: 1.3;
    background: #2f3336;
    border-radius: 4px;
    padding: 4px 6px;
}

.annotation-empty {
    color: #c9c9c9;
    font-size: 12px;
    padding: 8px;
}

.outline-empty {
    color: #c9c9c9;
    font-size: 12px;
    padding: 8px;
}

/* Bookmarks list (left panel) */
#bookmarks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}

.bookmark-empty {
    color: #c9c9c9;
    font-size: 12px;
    padding: 8px;
}

.bookmark-item {
    background: #3a3f43;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #2b2f32;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.bookmark-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 2px;
    background: #4a90e2;
    opacity: 0.8;
}

.bookmark-item:hover {
    background: #4a5056;
    border-color: #3a3f43;
}

.bookmark-label {
    font-size: 12px;
    font-weight: 600;
    padding-left: 6px;
    line-height: 1.3;
}

.bookmark-meta {
    font-size: 11px;
    color: #c9c9c9;
    padding-left: 6px;
}

.bookmark-actions {
    display: flex;
    gap: 4px;
    padding-left: 6px;
}

/* 북마크 View/Del: Show Annotations의 View/Del과 동일한 작은 사이즈 */
.bookmark-btn {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    padding: 0 2px;
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
}

#bookmarksView .bookmark-btn {
    font-size: 8px !important;
    padding: 0 2px !important;
    line-height: 1 !important;
}

.bookmark-btn:hover {
    background: #5b6269;
}

/* Stamp panel */
.stamp-panel {
    position: fixed;
    top: 90px;
    right: 16px;
    width: 220px;
    max-height: 60vh;
    background: #2f3336;
    border: 1px solid #1f2124;
    border-radius: 8px;
    padding: 8px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #fff;
}

.stamp-panel.hidden {
    display: none;
}

.stamp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stamp-panel-title {
    font-size: 12px;
    font-weight: 600;
}

.stamp-panel-close {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
}

.stamp-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stamp-panel-upload {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    font-size: 8px;
    padding: 0 2px;
    line-height: 1;
    cursor: pointer;
}

.stamp-upload-input {
    display: none;
}

.stamp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: auto;
    padding-right: 2px;
}

.stamp-empty {
    color: #c9c9c9;
    font-size: 11px;
    padding: 4px;
}

.stamp-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: #3a3f43;
    border: 1px solid #2b2f32;
    border-radius: 6px;
    cursor: pointer;
}

.stamp-item.selected {
    border-color: #4a90e2;
    box-shadow: 0 0 0 1px rgba(74, 144, 226, 0.6);
}

.stamp-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #1f2124;
    border-radius: 4px;
}

.stamp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stamp-label {
    font-size: 11px;
    font-weight: 600;
}

.stamp-meta {
    font-size: 10px;
    color: #c9c9c9;
}

.stamp-actions {
    display: flex;
    gap: 4px;
}

.stamp-btn {
    background: #4a5056;
    color: #fff;
    border: 1px solid #2b2f32;
    border-radius: 3px;
    font-size: 8px;
    padding: 0 2px;
    line-height: 1;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebarContainer {
        width: 150px;
    }
    
    #mainContainer {
        left: 150px;
    }
}
