/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: #1a202c;
    line-height: 1.6;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-image {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    background: transparent;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.powered-by {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.emb-logo {
    height: 36px;
    width: auto;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Button Styles */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-primary {
    background: #DC143C;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #B71C1C;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

.btn-remove {
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
}

.btn-remove:hover {
    background: #c53030;
    transform: scale(1.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Upload Section */
.upload-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.upload-container h2 {
    text-align: center;
    color: #1e293b;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.upload-header i {
    color: #DC143C;
    font-size: 1.25rem;
}

.upload-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.upload-area:hover {
    border-color: #DC143C;
    background: #fef2f2;
}

.upload-area.dragover {
    border-color: #DC143C;
    background: #fee2e2;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 2rem;
    color: #a0aec0;
    margin-bottom: 1rem;
}

.upload-content p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.upload-content span {
    color: #718096;
    font-size: 0.9rem;
}

.file-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    gap: 1rem;
    position: relative;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-details i {
    color: #e53e3e;
    font-size: 1.25rem;
}

.file-name {
    font-weight: 500;
    color: #2d3748;
}

.file-size {
    color: #718096;
    font-size: 0.9rem;
}

.upload-actions {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

/* Analysis Section */
.analysis-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.analysis-header h2 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
}

.analysis-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    color: #4a5568;
}

.status-indicator i {
    color: #DC143C;
}

.analysis-content {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.analysis-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
}

.card-header i {
    color: #DC143C;
    font-size: 1.25rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.confidence-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f7fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.confidence-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2d3748;
}

.confidence-label {
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.confidence-badge.high {
    background: #f0fff4;
    border-color: #9ae6b4;
    color: #22543d;
}

.confidence-badge.medium {
    background: #fffbeb;
    border-color: #f6e05e;
    color: #744210;
}

.confidence-badge.low {
    background: #fed7d7;
    border-color: #feb2b2;
    color: #742a2a;
}

/* Comparison View */
.comparison-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pdf-preview {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.pdf-preview h4 {
    background: #f8fafc;
    padding: 0.75rem;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pdf-preview h4 .version-badge {
    background: #e2e8f0;
    color: #64748b;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.pdf-preview.original h4 .version-badge {
    background: #dbeafe;
    color: #1e40af;
}

.pdf-preview.revised h4 .version-badge {
    background: #dcfce7;
    color: #166534;
}

.pdf-placeholder {
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    color: #94a3b8;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pdf-placeholder i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pdf-canvas {
    width: auto;
    height: auto;
    max-width: none;
    background: #ffffff;
}

.pdf-canvas-container {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: auto;
    background: #ffffff;
}

.pdf-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    pointer-events: auto;
    cursor: pointer;
}

.pdf-controls button.comment-mode-active {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #B71C1C;
}

.comment-tooltip {
    position: fixed;
    z-index: 2000;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
    padding: 0.75rem;
    color: #1e293b;
    font-size: 0.9rem;
}

.comment-tooltip .tt-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.comment-tooltip .tt-title {
    font-weight: 650;
    font-size: 0.9rem;
    color: #0f172a;
}

.comment-tooltip .tt-meta {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
}

.comment-tooltip .tt-body {
    color: #334155;
    line-height: 1.45;
    white-space: pre-wrap;
}

.comment-tooltip .tt-footer {
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 0.8rem;
}

#commentTooltip {
    /* class is applied dynamically but keep a baseline */
}

.pdf-controls button.comment-mode-active:hover {
    background: #fecaca;
}

.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    gap: 1rem;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-info {
    font-size: 0.8rem;
    color: #64748b;
    min-width: 40px;
    text-align: center;
}

.pdf-controls button {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.pdf-controls button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

.pdf-controls .zoom-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.zoom-level {
    font-size: 0.8rem;
    color: #64748b;
    min-width: 40px;
    text-align: center;
}

/* Fullscreen PDF Comparison */
.fullscreen-comparison {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1e293b;
    z-index: 1000;
    display: none;
    flex-direction: column;
}

.fullscreen-comparison.active {
    display: flex;
}

.fullscreen-header {
    background: #334155;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #475569;
}

.fullscreen-logo {
    display: flex;
    align-items: center;
}

.fullscreen-logo-image {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
    background: transparent;
    filter: brightness(1.2);
}

.fullscreen-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.fullscreen-controls button {
    background: #475569;
    border: none;
    color: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.fullscreen-controls button:hover {
    background: #64748b;
}

.fullscreen-controls button.active,
.pdf-controls button.comment-mode-active,
#fullscreenRevisedCommentModeBtn.comment-mode-active,
#fullscreenRevisedCommentModeBtn.active,
#toggleSidePanelHeaderBtn.active {
    background-color: #DC143C !important;
    color: #ffffff !important;
    font-weight: 600;
}

.fullscreen-controls button.active {
    background: #DC143C;
    color: #ffffff;
}

.fullscreen-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 380px;
    gap: 1px;
    background: #475569;
    overflow: hidden;
    position: relative;
    transition: grid-template-columns 0.3s ease;
}

.fullscreen-pdf {
    background: #ffffff;
    overflow: auto;
    position: relative;
}

/* Fullscreen uses pixel-accurate canvas sizing so zoom/pan works (scroll to pan). */
.fullscreen-pdf canvas {
    width: auto;
    height: auto;
    display: block;
}

.fullscreen-pages {
    padding: 0.5rem 0;
}

.fullscreen-pages canvas.pdf-canvas {
    max-width: none;
}

/* Side Panel Styles */
.fullscreen-side-panel {
    width: 380px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.fullscreen-side-panel.collapsed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    width: 0;
}

.side-panel-header {
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-panel-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

#toggleSidePanelBtn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#toggleSidePanelBtn:hover {
    background: #e2e8f0;
    color: #475569;
}

.fullscreen-side-panel.collapsed #toggleSidePanelBtn i {
    transform: rotate(180deg);
}

.side-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem;
    max-height: calc(100vh - 200px);
}

.side-panel-section {
    margin-bottom: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.side-panel-section-header {
    padding: 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.side-panel-section-header i {
    color: #DC143C;
    font-size: 0.9rem;
}

.side-panel-section-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}

.side-panel-section-body {
    padding: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.loading-state {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.85rem;
    padding: 1rem;
    text-align: center;
    justify-content: center;
}

.side-panel-comment-item {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
}

.side-panel-comment-item:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.side-panel-comment-item.actioned {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.side-panel-comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.side-panel-comment-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.side-panel-comment-text {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.side-panel-comment-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.side-panel-footer {
    padding: 1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.side-panel-footer .btn-primary {
    width: 100%;
    justify-content: center;
}

.ai-analysis-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid;
    background: #f8fafc;
    border-radius: 4px;
}

.ai-analysis-item.success {
    border-left-color: #10b981;
}

.ai-analysis-item.warning {
    border-left-color: #f59e0b;
}

.ai-analysis-item.error {
    border-left-color: #ef4444;
}

.ai-analysis-item-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.ai-analysis-item-details {
    font-size: 0.8rem;
    color: #64748b;
}

/* Visual Diff Overlay */
.diff-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.diff-highlight {
    position: absolute;
    border: 2px solid;
    border-radius: 4px;
    pointer-events: none;
}

.diff-highlight.added {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.diff-highlight.removed {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.diff-highlight.modified {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.diff-highlight.comment {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

/* Change Indicators */
.change-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.change-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.change-indicator.added {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.change-indicator.removed {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.change-indicator.modified {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.change-indicator.comment {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Comments List */
.comments-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: #a0aec0;
}

.no-comments i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.comment-item {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: #f7fafc;
}

.comment-item.clickable {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.comment-item.clickable:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Status-based styling for comment items */
.comment-item.comment-status-actioned {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.comment-item.comment-status-actioned:hover {
    background: #dcfce7;
    border-color: #10b981;
}

.comment-item.comment-status-rebrief {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.comment-item.comment-status-rebrief:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.comment-item.comment-status-needs-review {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.comment-item.comment-status-needs-review:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

.comment-item.comment-status-pending {
    border-left: 4px solid #6366f1;
    background: #eef2ff;
}

.comment-item.comment-status-pending:hover {
    background: #e0e7ff;
    border-color: #6366f1;
}

.comment-item .comment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid;
    margin-left: 0.5rem;
}

.comment-item .resolution-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid;
    margin-left: 0.5rem;
}

.resolution-badge.actioned {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
    font-weight: 600;
}

.resolution-badge.rebrief {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.resolution-badge.needs-review {
    background: #fffbeb;
    border-color: #fed7aa;
    color: #92400e;
}

.comment-badge.original {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.comment-badge.revised {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #2d3748;
}

.comment-date {
    font-size: 0.8rem;
    color: #718096;
}

.comment-text {
    color: #4a5568;
    line-height: 1.5;
}

/* Content Analysis */
.content-analysis {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analysis-item {
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f7fafc;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.item-header i {
    font-size: 1.1rem;
}

.item-header span {
    font-weight: 600;
    color: #2d3748;
}

.item-details p {
    color: #4a5568;
    margin: 0;
}

.text-success {
    color: #38a169;
}

.text-warning {
    color: #d69e2e;
}

.text-error {
    color: #e53e3e;
}

/* Summary Card */
.summary-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.summary-card .card-header {
    color: #1e293b;
}

.summary-card .card-header i {
    color: #DC143C;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.summary-label {
    font-weight: 500;
    opacity: 0.9;
}

.summary-value {
    font-weight: 700;
    font-size: 1.25rem;
}

/* Analysis Actions */
.analysis-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 1.5rem;
}

#commentModal textarea:focus {
    outline: none;
    border-color: #DC143C;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.15);
}

.fullscreen-pages {
    padding: 0;
}

.fullscreen-pages .pdf-page {
    border-bottom: 1px solid #e2e8f0;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.75rem;
}

.help-section ol, .help-section ul {
    padding-left: 1.5rem;
}

.help-section li {
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.help-section strong {
    color: #2d3748;
    font-weight: 600;
}

/* AI Findings Styles */
.ai-findings-summary {
    display: flex;
    gap: 1.5rem;
    justify-content: space-around;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.finding-stat {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-findings-details {
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
        flex-wrap: wrap;
    }
    
    .header-branding {
        order: 3;
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0 0 0;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .comparison-view {
        grid-template-columns: 1fr;
    }
    
    .analysis-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .analysis-actions {
        flex-direction: column;
    }
    
    .summary-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .upload-container h2 {
        font-size: 2rem;
    }
    
    .upload-card {
        padding: 1rem;
    }
    
    .upload-area {
        padding: 1.5rem;
    }
    
    .analysis-card {
        padding: 1rem;
    }
}
