/* Multi-Signature Enhancement Styles - COMPACT VERSION */

/* Compact Signature Toolbar */
.signature-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin: 10px 0;
    min-height: 50px;
}

.signature-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

/* Compact Mode Toggle */
.compact-mode-toggle {
    padding: 6px 12px;
    border: 2px solid #007bff;
    background: white;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.compact-mode-toggle.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.compact-mode-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Compact Counter Badge */
.compact-counter {
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 60px;
    justify-content: center;
}

.compact-counter.empty {
    background: #6c757d;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 8px;
}

.quick-action-btn {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-action-btn.primary {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.quick-action-btn.primary:hover {
    background: #0056b3;
}

.quick-action-btn.secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.quick-action-btn.secondary:hover {
    background: #6c757d;
    color: white;
}

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

/* Compact Status */
.compact-status {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.compact-status.active {
    color: #28a745;
    font-weight: 500;
}

/* Popup Signature List */
.signature-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    max-height: 400px;
    display: none;
}

.signature-popup.visible {
    display: block;
    animation: popupFadeIn 0.3s ease-out;
}

.signature-popup-header {
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signature-popup-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.popup-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #495057;
}

.signature-popup-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.signature-popup-item {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f3f4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.signature-popup-item:hover {
    background: #f8f9fa;
}

.signature-popup-item:last-child {
    border-bottom: none;
}

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

.popup-signature-location {
    font-weight: 500;
    color: #495057;
    font-size: 13px;
}

.popup-signature-coordinates {
    font-size: 11px;
    color: #6c757d;
    font-family: monospace;
}

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

.popup-action-btn {
    padding: 3px 6px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.popup-action-btn.goto {
    color: #007bff;
    border-color: #007bff;
}

.popup-action-btn.goto:hover {
    background: #007bff;
    color: white;
}

.popup-action-btn.remove {
    color: #dc3545;
    border-color: #dc3545;
}

.popup-action-btn.remove:hover {
    background: #dc3545;
    color: white;
}

/* Popup Overlay */
.signature-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    display: none;
}

.signature-popup-overlay.visible {
    display: block;
    animation: overlayFadeIn 0.3s ease-out;
}

/* Signature Placement Mode */
.pdf-viewer.signature-mode {
    cursor: crosshair;
}

.pdf-viewer.signature-mode .pdf-page {
    position: relative;
}

.signature-preview {
    position: absolute;
    pointer-events: none;
    opacity: 0.7;
    border: 2px dashed #007bff;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    z-index: 10;
    display: none;
}

.signature-preview.visible {
    display: block;
}

/* Compact Signature Markers */
.signature-marker {
    position: absolute;
    border: 2px solid #28a745;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
}

.signature-marker:hover {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.05);
}

.signature-marker::after {
    content: attr(data-signature-number);
    position: absolute;
    top: -6px;
    right: -6px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.signature-marker:hover::after {
    background: #dc3545;
}

/* Page Navigation Enhancement */
.page-signature-indicator {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes popupFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes overlayFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes signaturePlaced {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.signature-marker.newly-placed {
    animation: signaturePlaced 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .signature-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    
    .signature-toolbar-left,
    .signature-toolbar-right {
        justify-content: center;
    }
    
    .signature-popup {
        width: 95%;
        max-height: 350px;
    }
    
    .signature-popup-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .popup-signature-actions {
        justify-content: center;
    }
}

/* Hide original signature controls when in multi-signature mode */
.multi-signature-active #signature-controls {
    display: none;
}

/* Enhanced sign button when in multi-signature mode */
.enhanced-sign-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.enhanced-sign-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.enhanced-sign-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

