/**
 * WP Apps AI Contract Review - Enhanced Public Styles
 * 
 * @package WPApps_AI_Contract_Review
 */

/* Variables */
:root {
    --wpapps-acr-primary: #2271b1;
    --wpapps-acr-success: #46b450;
    --wpapps-acr-warning: #ffb900;
    --wpapps-acr-danger: #dc3232;
    --wpapps-acr-text: #1e1e1e;
    --wpapps-acr-light-gray: #f0f0f1;
    --wpapps-acr-medium-gray: #dcdcde;
    --wpapps-acr-dark-gray: #646970;
    --wpapps-acr-border-radius: 8px;
    --wpapps-acr-box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Wrapper */
.wpapps-acr-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--wpapps-acr-text);
    position: relative;
}


/* Progress Bar */
.wpapps-acr-progress-bar {
    margin-bottom: 40px;
    display: none;
}

.wpapps-acr-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.wpapps-acr-progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--wpapps-acr-light-gray);
}

.wpapps-acr-progress-line-fill {
    height: 100%;
    background: var(--wpapps-acr-primary);
    transition: width 0.3s ease;
    width: 0%;
}

.wpapps-acr-step {
    position: relative;
    text-align: center;
    flex: 1;
    z-index: 1;
}

.wpapps-acr-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--wpapps-acr-light-gray);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.wpapps-acr-step.active .wpapps-acr-step-circle {
    background: var(--wpapps-acr-primary);
    border-color: var(--wpapps-acr-primary);
    color: white;
}

.wpapps-acr-step.completed .wpapps-acr-step-circle {
    background: var(--wpapps-acr-success);
    border-color: var(--wpapps-acr-success);
    color: white;
}

.wpapps-acr-step-label {
    display: block;
    font-size: 14px;
    color: var(--wpapps-acr-dark-gray);
}

/* Step Container */
.wpapps-acr-contract-step {
    display: none;
}

.wpapps-acr-contract-step.active {
    display: block;
}

.wpapps-acr-step-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Question Card */
.wpapps-acr-question-card {
    background: white;
    border-radius: var(--wpapps-acr-border-radius);
    padding: 40px;
    box-shadow: var(--wpapps-acr-box-shadow);
}

.wpapps-acr-question-title {
    font-size: 28px;
    margin: 0 0 10px;
    text-align: center;
}

.wpapps-acr-question-subtitle {
    font-size: 16px;
    color: var(--wpapps-acr-dark-gray);
    text-align: center;
    margin: 0 0 30px;
}

/* Upload Area */
.wpapps-acr-upload-area {
    border: 2px dashed var(--wpapps-acr-medium-gray);
    border-radius: var(--wpapps-acr-border-radius);
    padding: 60px 20px;
    text-align: center;
    background: #fafafa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpapps-acr-upload-area:hover {
    border-color: var(--wpapps-acr-primary);
    background: #f5f9fc;
}

.wpapps-acr-upload-area.drag-over {
    border-color: var(--wpapps-acr-primary);
    background: #e8f0fe;
    transform: scale(1.02);
}

.wpapps-acr-upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.wpapps-acr-browse-btn {
    margin-top: 20px;
    padding: 10px 24px;
    background: var(--wpapps-acr-primary);
    color: white;
    border: none;
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.wpapps-acr-browse-btn:hover {
    background: #135e96;
}

/* File Selected */
.wpapps-acr-file-selected {
    background: var(--wpapps-acr-light-gray);
    border-radius: var(--wpapps-acr-border-radius);
    padding: 20px;
}

.wpapps-acr-file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wpapps-acr-file-icon {
    font-size: 32px;
}

.wpapps-acr-file-details {
    flex: 1;
}

.wpapps-acr-file-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.wpapps-acr-file-size {
    font-size: 14px;
    color: var(--wpapps-acr-dark-gray);
}

.wpapps-acr-file-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wpapps-acr-remove-file-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--wpapps-acr-medium-gray);
    background: gray;
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.wpapps-acr-remove-file-btn:hover {
    border-color: var(--wpapps-acr-danger);
    color: var(--wpapps-acr-danger);
}

.wpapps-acr-analyze-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--wpapps-acr-primary);
    color: white;
    border: none;
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.wpapps-acr-analyze-btn:hover:not(:disabled) {
    background: #135e96;
}

.wpapps-acr-analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpapps-acr-change-file-link {
    text-align: center;
    margin-top: 15px;
}

.wpapps-acr-change-file-link a {
    color: var(--wpapps-acr-primary);
    text-decoration: none;
    font-size: 14px;
}

/* Document Info Card */
.wpapps-acr-document-info-card {
    background: var(--wpapps-acr-light-gray);
    padding: 15px 20px;
    border-radius: var(--wpapps-acr-border-radius);
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    align-items: center;
}

