/* ///////////// BEGIN BLOCK *10 */
/**
* Document Viewer Styles
* File: styles.css
*/

/* Reset and Base Styles */
* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

body {
   font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
   background-color: #f5f5f5;
   overflow: hidden;
}
/* ///////////// END BLOCK *10 */

/* ///////////// REPLACE BLOCK *20 */
/* App Container and Layout */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    overflow: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
}

/* Menu Panel - Fixed left sidebar */
#menu-panel {
    width: 60px;
    height: 100vh;
    background: #f0f0f0;  /* Changed from dark #2c3e50 to light gray */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    border-right: 1px solid #ddd;
    /* z-index set by JavaScript from registry (controls.sidebar: 100) */
}

/* Menu items styling */
#menu-panel > div {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 5px 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    color: #333;  /* Changed from white to dark for light background */
    font-size: 12px;
    position: relative;
}

#menu-panel > div:hover {
    background: rgba(0,0,0,0.05);  /* Changed hover effect for light background */
}

/* Page indicator styling */
#page-indicator {
    background: #fff;  /* Changed to white */
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: bold;
    color: #333;  /* Dark text */
}

/* Main content area */
#main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* ///////////// END BLOCK *20 */

/* ///////////// BEGIN BLOCK *30 */
/* Header Controls - UNUSED/LEGACY */
#header-controls {
   background: #fff;
   border-bottom: 1px solid #ddd;
   padding: 10px;
   display: flex;
   align-items: center;
   gap: 10px;
   /* z-index would be set by JavaScript from registry if this element was used */
   box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#header-controls button {
   padding: 8px 12px;
   background: #4CAF50;
   color: white;
   border: none;
   border-radius: 4px;
   cursor: pointer;
   font-size: 14px;
   transition: background 0.3s;
}

#header-controls button:hover {
   background: #45a049;
}

#header-controls button:active {
   transform: translateY(1px);
}

#zoomLevel {
   font-weight: bold;
   color: #333;
   min-width: 50px;
   text-align: center;
}

#searchBox {
   flex: 1;
   max-width: 300px;
   padding: 8px;
   border: 1px solid #ddd;
   border-radius: 4px;
   font-size: 14px;
}

#document-selector {
   display: flex;
   gap: 10px;
}

#documentId {
   padding: 8px;
   border: 1px solid #ddd;
   border-radius: 4px;
   width: 200px;
}
/* ///////////// END BLOCK *30 */

/* ///////////// REPLACE BLOCK *40 */
/* Viewer Container */
#viewer-container {
    flex: 1;
    display: flex;
    overflow: auto; /* This enables scrollbars */
    position: relative;
    background: #e0e0e0;
}

/* Line Numbers - OLD SIDEBAR (DEPRECATED) */
#line-numbers {
    display: none !important; /* Always hide the old sidebar */
    width: 0 !important;
}

.line-number {
    position: absolute;
    width: 100%;
    text-align: right;
    padding-right: 8px;
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-bottom: 2px solid #eee;
}

/* Hide line numbers when toggled */
body.line-numbers-hidden #line-numbers {
    display: none;
}
/* ///////////// END BLOCK *40 */

/* ///////////// BEGIN BLOCK *50 */
/* Pages Container and Page Layout */
#pages-container {
    position: relative;
    flex: 1;
    background: #e0e0e0;  /* Gray background for the container */
    min-height: 100%;
}

/* Page Container - z-index controlled by registry */
.page-container {
    /* NO BACKGROUND COLOR - let selection show through */
    background: transparent !important;
    position: absolute;
    /* NO z-index here - set by JavaScript from registry */
}

/* Page Images - PNG with transparent background */
.page-container img,
.page-image {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    /* NO z-index here - set by JavaScript from registry */
    background: transparent !important; /* Critical for PNG transparency */
    /* REMOVED mix-blend-mode - might create stacking context */
}

/* Horizontal layout mode */
#pages-container.horizontal {
    display: flex;
    flex-direction: row;
}

#pages-container.horizontal .page-container {
    position: relative;
    margin-right: 20px;
}
/* ///////////// END BLOCK *50 */

/* Page Bookmark Styles */
.page-bookmark {
    position: absolute;
    width: 72px;
    height: 72px;
    pointer-events: auto;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    /* z-index set by JavaScript from registry (document.bookmarks: 15) */
}

