/**
 * Document Preview Engine Styles
 * Professional floating preview panel
 */

.document-preview-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 400px;
    max-height: 600px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    resize: both;
    overflow: hidden;
    min-width: 300px;
    min-height: 200px;
}

.document-preview-panel.expanded {
    width: 60vw;
    height: 80vh;
    top: 10vh;
    right: 20vw;
}

.preview-header {
    background: #0056b3;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    user-select: none;
}

.preview-header:active {
    cursor: grabbing;
}

.preview-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.preview-controls {
    display: flex;
    gap: 8px;
}

.preview-controls .btn {
    padding: 4px 8px;
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.preview-controls .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.preview-content {
    height: calc(100% - 60px);
    overflow-y: auto;
    position: relative;
}

.preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    display: none;
}

.preview-document {
    padding: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.preview-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.preview-section {
    margin-bottom: 24px;
    border-left: 3px solid #e9ecef;
    padding-left: 12px;
}

.preview-section:hover {
    border-left-color: #0056b3;
}

.section-title {
    font-weight: 600;
    color: #0056b3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.section-content {
    color: #495057;
    font-size: 13px;
}

.field-highlight {
    background: rgba(0, 86, 179, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

/* Document content styling */
.preview-document h1,
.preview-document h2,
.preview-document h3 {
    color: #0056b3;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 12px;
}

.preview-document h1 {
    font-size: 16px;
    border-bottom: 2px solid #0056b3;
    padding-bottom: 8px;
}

.preview-document h2 {
    font-size: 14px;
}

.preview-document h3 {
    font-size: 13px;
}

.preview-document p {
    margin-bottom: 12px;
    text-align: justify;
}

.preview-document .signature-block {
    margin-top: 30px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.preview-document .legal-clause {
    font-style: italic;
    background: rgba(0, 86, 179, 0.05);
    padding: 8px;
    border-left: 3px solid #0056b3;
    margin: 12px 0;
}

.preview-document .form-field {
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    color: #856404;
}

.preview-document .state-specific {
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
    padding: 8px;
    margin: 8px 0;
    font-size: 12px;
}

/* Responsive design */
@media (max-width: 768px) {
    .document-preview-panel {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
    
    .document-preview-panel.expanded {
        width: calc(100vw - 20px);
        height: 80vh;
        right: 10px;
        left: 10px;
    }
}

/* Animation for smooth updates */
.preview-section {
    transition: all 0.3s ease;
}

.preview-section.updated {
    background: rgba(0, 86, 179, 0.05);
    transform: scale(1.02);
}

.preview-section.updated::before {
    content: "Updated";
    position: absolute;
    top: -5px;
    right: -5px;
    background: #0056b3;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
}

/* Scrollbar styling */
.preview-content::-webkit-scrollbar {
    width: 6px;
}

.preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #0056b3;
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #004494;
}