.wpapps-acr-doc-type,
.wpapps-acr-doc-language {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpapps-acr-label {
    font-weight: 600;
}

.wpapps-acr-value {
    color: var(--wpapps-acr-primary);
}

/* Options Container */
.wpapps-acr-options-container {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.wpapps-acr-option-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: 2px solid var(--wpapps-acr-light-gray);
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpapps-acr-option-card:hover {
    border-color: var(--wpapps-acr-primary);
    background: #f5f9fc;
}

.wpapps-acr-option-card.selected {
    border-color: var(--wpapps-acr-primary);
    background: #f5f9fc;
}

.wpapps-acr-radio-wrapper {
    position: relative;
}

.wpapps-acr-radio-input {
    position: absolute;
    opacity: 0;
}

.wpapps-acr-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--wpapps-acr-medium-gray);
    border-radius: 50%;
    display: block;
    position: relative;
    transition: all 0.3s ease;
}

.wpapps-acr-radio-input:checked + .wpapps-acr-radio-custom {
    border-color: var(--wpapps-acr-primary);
}

.wpapps-acr-radio-input:checked + .wpapps-acr-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--wpapps-acr-primary);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wpapps-acr-party-icon {
    font-size: 32px;
}

.wpapps-acr-party-info {
    flex: 1;
}

.wpapps-acr-party-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.wpapps-acr-party-role {
    font-size: 14px;
    color: var(--wpapps-acr-dark-gray);
}

/* Action Buttons */
.wpapps-acr-action-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.wpapps-acr-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.wpapps-acr-btn-back {
    background: white;
    color: var(--wpapps-acr-text);
    border: 1px solid var(--wpapps-acr-medium-gray);
}

.wpapps-acr-btn-back:hover {
    background: var(--wpapps-acr-light-gray);
}

.wpapps-acr-btn-continue {
    background: var(--wpapps-acr-primary);
    color: white;
}

.wpapps-acr-btn-continue:hover:not(:disabled) {
    background: #135e96;
}

.wpapps-acr-btn-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Analysis Step */
.wpapps-acr-summary-section {
    margin-bottom: 30px;
}

.wpapps-acr-summary-card {
    background: white;
    border-radius: var(--wpapps-acr-border-radius);
    padding: 20px;
    box-shadow: var(--wpapps-acr-box-shadow);
}

.wpapps-acr-summary-header {
    margin-bottom: 20px;
}

.wpapps-acr-summary-title {
    font-size: 24px;
    margin: 0;
}

.wpapps-acr-summary-content {
    color: var(--wpapps-acr-dark-gray);
    line-height: 1.6;
}

/* Main Container */
.wpapps-acr-main-container {
    display: flex;
    gap: 20px;
    height: 700px;
    position: relative;
}

/* Risks Panel */
.wpapps-acr-risks-panel {
    flex: 1;
    background: white;
    border-radius: var(--wpapps-acr-border-radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--wpapps-acr-box-shadow);
}

.wpapps-acr-risks-panel-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.wpapps-acr-page-header {
    margin-bottom: 30px;
}

.wpapps-acr-page-title {
    font-size: 24px;
    margin: 0 0 10px;
}

.wpapps-acr-page-subtitle {
    color: var(--wpapps-acr-dark-gray);
    margin: 0;
}

/* Risk Metrics */
.wpapps-acr-risk-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.wpapps-acr-metric-card {
    text-align: center;
    padding: 20px;
    background: var(--wpapps-acr-light-gray);
    border-radius: var(--wpapps-acr-border-radius);
}

.wpapps-acr-metric-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
}

.wpapps-acr-metric-value.wpapps-acr-risk-high {
    color: var(--wpapps-acr-danger);
}

.wpapps-acr-metric-value.wpapps-acr-risk-medium {
    color: var(--wpapps-acr-warning);
}

.wpapps-acr-metric-label {
    font-size: 14px;
    color: var(--wpapps-acr-dark-gray);
}

/* Clauses Container */
.wpapps-acr-clauses-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.clause-card {
    border: 1px solid var(--wpapps-acr-light-gray);
    border-radius: var(--wpapps-acr-border-radius);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.clause-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    background-color: #f8f9fa;
}

.clause-card.risk-high {
    border-left: 4px solid var(--wpapps-acr-danger);
}

.clause-card.risk-medium {
    border-left: 4px solid var(--wpapps-acr-warning);
}

.clause-card.risk-low {
    border-left: 4px solid var(--wpapps-acr-success);
}

.clause-card.accepted {
    background: #f0f8ff;
}

.clause-card.rejected {
    opacity: 0.6;
    background: #fafafa;
}

