.pdf-canvas-container {
    position: relative;
    display: inline-block;
    margin: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.editable-element {
    position: absolute;
    cursor: move;
    pointer-events: auto;
    border: 2px dashed transparent;
}

.editable-element:hover {
    border-color: #3b82f6;
}

.editable-element.selected {
    border-color: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.text-element {
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    min-width: 100px;
    min-height: 30px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.text-element[contenteditable="true"] {
    outline: 2px solid #3b82f6;
    cursor: text;
}

.signature-element {
    background: white;
    border-radius: 4px;
}

.image-element img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border: 1px solid white;
    border-radius: 50%;
    right: -5px;
    bottom: -5px;
    cursor: nwse-resize;
}

.edit-mode-indicator {
    position: absolute;
    top: -25px;
    left: 0;
    background: #3b82f6;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.toolbar-btn {
    transition: all 0.2s;
}

.toolbar-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

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

.ocr-overlay {
    position: absolute;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid #3b82f6;
    cursor: pointer;
}

.ocr-overlay:hover {
    background: rgba(59, 130, 246, 0.2);
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}