.page-bookmark svg {
    width: 100%;
    height: 100%;
    display: block;
    transition: fill 0.3s ease, stroke 0.3s ease, stroke-dasharray 0.3s ease;
}

.page-bookmark.bookmark-inactive svg path {
    fill: rgba(173, 216, 230, 0.15);;
    stroke: rgba(173, 216, 230, 1.0);
    stroke-width: 1pt;
    stroke-dasharray: 4, 4;
}

.page-bookmark.bookmark-active svg path {
    fill: rgba(173, 216, 230, 1.0);
    stroke: none;
}

.page-bookmark-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: sans-serif;
    font-size: 24px;
    font-weight: bold;
    font-style: italic;
    color: #666;
    pointer-events: none;
    user-select: none;
    z-index: 16;
    text-align: center;
    line-height: 1;
    margin-top: -4px; /* Fine-tune vertical centering */
}

.page-bookmark:hover {
    transform: scale(1.1);
}

.page-bookmark:hover svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.page-bookmark:active {
    transform: scale(0.95);
}

/* ///////////// REPLACE BLOCK *60 */
/* Selection Layer and Rectangles - z-index controlled by registry */
#selection-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* z-index set by JavaScript from registry (document.selections: 2) */
}

.selection-rect {
    position: absolute;
    pointer-events: none;
    opacity: 0.5;  /* 50% opacity for all selections */
    mix-blend-mode: multiply;
    /* z-index inherited from parent selection-layer */
}

/* Temporary selections during drag */
.selection-rect.temp-selection {
    opacity: 0.5;  /* Same 50% opacity for consistency */
    border: 1px dashed rgba(0, 0, 0, 0.3);  /* Optional: subtle dashed border for temp selections */
}

/* CRITICAL: Temporarily visible selections MUST have same opacity as regular */
.selection-rect.selection-temp-visible {
    opacity: 0.5 !important;  /* Force same as regular highlights */
}

.selection-rect.selection-temp-visible.markup-underline {
    opacity: 1 !important;  /* Force underlines to full opacity */
}

.selection-rect.locked {
    opacity: 0.5;  /* Keep at 50% for consistency */
    border: 2px solid rgba(0,0,0,0.3);
}