.clause-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.clause-header h4 {
    margin: 0;
    font-size: 18px;
}

.clause-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.clause-status.pending {
    background: var(--wpapps-acr-light-gray);
    color: var(--wpapps-acr-dark-gray);
}

.clause-status.analyzed {
    background: var(--wpapps-acr-success);
    color: white;
}

.clause-content {
    color: var(--wpapps-acr-dark-gray);
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom scrollbar for clause content */
.clause-content::-webkit-scrollbar {
    width: 6px;
}

.clause-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.clause-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.clause-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.clause-analysis {
    background: var(--wpapps-acr-light-gray);
    padding: 15px;
    border-radius: var(--wpapps-acr-border-radius);
}

.risk-title {
    font-weight: 600;
    color: var(--wpapps-acr-danger);
    margin-bottom: 10px;
}

.summary {
    margin-bottom: 15px;
    line-height: 1.5;
}

.suggested-revision {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: var(--wpapps-acr-border-radius);
    font-style: italic;
}

.expert-notes {
    margin-bottom: 15px;
    color: var(--wpapps-acr-dark-gray);
    font-size: 14px;
}

.clause-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.accept-clause,
.reject-clause,
.revert-clause {
    padding: 8px 16px;
    border: none;
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.accept-clause {
    background: var(--wpapps-acr-success);
    color: white;
}

.accept-clause:hover:not(:disabled) {
    background: #3a9b3e;
}

.reject-clause {
    background: var(--wpapps-acr-danger);
    color: white;
}

.reject-clause:hover:not(:disabled) {
    background: #b92c2c;
}

.revert-clause {
    background: var(--wpapps-acr-primary);
    color: white;
}

.revert-clause:hover {
    background: #135e96;
}

.accept-clause:disabled,
.reject-clause:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Panel Splitter */
.wpapps-acr-panel-splitter {
    width: 20px;
    cursor: col-resize;
    position: relative;
}

.wpapps-acr-splitter-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wpapps-acr-splitter-dot {
    width: 4px;
    height: 4px;
    background: var(--wpapps-acr-medium-gray);
    border-radius: 50%;
}

.wpapps-acr-panel-splitter:hover .wpapps-acr-splitter-dot,
.wpapps-acr-panel-splitter.active .wpapps-acr-splitter-dot {
    background: var(--wpapps-acr-primary);
}

/* Preview Panel */
.wpapps-acr-preview-panel {
    flex: 1;
    background: white;
    border-radius: var(--wpapps-acr-border-radius);
    box-shadow: var(--wpapps-acr-box-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 700px;
}

.wpapps-acr-preview-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--wpapps-acr-light-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.wpapps-acr-preview-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpapps-acr-header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.wpapps-acr-update-counter {
    background: var(--wpapps-acr-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.wpapps-acr-document-preview {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    overflow-x: hidden;
    min-height: 0;
}

/* Document content - WYSIWYG style */
.wpapps-acr-document-content {
    font-family: inherit;
    color: var(--wpapps-acr-text);
}

/* Updated content highlighting */
.wpapps-acr-document-content .rejected-content {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Export Actions */
.wpapps-acr-export-actions {
    padding: 20px 30px;
    border-top: 1px solid var(--wpapps-acr-light-gray);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: white;
    position: relative;
    z-index: 2;
}

.wpapps-acr-btn-primary {
    background: var(--wpapps-acr-primary);
    color: white;
}

.wpapps-acr-btn-primary:hover {
    background: #135e96;
}

.wpapps-acr-btn-secondary {
    background: white;
    color: var(--wpapps-acr-text);
    border: 1px solid var(--wpapps-acr-medium-gray);
}

.wpapps-acr-btn-secondary:hover {
    background: var(--wpapps-acr-light-gray);
}

/* Loading Overlay */
.wpapps-acr-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.wpapps-acr-loading-content {
    background: white;
    padding: 30px;
    border-radius: var(--wpapps-acr-border-radius);
    text-align: center;
}

.wpapps-acr-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--wpapps-acr-light-gray);
    border-top-color: var(--wpapps-acr-primary);
    border-radius: 50%;
    animation: wpapps-acr-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes wpapps-acr-spin {
    to { transform: rotate(360deg); }
}

.wpapps-acr-loading-text {
    font-size: 16px;
    color: var(--wpapps-acr-text);
}

/* Error Alert */
.wpapps-acr-error-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: white;
    border-left: 4px solid var(--wpapps-acr-danger);
    border-radius: var(--wpapps-acr-border-radius);
    box-shadow: var(--wpapps-acr-box-shadow);
    z-index: 9999;
}

.wpapps-acr-error-content {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wpapps-acr-error-icon {
    font-size: 24px;
}

.wpapps-acr-error-message {
    flex: 1;
}

.wpapps-acr-error-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--wpapps-acr-dark-gray);
}

.wpapps-acr-error-close:hover {
    color: var(--wpapps-acr-danger);
}

/* Responsive */
@media (max-width: 768px) {
    .wpapps-acr-main-container {
        flex-direction: column;
        height: auto;
    }
    
    .wpapps-acr-risks-panel,
    .wpapps-acr-preview-panel {
        height: 400px;
        margin-bottom: 20px;
    }
    
    .wpapps-acr-panel-splitter {
        display: none;
    }
    
    .wpapps-acr-risk-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wpapps-acr-action-buttons {
        flex-direction: column;
    }
}

/* Document preview sections */
.document-preview-content .preview-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.document-preview-content .preview-section.rejected {
    opacity: 0.5;
    text-decoration: line-through;
}

.document-preview-content .preview-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.document-preview-content .preview-section p {
    margin: 0;
    line-height: 1.6;
    color: #495057;
}

.document-preview-content .preview-section p.updated {
    background-color: rgba(212, 237, 218, 0.4);
    padding: 10px;
    border-radius: 4px;
    position: relative;
}

.document-preview-content .preview-section p.updated::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #28a745;
    opacity: 0.5;
    border-radius: 3px 0 0 3px;
}

/* Progress Bar Styles */
.wpapps-acr-analysis-progress {
    margin: 20px 0;
}

.wpapps-acr-progress-bar {    
    border-radius: 10px;    
    overflow: hidden;
    margin-bottom: 10px;
}

.wpapps-acr-progress-fill {
    background: var(--wpapps-acr-primary);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.wpapps-acr-progress-text {
    text-align: center;
    color: var(--wpapps-acr-dark-gray);
    font-size: 14px;
}

/* Document Rating Styles */
.wpapps-acr-document-rating {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.wpapps-acr-rating-summary {
    margin-bottom: 15px;
    font-weight: 600;
}

.wpapps-acr-rating-summary .risk-high {
    color: var(--wpapps-acr-danger);
}

.wpapps-acr-rating-summary .risk-medium {
    color: var(--wpapps-acr-warning);
}

.wpapps-acr-rating-summary .risk-low {
    color: var(--wpapps-acr-success);
}

.wpapps-acr-rating-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--wpapps-acr-dark-gray);
}

.wpapps-acr-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wpapps-acr-legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.wpapps-acr-rating-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wpapps-acr-rating-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.wpapps-acr-rating-label {
    min-width: 140px;
    font-size: 14px;
}

.wpapps-acr-rating-bar {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.wpapps-acr-rating-fill {
    height: 100%;
    transition: width 0.5s ease;
    position: relative;
}

.wpapps-acr-rating-fill.original {
    background: #6c757d;
}

.wpapps-acr-rating-fill.improved {
    background: var(--wpapps-acr-success);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

.wpapps-acr-rating-fill.potential {
    background: #e8f0fe;
    position: relative;
    z-index: 1;
}

.wpapps-acr-rating-fill.potential::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #2196f3;
    box-shadow: 0 0 0 1px rgba(33, 150, 243, 0.3);
}

.wpapps-acr-rating-bar {
    position: relative;
}

.potential-score {
    color: #2196f3;
    font-weight: 600;
}

.wpapps-acr-potential-indicator {
    color: #2196f3;
    font-size: 12px;
    margin-left: 5px;
    cursor: help;
}

.wpapps-acr-potential-indicator i {
    font-size: 14px;
}

.wpapps-acr-rating-score {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
}

/* Clickable Metric Cards */
.wpapps-acr-metric-card.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpapps-acr-metric-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f5f5f5;
}

.wpapps-acr-metric-card.active {
    border: 2px solid var(--wpapps-acr-primary);
    background: #f0f4ff;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.2);
}

/* Enhanced Document Preview */
.document-preview-content .document-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.document-preview-content .original-content.crossed-out {
    text-decoration: line-through;
    opacity: 0.6;
    margin-bottom: 10px;
}

.document-preview-content .updated-content {
    margin-top: 10px;
    position: relative;
}

.document-preview-content .updated-content mark {
    background: linear-gradient(to bottom, transparent 20%, rgba(40, 167, 69, 0.3) 20%, rgba(40, 167, 69, 0.3) 80%, transparent 80%);
    padding: 0;
}

/* Intelligent Summary Styles */
.wpapps-acr-intelligent-summary {
    line-height: 1.8;
}

.wpapps-acr-intelligent-summary .risk-overview {
    font-weight: 600;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255, 243, 205, 0.3);
    border-radius: 4px;
    position: relative;
}

.wpapps-acr-intelligent-summary .risk-overview::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffc107;
    opacity: 0.5;
    border-radius: 3px 0 0 3px;
}

