/* Editor Specific Styles */
/* These styles control the interactive elements, bounding boxes, and overlays */

.editor-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    flex-direction: column;
}

.editor-toolbar {
    height: 48px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    border-right: 1px solid var(--border-color);
    padding-right: 12px;
}
.toolbar-group:last-child {
    border-right: none;
}

.tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    transition: all 0.1s;
}

.tool-btn:hover {
    background: var(--bg-main);
}

.tool-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Canvas Area */
.canvas-scroll-area {
    flex: 1;
    overflow: auto;
    position: relative;
    /* Allow hand-panning */
    cursor: default;
}

.canvas-scroll-area.tool-pan {
    cursor: grab;
}
.canvas-scroll-area.tool-pan:active {
    cursor: grabbing;
}

.canvas-zoom-wrapper {
    /* Transforms applied here for zoom */
    transform-origin: 0 0;
    position: relative;
    padding: 40px; /* Space around A4 page */
    width: max-content;
    height: max-content;
    min-width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 
 * The actual quotation page is position: relative
 * We create an absolute overlay exactly on top of it for annotations
 */
.annotation-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to quote unless hitting an annotation */
    z-index: 100;
}

.annotation-layer.drawing-active {
    pointer-events: auto;
    cursor: crosshair;
}

/* Editable Elements */
[contenteditable="true"] {
    outline: none;
    cursor: text;
    transition: background 0.2s;
    border-radius: 2px;
}

[contenteditable="true"]:hover {
    background: rgba(26, 79, 139, 0.05);
    box-shadow: 0 0 0 1px rgba(26, 79, 139, 0.2);
}

[contenteditable="true"]:focus {
    background: rgba(26, 79, 139, 0.05);
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Editable Images */
.editable-image {
    cursor: pointer;
    transition: opacity 0.2s;
}

.editable-image:hover {
    opacity: 0.8;
}
.editable-image-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
/* We need wrappers for images to show the overlay easily */
.image-wrapper {
    position: relative;
    display: inline-block;
}
.image-wrapper:hover .editable-image-overlay {
    opacity: 1;
}


/* Annotations */
.annotation-object {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
}

.annotation-object.selected {
    outline: 1px solid #0ea5e9;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 1px solid #0ea5e9;
    border-radius: 50%;
    display: none;
    z-index: 10;
}
.annotation-object.selected .resize-handle {
    display: block;
}

/* Corners */
.handle-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }
.handle-br { bottom: -5px; right: -5px; cursor: nwse-resize; }

/* Rotate Handle */
.handle-rotate {
    top: -25px;
    left: calc(50% - 5px);
    cursor: grab;
    background: #0ea5e9;
    border-color: #0ea5e9;
}
.annotation-object.selected::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    width: 1px;
    height: 15px;
    background: #0ea5e9;
    display: block;
}

/* Text Box Annotation */
.anno-text {
    background: transparent;
    border: 1px dashed transparent;
    padding: 4px 8px;
    min-width: 50px;
    min-height: 24px;
    color: var(--danger); /* Red text by default for dims */
    font-weight: bold;
    font-size: 14px;
    font-family: var(--quote-font);
}
.anno-text.selected {
    border-color: #0ea5e9;
}

/* SVG Arrows Overlay */
.arrow-svg-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}

.arrow-path {
    fill: none;
    stroke: var(--danger);
    stroke-width: 2;
    pointer-events: stroke; /* Only stroke is clickable */
    cursor: pointer;
}
.arrow-path.selected {
    stroke: #0ea5e9;
}

 / *   E x p o r t i n g   O v e r r i d e s   * / 
 . e x p o r t i n g   . d e l - r o w - b t n , 
 . e x p o r t i n g   # a d d - p r i c e - r o w   { 
         d i s p l a y :   n o n e   ! i m p o r t a n t ; 
 } 
 . e x p o r t i n g   [ c o n t e n t e d i t a b l e ]   { 
         b o x - s h a d o w :   n o n e   ! i m p o r t a n t ; 
         b a c k g r o u n d :   t r a n s p a r e n t   ! i m p o r t a n t ; 
 } 
  
 