/**
 * Signature Positioner Styles
 */

.signature-positioner {
    display: flex;
    flex-direction: column;
    height: 80vh;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.positioner-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-left, .toolbar-center, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-info, .zoom-info {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.positioner-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pdf-canvas-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background: #6c757d;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
}

#pdfCanvas {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    background: white;
}

.signature-boxes-container {
    position: absolute;
    pointer-events: none;
    /* Position and size set dynamically by JavaScript */
}

.signature-box {
    position: absolute;
    border: 3px dashed #5B9BD5;
    background: rgba(91, 155, 213, 0.1);
    cursor: move;
    pointer-events: all;
    border-radius: 4px;
    transition: all 0.2s;
}

.signature-box:hover {
    background: rgba(91, 155, 213, 0.2);
    border-color: #5B9BD5;
    box-shadow: 0 4px 8px rgba(91, 155, 213, 0.3);
}

.signature-box.active {
    border-color: #4A90E2;
    border-style: solid;
    background: rgba(74, 144, 226, 0.15);
    z-index: 100;
}

.signature-box-header {
    background: #5B9BD5;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 2px 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.signature-box.active .signature-box-header {
    background: #4A90E2;
}

.signature-box-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 24px);
    font-size: 12px;
    color: #495057;
    font-weight: 500;
}

.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #5B9BD5;
    cursor: se-resize;
    border-radius: 0 0 2px 0;
}

.signature-box.active .resize-handle {
    background: #4A90E2;
}

/* Signers Panel */
.signers-panel {
    width: 300px;
    background: white;
    border-left: 1px solid #ddd;
    padding: 20px;
    overflow-y: auto;
}

.signers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signer-item {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.signer-item:hover {
    border-color: #5B9BD5;
    background: #f8f9fa;
}

.signer-item.active {
    border-color: #4A90E2;
    background: #E8F4F8;
}

.badge-position {
    font-size: 10px;
    padding: 4px 8px;
}

.badge-position.bg-secondary {
    background-color: #6c757d !important;
}

.badge-position.bg-success {
    background-color: #7CB342 !important;
}

/* jQuery UI Overrides */
.ui-draggable-dragging {
    opacity: 0.8;
    z-index: 1000;
}

.ui-resizable-se {
    bottom: -2px;
    right: -2px;
}

/* Responsive */
@media (max-width: 992px) {
    .positioner-content {
        flex-direction: column;
    }
    
    .signers-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        max-height: 300px;
    }
    
    .toolbar-left, .toolbar-center, .toolbar-right {
        width: 100%;
        justify-content: center;
    }
}

/* Loading State */
.positioner-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex-direction: column;
    gap: 15px;
}

.positioner-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-color: #5B9BD5;
    border-right-color: transparent;
}