.wpapps-acr-intelligent-summary .document-summary {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* New summary styles */
.wpapps-acr-risk-overview,
.wpapps-acr-document-summary {
    margin-bottom: 0px;
}

.wpapps-acr-risk-overview h4,
.wpapps-acr-document-summary h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--wpapps-acr-text);
}

.wpapps-acr-risk-overview {
    padding: 15px;
    background: rgba(255, 243, 205, 0.25);
    border-radius: 4px;
    position: relative;
}

.wpapps-acr-risk-overview::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #ffc107;
    opacity: 0.4;
    border-radius: 3px 0 0 3px;
}

.wpapps-acr-document-summary {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.wpapps-acr-no-summary {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.wpapps-acr-loading-summary {
    text-align: center;
    padding: 40px;
    color: var(--wpapps-acr-primary);
    font-size: 16px;
}

.wpapps-acr-loading-summary i {
    margin-right: 10px;
    font-size: 20px;
}

/* Export Dialog Styles */
.wpapps-acr-export-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.wpapps-acr-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.wpapps-acr-dialog-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
}

.wpapps-acr-dialog-header {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpapps-acr-dialog-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--wpapps-acr-dark-gray);
}

.wpapps-acr-dialog-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpapps-acr-dialog-close:hover {
    color: #333;
}

