/* ============================================
   Sign Document Page Styling
   ============================================ */

.sign-document-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

/* Header */
.sign-document-header {
    background: white;
    border-bottom: 2px solid #dee2e6;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.sign-document-header h4 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.sign-progress-indicator {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.sign-progress-indicator .badge {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* Message */
.sign-document-message {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #dee2e6;
}

/* Document Viewer */
.sign-document-viewer {
    flex: 1;
    padding: 2rem 0;
    overflow-y: auto;
}

.document-viewer-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
}

.pdf-viewer-placeholder {
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    position: relative;
}

/* Signature Fields Overlay */
.signature-fields-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.signature-field-placeholder {
    position: absolute;
    border: 2px solid #0d6efd;
    background: rgba(13, 110, 253, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: auto;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0d6efd;
}

.signature-field-placeholder:hover {
    background: rgba(13, 110, 253, 0.2);
    border-width: 3px;
    transform: scale(1.02);
}

.signature-field-placeholder.field-completed {
    border-color: #198754;
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.signature-field-placeholder.field-completed:hover {
    background: rgba(25, 135, 84, 0.2);
}

.signature-field-placeholder i {
    font-size: 1.2rem;
}

.signature-field-placeholder.field-type-initial {
    border-color: #6f42c1;
    background: rgba(111, 66, 193, 0.1);
    color: #6f42c1;
}

.signature-field-placeholder.field-type-date {
    border-color: #0dcaf0;
    background: rgba(13, 202, 240, 0.1);
    color: #0dcaf0;
}

.signature-field-placeholder.field-type-text {
    border-color: #fd7e14;
    background: rgba(253, 126, 20, 0.1);
    color: #fd7e14;
}

.signature-field-placeholder.field-type-checkbox {
    border-color: #20c997;
    background: rgba(32, 201, 151, 0.1);
    color: #20c997;
}

/* Footer */
.sign-document-footer {
    background: white;
    border-top: 2px solid #dee2e6;
    padding: 1.5rem 0;
    position: sticky;
    bottom: 0;
    z-index: 100;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
}

/* Consent Modal */
.consent-text {
    padding: 1rem;
}

.consent-text p {
    margin-bottom: 1rem;
}

.consent-text .form-check {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.consent-text .form-check-input {
    margin-top: 0.25rem;
}

.consent-text .form-check-label {
    font-weight: 600;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .sign-document-header {
        padding: 1rem 0;
    }

    .sign-document-header h4 {
        font-size: 1.25rem;
    }

    .sign-progress-indicator .badge {
        font-size: 0.875rem;
        padding: 0.35rem 0.75rem;
    }

    .sign-document-viewer {
        padding: 1rem 0;
    }

    .document-viewer-container {
        margin: 0 1rem;
    }

    .pdf-viewer-placeholder {
        min-height: 400px;
        padding: 2rem 1rem;
    }

    .sign-document-footer {
        padding: 1rem 0;
    }

    .sign-document-footer .row {
        gap: 1rem;
    }

    .sign-document-footer .col-md-6 {
        width: 100%;
    }

    .sign-document-footer button {
        width: 100%;
    }

    .signature-field-placeholder {
        font-size: 0.75rem;
    }

    .signature-field-placeholder i {
        font-size: 1rem;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(13, 110, 253, 0);
    }
}

.signature-field-placeholder.field-pending {
    animation: pulse 2s infinite;
}

/* Modal Overlay */
.modal-backdrop.show {
    opacity: 0.5;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