/* Color classes - these should override any inline styles */
.selection-rect.class-1 { background-color: #ff9800 !important; }
.selection-rect.class-2 { background-color: #f44336 !important; }
.selection-rect.class-3 { background-color: #ffeb3b !important; }
.selection-rect.class-4 { background-color: #2196f3 !important; }
.selection-rect.class-5 { background-color: #4caf50 !important; }
.selection-rect.class-6 { background-color: #9c27b0 !important; }

/* Underline mode styles */
.selection-rect.markup-underline {
    background-color: transparent !important;
    border-bottom: 1px solid;
    opacity: 1 !important;
}

.selection-rect.markup-underline.class-1 { border-bottom-color: #ff9800 !important; }
.selection-rect.markup-underline.class-2 { border-bottom-color: #f44336 !important; }
.selection-rect.markup-underline.class-3 { border-bottom-color: #ffeb3b !important; }
.selection-rect.markup-underline.class-4 { border-bottom-color: #2196f3 !important; }
.selection-rect.markup-underline.class-5 { border-bottom-color: #4caf50 !important; }
.selection-rect.markup-underline.class-6 { border-bottom-color: #9c27b0 !important; }

/* Line Numbers in Pages */
.ln-box { 
    fill: rgba(0, 255, 0, 0.2); 
    fill-opacity: 0.5; 
    pointer-events: none; 
    user-select: none;
}

.ln-text { 
    fill: #000000; 
    font-family: sans-serif; 
    text-anchor: middle; 
    dominant-baseline: middle; 
    pointer-events: none; 
    user-select: none;
    font-weight: bold;
}

/* Hide line numbers when toggled */
body.line-numbers-hidden .ln-box,
body.line-numbers-hidden .ln-text {
    display: none !important;
    visibility: hidden !important;
}
/* ///////////// END BLOCK *60 */

/* //////////// BLOCK *70 NO LONGER REQUIRED (OLD DOM RECTANGLE DETECTION)

/* ///////////// BEGIN BLOCK *80 */
/* Popup Layer */
#popup-layer {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   /* z-index set by JavaScript from registry (popups.base: 500) */
   pointer-events: none;
}

/* Icon Menu */
.selection-menu,
.icon-menu {
   position: absolute;
   background: white;
   border: 1px solid #999;
   border-radius: 3px;
   padding: 3px;
   display: flex;
   gap: 2px;
   box-shadow: 0 2px 5px rgba(0,0,0,0.3);
   /* z-index set by JavaScript from registry (overlays.hoverMenus: 300) */
   pointer-events: auto;
}

.menu-icon-btn,
.icon-button {
   background: transparent;
   border: none;
   padding: 2px;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   border-radius: 2px;
   transition: background 0.2s;
}

.menu-icon-btn:hover,
.icon-button:hover {
   background: #e0e0e0;
}

/* Highlight Palette */
#highlight-palette {
   position: absolute;
   background: white;
   border: 1px solid #ccc;
   border-radius: 4px;
   padding: 5px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.15);
   /* z-index set by JavaScript from registry (popups.palette: 650) */
   pointer-events: auto;
}
/* ///////////// END BLOCK *80 */

/* ///////////// BEGIN BLOCK *90 */
/* Search Highlights */
.search-highlight {
   background: rgba(255, 0, 255, 0.3) !important;
   border: 1px solid rgba(255, 0, 255, 0.5);
}

/* Loading Indicator */
#loading-indicator {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(0, 0, 0, 0.5);
   display: none;
   align-items: center;
   justify-content: center;
   /* z-index set by JavaScript from registry (system.loading: 9500) */
}

.loading-spinner {
   width: 50px;
   height: 50px;
   border: 5px solid #f3f3f3;
   border-top: 5px solid #3498db;
   border-radius: 50%;
   animation: spin 1s linear infinite;
}

@keyframes spin {
   0% { transform: rotate(0deg); }
   100% { transform: rotate(360deg); }
}

.loading-text {
   color: white;
   margin-top: 20px;
   font-size: 18px;
}
/* ///////////// END BLOCK *90 */

/* ///////////// REPLACE BLOCK *91 */
/* Search Highlights - Using Selection System */
.selection-rect.class-search {
    background-color: #00CED1 !important; /* Cyan for search */
    opacity: 0.25;  /* Dim by default */
    border: none;
}

/* Current search result */
.selection-rect.class-search.search-current {
    opacity: 0.9;  /* Bright for current result */
}

/* Temporary search selection during Alt+S drag */
.selection-rect.class-search.temp-search-selection {
    opacity: 0.9 !important;  /* Full brightness during drag */
    background-color: #00CED1 !important;
}

/* Operation mode visual feedback */
.selection-rect.selection-extending {
    border: 2px solid #4CAF50 !important;
    animation: pulse 0.5s infinite;
}

.selection-rect.selection-join-candidate {
    border: 2px solid #2196F3 !important;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
    animation: pulse 0.5s infinite;
}

.selection-rect.selection-deleting {
    opacity: 0.3 !important;
    text-decoration: line-through;
}

.selection-rect.selection-divide {
    border-left: 3px solid #FF5722 !important;
    border-right: 3px solid #FF5722 !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
/* ///////////// END BLOCK *91 */

/* ///////////// BEGIN BLOCK *100 */
/* Multi-Selection Menu */
#multi-selection-menu {
   position: fixed;
   background: white;
   border: 1px solid #ddd;
   border-radius: 4px;
   padding: 10px;
   box-shadow: 0 2px 10px rgba(0,0,0,0.2);
   /* z-index set by JavaScript from registry (popups.base: 500) */
}

#multi-selection-menu button {
   display: block;
   width: 100%;
   padding: 8px;
   margin: 5px 0;
   background: #4CAF50;
   color: white;
   border: none;
   border-radius: 4px;
   cursor: pointer;
}

#multi-selection-menu button:hover {
   background: #45a049;
}
/* ///////////// END BLOCK *100 */

/* ///////////// BEGIN BLOCK *110 */
/* Screenshot Frame */
#screenshot-frame,
.screenshot-frame {
   position: fixed;
   border: 2px dashed #4CAF50;
   background: rgba(76, 175, 80, 0.1);
   pointer-events: none;
   /* z-index set by JavaScript from registry (system.screenshot: 9000) */
}

.resize-handle {
   position: absolute;
   width: 10px;
   height: 10px;
   background: #4CAF50;
   border: 1px solid white;
   pointer-events: auto;
   cursor: pointer;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }

#screenshot-coords {
   position: absolute;
   bottom: -25px;
   left: 0;
   background: #4CAF50;
   color: white;
   padding: 2px 8px;
   border-radius: 2px;
   font-size: 12px;
   white-space: nowrap;
}

/* Screenshot mode */
body.screenshot-mode #pages-container {
   cursor: crosshair;
}
/* ///////////// END BLOCK *110 */

/* ///////////// BEGIN BLOCK *120 */
/* Notifications */
.error-notification,
.success-notification {
   position: fixed;
   top: 20px;
   right: 20px;
   padding: 15px 20px;
   border-radius: 4px;
   box-shadow: 0 2px 10px rgba(0,0,0,0.2);
   /* z-index set by JavaScript from registry (system.notifications: 9900) */
   animation: slideIn 0.3s ease;
}

.error-notification {
   background: #f44336;
   color: white;
}

.success-notification {
   background: #4CAF50;
   color: white;
}

@keyframes slideIn {
   from {
       transform: translateX(100%);
       opacity: 0;
   }
   to {
       transform: translateX(0);
       opacity: 1;
   }
}
/* ///////////// END BLOCK *120 */

/* ///////////// REPLACE BLOCK *130
/* Popup Panels */
.document-load-popup,
.search-popup,
.settings-panel,
.help-panel,
.image-library-panel {
   position: fixed;
   background: white;
   border: 1px solid #ddd;
   border-radius: 4px;
   box-shadow: 0 4px 20px rgba(0,0,0,0.3);
   /* z-index set by JavaScript from registry (popups.base: 500) */
   padding: 20px;
   pointer-events: auto; /* Ensure popup captures its own events */
}

/* Special handling for search popup to ensure it doesn't block document interaction */
.search-popup {
   padding: 8px;
   pointer-events: auto;
}

.panel-header {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 15px;
   padding-bottom: 10px;
   border-bottom: 1px solid #eee;
}

.panel-header h3 {
   margin: 0;
   font-size: 18px;
   color: #333;
}

.close-btn {
   background: none;
   border: none;
   font-size: 24px;
   cursor: pointer;
   color: #999;
   padding: 0;
   width: 30px;
   height: 30px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.close-btn:hover {
   color: #333;
}

.panel-content {
   max-height: 400px;
   overflow-y: auto;
}
/* ///////////// END BLOCK *130 */

/* ///////////// ADD BLOCK *135 */
/* Tooltip Styles */
.screenshot-icon-container {
    position: absolute;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    gap: 6px;
    padding: 3px;
    pointer-events: auto;
}

.screenshot-icon-container svg {
    cursor: pointer;
    background: transparent;
    transition: background 0.2s;
}

.screenshot-icon-container svg:hover {
    background: rgba(0,0,0,0.05);
    border-radius: 2px;
}

#selection-tooltip {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ///////////// END BLOCK *135 */



/* ///////////// ADD BLOCK *136 (Insert between existing BLOCK *135 and existing BLOCK *140) */
/* Lock Challenge Dialog Styles */
.lock-challenge-dialog {
    animation: slideDown 0.2s ease;
}

.lock-challenge-backdrop {
    animation: fadeIn 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.lock-challenge-dialog button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lock-challenge-dialog #challenge-proceed:hover {
    background: #f57c00 !important;
}

.lock-challenge-dialog #challenge-cancel:hover {
    background: #e0e0e0 !important;
}

/* Locked selection visual indicator */
.selection-rect.locked {
    border: 2px solid rgba(255, 152, 0, 0.8) !important;
    box-shadow: inset 0 0 3px rgba(255, 152, 0, 0.3);
}
/* ///////////// END BLOCK *136 */

/* ///////////// REPLACE BLOCK *137 */
/* Margin Indicators for Hidden Selections */
.margin-indicator {
    position: absolute;
    pointer-events: auto !important;  /* Changed from none to auto */
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.margin-indicator:hover {
    opacity: 1;
}

/* Overlap indicators (non-hidden overlapping selections) have different opacity */
.margin-indicator.overlap-indicator {
    opacity: 0.6;
}

.margin-indicator.overlap-indicator:hover {
    opacity: 0.9;
}

/* Color classes for margin indicators - matching selection colors */
.margin-indicator.class-1 { background-color: #ff9800; }
.margin-indicator.class-2 { background-color: #f44336; }
.margin-indicator.class-3 { background-color: #ffeb3b; }
.margin-indicator.class-4 { background-color: #2196f3; }
.margin-indicator.class-5 { background-color: #4caf50; }
.margin-indicator.class-6 { background-color: #9c27b0; }

/* Remove the selection-hidden visual feedback - it interferes with temp visibility */
/* Hidden selections are already display:none, no need for extra styling */
/* ///////////// END BLOCK *137 */

/* ///////////// REPLACE BLOCK *138 */
/* Display state styles for selections */
.selection-temp-visible {
    /* Show at NORMAL opacity when temporarily visible */
    opacity: 0.5 !important;  /* Normal highlight opacity */
}

.selection-temp-visible.markup-underline {
    opacity: 1 !important;  /* Full opacity for underlines */
}

/* Keep the original opacity for normal (non-temporary) selections */
.selection-rect:not(.selection-temp-visible) {
    opacity: 0.5;  /* Normal highlight opacity when not temporary */
}

.selection-rect.markup-underline:not(.selection-temp-visible) {
    opacity: 1;  /* Full opacity for underlines when not temporary */
}

/* Hidden selections that are NOT temporarily visible should be very faint */
.selection-rect.selection-hidden:not(.selection-temp-visible) {
    opacity: 0.1 !important;
    border: 1px dashed currentColor;
}

.selection-focused {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    animation: pulse 0.5s ease;
}

/* Interactive margin indicators */
.margin-indicator:hover {
    opacity: 1;
    width: 6px !important;
    transition: all 0.2s ease;
}

.margin-indicator.interactive {
    cursor: pointer;
    transition: all 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.7; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
/* ///////////// END BLOCK *138 */

/* ///////////// BEGIN BLOCK *140 */
/* Zoom Display - REMOVED (using browser native zoom) */
/* ///////////// END BLOCK *140 */

/* ///////////// BEGIN BLOCK *150 */
/* Overlay Container */
#overlay-container {
   position: absolute;
   top: 0;
   left: 0;
   pointer-events: none;
   /* z-index set by JavaScript from registry */
}

/* Scrollbar Styles */
::-webkit-scrollbar {
   width: 12px;
   height: 12px;
}

::-webkit-scrollbar-track {
   background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
   background: #888;
   border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
   background: #555;
}
/* ///////////// END BLOCK *150 */

/* ///////////// ADD BLOCK *155 - Insert between existing BLOCK *150 and existing BLOCK *160 */
/* Screenshot Mode Styles */
.screenshot-mode {
    cursor: crosshair !important;
}

.screenshot-frame {
    position: absolute;
    border: 1px solid darkgrey;
    background: rgba(128, 128, 128, 0.15);
    pointer-events: none;
}

.screenshot-frame.active {
    pointer-events: auto;
}

/* Screenshot resize handles */
.screenshot-frame .resize-handle {
    position: absolute;
    background: white;
    border: 1px solid black;
    width: 16px;
    height: 16px;
    pointer-events: auto;
}

.screenshot-frame .resize-handle.top {
    left: 50%;
    margin-left: -8px;
    cursor: ns-resize;
    top: -9px;
}

.screenshot-frame .resize-handle.bottom {
    left: 50%;
    margin-left: -8px;
    cursor: ns-resize;
    bottom: -9px;
}

.screenshot-frame .resize-handle.left {
    top: 50%;
    margin-top: -8px;
    cursor: ew-resize;
    left: -9px;
}

.screenshot-frame .resize-handle.right {
    top: 50%;
    margin-top: -8px;
    cursor: ew-resize;
    right: -9px;
}

/* Screenshot icon container menu */
.screenshot-icon-container {
    position: fixed;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    gap: 6px;
    padding: 3px;
    pointer-events: auto;
}

.screenshot-icon-container svg {
    cursor: pointer;
    background: white;
}

.screenshot-icon-container svg:hover {
    background: #f0f0f0;
}

/* Screenshot success tooltip */
.screenshot-success-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: darkgrey;
    font-size: 10px;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
/* ///////////// END BLOCK *155 */

/* ///////////// REPLACE BLOCK *160 */
/* Text Selection (native) */
::selection {
   background: rgba(0, 123, 255, 0.3);
}

::-moz-selection {
   background: rgba(0, 123, 255, 0.3);
}

/* Disable text selection on UI elements */
#header-controls,
#line-numbers,
#menu-panel,
.panel-header,
.icon-menu,
.selection-menu {
   -webkit-user-select: none;
   -moz-user-select: none;
   -ms-user-select: none;
   user-select: none;
}

/* Shake animation for invalid input */
@keyframes shake {
    0%, 100% { transform: translate(-50%, -50%) translateX(0); }
    25% { transform: translate(-50%, -50%) translateX(-5px); }
    75% { transform: translate(-50%, -50%) translateX(5px); }
}
/* ///////////// END BLOCK *160 */

/* ///////////// BEGIN BLOCK *165 */
/* Annotation Document Container Styles */
.quill-annotation-container {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    min-width: 400px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    /* z-index set dynamically via registry lookup */
}

.quill-annotation-header {
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.quill-annotation-title {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.quill-annotation-controls {
    display: flex;
    gap: 10px;
}

.quill-annotation-minimize,
.quill-annotation-maximize,
.quill-annotation-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quill-annotation-minimize:hover,
.quill-annotation-maximize:hover,
.quill-annotation-close:hover {
    color: #333;
}

.quill-annotation-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quill-annotation-resize {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, #ccc 50%);
}
/* ///////////// END BLOCK *165 */

/* ///////////// BEGIN BLOCK *166 */
/* Quill Annotation Block Styles */
.quill-annotation-entry {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin: 10px 0;
    padding: 12px;
    background: #fafafa;
    position: relative;
}

.quill-annotation-entry.class-1 { border-left: 4px solid #ff9800; }
.quill-annotation-entry.class-2 { border-left: 4px solid #f44336; }
.quill-annotation-entry.class-3 { border-left: 4px solid #ffeb3b; }
.quill-annotation-entry.class-4 { border-left: 4px solid #2196f3; }
.quill-annotation-entry.class-5 { border-left: 4px solid #4caf50; }
.quill-annotation-entry.class-6 { border-left: 4px solid #9c27b0; }

.quill-annotation-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.quill-annotation-entry-title {
    font-weight: bold;
    font-size: 12px;
    color: #333;
}

.quill-annotation-entry-controls {
    display: flex;
    gap: 8px;
}

.quill-annotation-entry-quoted {
    background: white;
    padding: 8px;
    margin: 8px 0;
    border-radius: 3px;
    font-style: italic;
    color: #666;
    font-size: 13px;
}

.quill-annotation-entry-note {
    padding: 8px;
    background: white;
    border-radius: 3px;
    min-height: 40px;
    font-size: 13px;
    color: #333;
}
/* ///////////// END BLOCK *166 */

/* ///////////// BEGIN BLOCK *167 */
/* Quill Filter Bar Styles */
.quill-filter-bar {
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quill-filter-colors {
    display: flex;
    gap: 15px;
    align-items: center;
}

.quill-filter-label {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    margin-right: 10px;
}

.quill-color-filter {
    display: flex;
    align-items: center;
    gap: 5px;
}

.quill-color-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--filter-color);
}

.quill-color-checkbox[data-color="1"] { accent-color: #ff9800; }
.quill-color-checkbox[data-color="2"] { accent-color: #f44336; }
.quill-color-checkbox[data-color="3"] { accent-color: #ffeb3b; }
.quill-color-checkbox[data-color="4"] { accent-color: #2196f3; }
.quill-color-checkbox[data-color="5"] { accent-color: #4caf50; }
.quill-color-checkbox[data-color="6"] { accent-color: #9c27b0; }

.quill-color-label {
    font-size: 12px;
    color: #333;
    user-select: none;
    cursor: pointer;
}

.quill-filter-sort {
    display: flex;
    gap: 10px;
    align-items: center;
}

.quill-sort-select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    background: white;
}
/* ///////////// END BLOCK *167 */

/* ///////////// BEGIN BLOCK *168 */
/* Quill Annotation Control Button Styles */
.annotation-goto-btn,
.annotation-delete-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.annotation-goto-btn:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.annotation-delete-btn:hover {
    background: #ffebee;
    border-color: #f44336;
}

.annotation-goto-btn svg,
.annotation-delete-btn svg {
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Quill Editor Container Styles */
.quill-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.quill-editor-container {
    flex: 1;
    overflow: auto;
    background: white;
    border: 1px solid #ddd;
}

.ql-toolbar {
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    background: #fafafa;
}

.ql-container {
    border: none !important;
    font-size: 14px;
}

.ql-editor {
    min-height: 200px;
}

/* Annotation entry within Quill */
.ql-editor .quill-annotation-entry {
    user-select: none;
    margin: 15px 0;
}

.ql-editor .quill-annotation-entry-note {
    user-select: text;
    outline: none;
}

.ql-editor .quill-annotation-entry-note:focus {
    background: #f0f8ff;
    border: 1px solid #2196f3;
    padding: 7px;
}
/* ///////////// END BLOCK *168 */

/* ///////////// BEGIN BLOCK *170 */
/* Temporary Selection State */
.temp-selection {
   background: rgba(100, 100, 255, 0.2) !important;
   border: 1px solid rgba(100, 100, 255, 0.5);
}

/* Selection Overlay (old system - deprecated) */
.selection-overlay {
   position: absolute;
   background: rgba(255, 255, 0, 0.3);
   pointer-events: none;
   border: 1px solid rgba(255, 200, 0, 0.5);
   z-index: 5;
}
/* ///////////// END BLOCK *170 */

/* ///////////// BEGIN BLOCK *200 */
/* Canvas Detection Styles */
.detection-canvas {
    cursor: text !important;
}

.detection-canvas:active {
    cursor: text !important;
}

/* Debug mode styles */
.detection-canvas[style*="opacity: 0.3"] {
    mix-blend-mode: multiply;
}
/* ///////////// END BLOCK *200 */

/* Word-compatible font families - Text Rendering */
.ql-font-calibri { font-family: Calibri, sans-serif; }
.ql-font-arial { font-family: Arial, sans-serif; }
.ql-font-times-new-roman { font-family: 'Times New Roman', serif; }
.ql-font-cambria { font-family: Cambria, serif; }
.ql-font-georgia { font-family: Georgia, serif; }
.ql-font-verdana { font-family: Verdana, sans-serif; }
.ql-font-tahoma { font-family: Tahoma, sans-serif; }
.ql-font-courier-new { font-family: 'Courier New', monospace; }

/* Font sizes in points (converted to pixels at 96 DPI: 1pt = 1.333px) */
.ql-size-8pt { font-size: 10.67px; }
.ql-size-9pt { font-size: 12px; }
.ql-size-10pt { font-size: 13.33px; }
.ql-size-11pt { font-size: 14.67px; }
.ql-size-12pt { font-size: 16px; }
.ql-size-14pt { font-size: 18.67px; }
.ql-size-16pt { font-size: 21.33px; }
.ql-size-18pt { font-size: 24px; }
.ql-size-20pt { font-size: 26.67px; }
.ql-size-22pt { font-size: 29.33px; }
.ql-size-24pt { font-size: 32px; }
.ql-size-26pt { font-size: 34.67px; }
.ql-size-28pt { font-size: 37.33px; }
.ql-size-36pt { font-size: 48px; }
.ql-size-48pt { font-size: 64px; }
.ql-size-72pt { font-size: 96px; }

/* Quill Dropdown Labels - Font Picker Display */
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=calibri]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=calibri]::before {
    content: 'Calibri' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=arial]::before {
    content: 'Arial' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=times-new-roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=times-new-roman]::before {
    content: 'Times New Roman' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=cambria]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=cambria]::before {
    content: 'Cambria' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=georgia]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=georgia]::before {
    content: 'Georgia' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=verdana]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=verdana]::before {
    content: 'Verdana' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=tahoma]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=tahoma]::before {
    content: 'Tahoma' !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=courier-new]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=courier-new]::before {
    content: 'Courier New' !important;
}

/* Quill Size Dropdown Labels */
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="8pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="8pt"]::before { content: '8pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="9pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="9pt"]::before { content: '9pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="10pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="10pt"]::before { content: '10pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="11pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="11pt"]::before { content: '11pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12pt"]::before { content: '12pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14pt"]::before { content: '14pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16pt"]::before { content: '16pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18pt"]::before { content: '18pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20pt"]::before { content: '20pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="22pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="22pt"]::before { content: '22pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="24pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="24pt"]::before { content: '24pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="26pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="26pt"]::before { content: '26pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="28pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="28pt"]::before { content: '28pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="36pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="36pt"]::before { content: '36pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="48pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="48pt"]::before { content: '48pt' !important; }
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="72pt"]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="72pt"]::before { content: '72pt' !important; }