.wpapps-acr-dialog-body {
    padding: 20px;
}

.wpapps-acr-dialog-body p {
    margin: 0 0 20px 0;
    color: var(--wpapps-acr-medium-gray);
}

.wpapps-acr-export-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.wpapps-acr-export-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpapps-acr-export-option:hover {
    border-color: var(--wpapps-acr-primary);
    background: #f0f4ff;
    transform: translateY(-2px);
}

.wpapps-acr-export-option i {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.wpapps-acr-export-option i.fa-file-pdf {
    color: #dc3545;
}

.wpapps-acr-export-option i.fa-file-word {
    color: #0066cc;
}

.wpapps-acr-export-option i.fa-file-alt {
    color: #6c757d;
}

.wpapps-acr-export-option span {
    display: block;
    font-size: 14px;
    color: var(--wpapps-acr-dark-gray);
}

@media (max-width: 480px) {
    .wpapps-acr-export-options {
        grid-template-columns: 1fr;
    }
}

/* Chat with PDF Styles */

/* Chat Toggle Button in Header */
.wpapps-acr-chat-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--wpapps-acr-primary);
    color: white;
    border: 1px solid #4a90e2;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: auto;
}

.wpapps-acr-chat-toggle:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.wpapps-acr-chat-toggle.active {
    background: #135e96;
}

/* Animated Sparkle Icon */
.sparkle-icon {
    display: inline-block;
    animation: sparkle 2s ease-in-out infinite;
    filter: brightness(1.2);
}

@keyframes sparkle {
    0% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1.2);
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
        filter: brightness(1.4);
    }
    50% { 
        transform: scale(1.2) rotate(5deg);
        filter: brightness(1.6);
    }
    75% {
        transform: scale(1.15) rotate(-5deg);
        filter: brightness(1.4);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        filter: brightness(1.2);
    }
}

.wpapps-acr-chat-icon {
    font-size: 16px;
}

.doc-icon {
    font-size: 14px;
    margin-left: 2px;
}

/* Chat Panel - Modern Glass Morphism Design */
.wpapps-acr-chat-row {
    position: fixed;
    left: -45%;
    top: 50%;
    transform: translateY(-50%);
    width: 45%;
    height: 85vh;
    max-height: 700px;
    z-index: 1000;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpapps-acr-chat-row.active {
    left: 30px;
}

.wpapps-acr-chat-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset,
                0 0 80px rgba(102, 126, 234, 0.1);    
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

/* Chat Header - Gradient Glass Design */
.wpapps-acr-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.wpapps-acr-chat-header::before {
    content: '';
    position: absolute;
    top: -100%;
    right: -100%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    animation: headerShimmer 4s ease-in-out infinite;
}

.wpapps-acr-chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
}

@keyframes headerShimmer {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(180deg); }
}

