﻿/* esign.css - Styles for e-signature functionality */

/* General e-signature styling */
.document-preview {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    padding: 20px;
    background-color: #fff;
    min-height: 500px;
    max-height: 800px;
    overflow-y: auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Enhanced signature pad styling */
.signature-pad-container {
    margin-bottom: 2rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f8f9fa;
}

.signature-pad {
    border: 2px dashed #6c757d;
    border-radius: 4px;
    background-color: white;
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none; /* Prevent scrolling on touch devices */
}

    .signature-pad canvas {
        display: block;
        border: none !important;
        border-radius: 4px;
        background-color: white;
        width: 100% !important;
        height: 200px !important;
        max-width: 100%;
        cursor: crosshair;
        touch-action: none;
    }

    .signature-pad:hover {
        border-color: #495057;
    }

    .signature-pad:active {
        border-color: #007bff;
    }

.signature-pad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
}

    .signature-pad-header button {
        font-size: 0.875rem;
    }

/* Loading spinner */
.signature-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .signature-pad-container {
        margin-bottom: 1.5rem;
        padding: 0.75rem;
    }

    .signature-pad canvas {
        height: 150px !important;
    }

    .signature-pad-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

        .signature-pad-header button {
            align-self: flex-end;
        }
}

/* Ensure canvas is interactive */
canvas {
    -ms-touch-action: none;
    touch-action: none;
}

/* Add visual feedback when drawing */
.signature-pad.drawing {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Instructions text */
.signature-instructions {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Error state */
.signature-pad.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.signature-error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}
/* Editor styling for document templates */
.editor-textarea {
    font-family: "Courier New", monospace;
    font-size: 14px;
    min-height: 400px;
    line-height: 1.5;
    padding: 12px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.editor-toolbar {
    padding: 8px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
}

.empty-state-message {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--gray-600);
    max-width: 400px;
    margin: 0 auto;
}

/* PDF viewer styles */
.pdf-viewer {
    width: 100%;
    height: 800px;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f0f0f0;
}

    .pdf-viewer iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

/* Template variables styling */
.template-variables {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

    .template-variables .badge {
        font-size: 0.85rem;
        padding: 0.5rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .template-variables .badge:hover {
            background-color: var(--primary-color);
            color: white;
        }

/* Settings navigation */
.settings-nav {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.settings-nav-header {
    background-color: var(--gray-100);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.settings-nav .list-group-item {
    padding: 0.75rem 1.5rem;
    border-color: var(--gray-200);
    display: flex;
    align-items: center;
}

    .settings-nav .list-group-item i {
        margin-right: 0.75rem;
    }

    .settings-nav .list-group-item.active {
        background-color: var(--primary-light);
        color: var(--primary-color);
        border-color: var(--gray-200);
        border-left: 4px solid var(--primary-color);
    }

/* Setting section styling */
.setting-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

    .setting-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }

.setting-title {
    color: var(--gray-700);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .document-preview {
        padding: 15px;
        min-height: 300px;
    }

    .pdf-viewer {
        height: 500px;
    }

    .template-variables .badge {
        font-size: 0.75rem;
        padding: 0.4rem;
    }

    .editor-toolbar button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
}

/* Print styles */
@media print {
    .document-preview {
        box-shadow: none;
        min-height: auto;
        max-height: none;
        overflow: visible;
    }

    .card {
        box-shadow: none !important;
        border: none !important;
    }

    .card-header, .card-footer,
    .btn, .no-print {
        display: none !important;
    }

    body {
        background-color: white !important;
    }
}