.wpapps-acr-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    z-index: 1;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wpapps-acr-chat-title .wpapps-acr-chat-icon {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.wpapps-acr-chat-close {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 18px;
    cursor: pointer;
    color: #ffffff;
    padding: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.wpapps-acr-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Quick Actions - Modern Glass Pills */
.wpapps-acr-chat-quick-actions {
    display: flex;
    gap: 12px;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    overflow-x: auto;
    background: linear-gradient(to bottom, rgba(248, 249, 252, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.wpapps-acr-chat-quick-actions::-webkit-scrollbar {
    height: 4px;
}

.wpapps-acr-chat-quick-actions::-webkit-scrollbar-track {
    background: transparent;
}

.wpapps-acr-chat-quick-actions::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 2px;
}

.wpapps-acr-quick-action {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(102, 126, 234, 0.2);
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a5568;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.wpapps-acr-quick-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transition: left 0.5s ease;
}

.wpapps-acr-quick-action:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.wpapps-acr-quick-action:hover::before {
    left: 100%;
}

/* Chat Messages - Modern Conversation UI */
.wpapps-acr-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    background: linear-gradient(to bottom, rgba(248, 249, 252, 0.5) 0%, rgba(255, 255, 255, 0.3) 100%);
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
}

.wpapps-acr-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.wpapps-acr-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wpapps-acr-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.wpapps-acr-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.wpapps-acr-chat-welcome {
    text-align: center;
    color: #718096;
    padding: 60px 20px;
    font-size: 15px;
    line-height: 1.8;
}

.wpapps-acr-chat-welcome p {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    display: inline-block;
    padding: 24px 36px;
    border-radius: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.wpapps-acr-chat-message {
    margin-bottom: 28px;
    animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpapps-acr-chat-message.user {
    text-align: right;
}

.wpapps-acr-chat-message-content {
    display: inline-block;
    max-width: 75%;
    padding: 16px 24px;
    border-radius: 24px;
    line-height: 1.7;
    font-size: 15px;
    position: relative;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

/* Markdown styling in chat messages */
.wpapps-acr-chat-message-content strong {
    font-weight: 600;
    color: inherit;
}

.wpapps-acr-chat-message-content code {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.wpapps-acr-chat-message-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.wpapps-acr-chat-message-content pre code {
    background: none;
    padding: 0;
}

.wpapps-acr-chat-message.user .wpapps-acr-chat-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.wpapps-acr-chat-message.user .wpapps-acr-chat-message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 14px 14px;
    border-color: transparent transparent transparent #764ba2;
}

.wpapps-acr-chat-message.assistant .wpapps-acr-chat-message-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #2d3748;
    border-bottom-left-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.wpapps-acr-chat-message.assistant .wpapps-acr-chat-message-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 14px 14px 0;
    border-color: transparent rgba(255, 255, 255, 0.9) transparent transparent;
}

.wpapps-acr-chat-message-meta {
    font-size: 12px;
    color: var(--wpapps-acr-dark-gray);
    margin-top: 4px;
}

/* Chat Input */
.wpapps-acr-chat-input-container {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 24px 28px 28px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 252, 0.8) 100%);
    backdrop-filter: blur(10px);
}

.wpapps-acr-chat-form {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    background: #f8f9fc;
    padding: 8px;
    border-radius: 30px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.wpapps-acr-chat-input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    color: #2d3748;
}

.wpapps-acr-chat-input::placeholder {
    color: #a0aec0;
}

.wpapps-acr-chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.2);
}

.wpapps-acr-chat-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.wpapps-acr-chat-send:active {
    transform: translateY(0);
}

.wpapps-acr-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat Actions - Modern Style */
.wpapps-acr-chat-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.wpapps-acr-chat-clear,
.wpapps-acr-chat-export {
    background: transparent;
    border: none;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #718096;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.wpapps-acr-chat-clear::before,
.wpapps-acr-chat-export::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.wpapps-acr-chat-clear:hover::before,
.wpapps-acr-chat-export:hover::before {
    width: 100%;
    height: 100%;
}

.wpapps-acr-chat-clear:hover,
.wpapps-acr-chat-export:hover {
    color: #667eea;
}

/* Loading Animation - Modern Dots */
.wpapps-acr-chat-loading {
    display: inline-flex;
    gap: 6px;
    padding: 14px 20px;
    background: white;
    border-radius: 20px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.wpapps-acr-chat-loading-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: chatLoadingDot 1.4s ease-in-out infinite;
}

.wpapps-acr-chat-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.wpapps-acr-chat-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes chatLoadingDot {
    0%, 80%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Reference Links */
.wpapps-acr-chat-reference {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(34, 113, 177, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: var(--wpapps-acr-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* PDF Preview Controls */
.wpapps-acr-pdf-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: var(--wpapps-acr-light-gray);
    border-bottom: 1px solid var(--wpapps-acr-medium-gray);
}

.wpapps-acr-pdf-nav {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--wpapps-acr-medium-gray);
    border-radius: var(--wpapps-acr-border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpapps-acr-pdf-nav:hover {
    background: var(--wpapps-acr-primary);
    color: white;
    border-color: var(--wpapps-acr-primary);
}

.wpapps-acr-pdf-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#wpapps-acr-pdf-page-info {
    font-weight: 500;
    color: var(--wpapps-acr-dark-gray);
}

#wpapps-acr-pdf-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Text Preview */
#wpapps-acr-text-preview {
    max-width: 100%;
    overflow-x: auto;
}

#wpapps-acr-text-preview .document-preview-content {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--wpapps-acr-text);
}

.wpapps-acr-chat-reference:hover {
    background: rgba(34, 113, 177, 0.2);
}

/* Summary Styling */
.wpapps-acr-risk-overview,
.wpapps-acr-document-summary {
    margin-bottom: 20px;
}

.wpapps-acr-risk-overview h4,
.wpapps-acr-document-summary h4 {
    color: var(--wpapps-acr-primary);
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.wpapps-acr-risk-overview p,
.wpapps-acr-document-summary p {
    color: var(--wpapps-acr-text);
    line-height: 1.6;
    margin-bottom: 10px;
}

.wpapps-acr-risk-overview p:last-child,
.wpapps-acr-document-summary p:last-child {
    margin-bottom: 0;
}

.wpapps-acr-summary-content {    
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpapps-acr-loading-summary {
    text-align: center;
    padding: 40px;
    color: var(--wpapps-acr-dark-gray);
}

/* Document Preview Container - Unified styling */
.wpapps-acr-document-preview {    
    border-radius: var(--wpapps-acr-border-radius);    
}

/* Document sections in preview */
.document-section {
    margin-bottom: 20px;     
}

.document-section h4 {
    margin: 0 0 15px;
    color: var(--wpapps-acr-text);
    font-size: 18px;
    font-weight: 600;
}

.section-content {
    color: var(--wpapps-acr-dark-gray);
    line-height: 1.6;
}

.section-content p {
    margin: 0 0 15px;
}

.section-content p:last-child {
    margin-bottom: 0;
}

.section-content.modified {
    position: relative;
}

.section-content.rejected {
    text-decoration: line-through;
    opacity: 0.6;
    position: relative;
}

.wpapps-acr-document-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* PDF Canvas Styling */
#wpapps-acr-pdf-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#wpapps-acr-pdf-canvas {
    background: white;
}

/* DOCX Preview Styling */
.wpapps-acr-docx-preview {
    background: white !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 0 auto;
    max-width: 800px;
}

/* Excel Preview Styling */
.wpapps-acr-excel-preview {
    background: white !important;
}

.wpapps-acr-excel-preview table {
    margin: 0 !important;
}

/* Text Preview Styling */
.document-preview-content {
    height: 100%;
}

/* PDF Preview Styling */
#wpapps-acr-pdf-container {
    height: 100%;
    overflow-y: auto;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
}

.wpapps-acr-pdf-controls {
    flex-shrink: 0;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.wpapps-acr-pdf-nav {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.wpapps-acr-pdf-nav:hover:not(:disabled) {
    background: #135e96;
}

.wpapps-acr-pdf-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#wpapps-acr-pdf-page-info {
    font-size: 14px;
    color: #666;
}

#wpapps-acr-pdf-canvas {
    margin: 20px auto;
    display: block;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    background: white;
    max-width: 100%;
}

/* Clause Highlight Animation */
.clause-card.highlight {
    animation: highlightClause 2s ease;
}

@keyframes highlightClause {
    0% {
        background-color: rgba(34, 113, 177, 0.2);
        transform: scale(1.02);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .wpapps-acr-chat-panel.open {
        max-height: 70vh;
    }
    
    .wpapps-acr-chat-message-content {
        max-width: 85%;
    }
    
    .wpapps-acr-chat-quick-actions {
        padding: 10px;
    }
    
    .wpapps-acr-chat-label {
        display: none;
    }
    
    .wpapps-acr-chat-toggle {
        padding: 6px 10px;
    }
}

/* Risk Metric Filtering Styles */
.wpapps-acr-risk-metric {
    text-decoration: none;
    color: inherit;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.wpapps-acr-risk-metric:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
    text-decoration: none;
}

.wpapps-acr-risk-metric.active {
    background-color: rgba(0, 0, 0, 0.1);
    font-weight: bold;
    box-shadow: 0 0 0 2px currentColor;
}

/* Clear Filter Button */
.wpapps-acr-clear-filter {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
    transition: all 0.3s ease;
}

.wpapps-acr-clear-filter:hover {
    background: #e0e0e0;
    border-color: #bbb;
}

.wpapps-acr-clear-filter span {
    margin-left: 5px;
    font-weight: bold;
}

/* Clause Card Highlighting */
.clause-card.highlight-active {
    animation: highlightPulse 2s ease;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.5);
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(0, 123, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* Document Preview Highlighting */
.wpapps-acr-highlight {
    background-color: #ffeb3b !important;
    padding: 2px 4px;
    border-radius: 3px;
    animation: highlightFade 2s ease;
}

@keyframes highlightFade {
    0% {
        background-color: #ffeb3b;
    }
    100% {
        background-color: #fff9c4;
    }
}

/* Loading state for sections */
.wpapps-acr-loading-section {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.wpapps-acr-loading-section::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Session restore notification */
.wpapps-acr-session-restored {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpapps-acr-session-restored button {
    background: #155724;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.wpapps-acr-session-restored button:hover {
    background: #0c3d14;
}

/* Make risk metrics more prominent when clickable */
.wpapps-acr-risk-metrics .wpapps-acr-metric {
    position: relative;
}

.wpapps-acr-risk-metrics .wpapps-acr-metric-value {
    cursor: pointer;
}

/* Smooth scrolling for document preview */
#wpapps-acr-document-preview,
#wpapps-acr-text-preview {
    scroll-behavior: smooth;
}

/* Improved visibility for filtered items */
.clause-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.clause-card:not([style*="display: none"]) {
    opacity: 1;
    transform: translateX(0);
}

.clause-card[style*="display: none"] {
    opacity: 0;
    transform: translateX(-20px);
}

/* Synchronized Scrolling Styles */
.clause-card.clause-active {
    background-color: #f0f4ff;
    border-left: 4px solid #2271b1;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.15);
}

.document-section.section-active {
    position: relative;
}

.document-section.section-active::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2271b1;
    border-radius: 2px;
}

.document-section.section-highlight {
    animation: sectionHighlight 1.5s ease;
}

@keyframes sectionHighlight {
    0% {
        background-color: rgba(34, 113, 177, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

/* Mobile Responsive for Floating Chat */
@media (max-width: 768px) {
    .wpapps-acr-chat-row {
        width: 100%;
        left: -100%;
        top: 0;
        transform: none;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
    
    .wpapps-acr-chat-row.active {
        left: 0;
    }
    
    .wpapps-acr-chat-panel {
        border-radius: 0;
        height: 100%;
    }
}

/* Risk-based Text Highlighting - Native text selection style */
.risk-text-high {
    background-color: #ffcccc;
    color: inherit;
    position: relative;
    display: inline;
    padding: 0;
}

.risk-text-medium {
    background-color: #fff3cd;
    color: inherit;
    position: relative;
    display: inline;
    padding: 0;
}

.risk-text-low {
    background-color: #d4edda;
    color: inherit;
    position: relative;
    display: inline;
    padding: 0;
}

/* Synchronized Scrolling Styles */
.clause-card.clause-active {
    border-left: 4px solid var(--wpapps-acr-primary) !important;
    background-color: #f0f4ff;
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.2);
    transition: all 0.3s ease;
}

.document-section.section-active {
    background-color: rgba(240, 244, 255, 0.5);
    position: relative;
    padding-left: 20px;
    transition: all 0.3s ease;
}

.document-section.section-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--wpapps-acr-primary);
    opacity: 0.5;
    border-radius: 0 3px 3px 0;
}

.document-section.section-highlight {
    background-color: #fff3cd;
    transition: background-color 0.3s ease;
}

/* Enhanced risk text highlighting - text selection style */
.section-content .risk-text-high,
.section-content .risk-text-medium,
.section-content .risk-text-low {
    padding: 0;
    margin: 0;
}

/* Risk text highlighting inside paragraphs and lists */
.risk-text-high p,
.risk-text-high li,
.risk-text-medium p,
.risk-text-medium li,
.risk-text-low p,
.risk-text-low li {
    background-color: transparent;
    margin: 0;
    padding: 0;
}

/* Hover effect for risk text */
.risk-text-high:hover,
.risk-text-medium:hover,
.risk-text-low:hover {
    filter: brightness(0.95);
    cursor: help;
}

/* Tooltip for risk levels */
.risk-text-high::after,
.risk-text-medium::after,
.risk-text-low::after {
    content: attr(data-risk-label);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.risk-text-high:hover::after,
.risk-text-medium:hover::after,
.risk-text-low:hover::after {
    opacity: 1;
}

/* Ensure smooth scrolling */
#wpapps-acr-clauses-container,
#wpapps-acr-document-preview {
    scroll-behavior: auto; /* Disable for custom animation */
    position: relative;
}

/* Visual scroll indicators */
.wpapps-acr-scroll-indicator {
    position: absolute;
    right: 0;
    width: 4px;
    background: rgba(34, 113, 177, 0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
    z-index: 10;
}

/* Rejected content styling with risk highlighting */
.section-content.rejected {
    position: relative;
}

.section-content.rejected .risk-text-high,
.section-content.rejected .risk-text-medium,
.section-content.rejected .risk-text-low {
    filter: grayscale(50%);
    opacity: 0.8;
}