/* DataMint Frontend Styles - Based on Mockup */

/* Base Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f8f8f8;
    color: #333;
}

/* Hero Section */
.hero-section {
    background: white;
    padding: 60px 20px;
    border-bottom: 1px solid #ddd;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}

.hero-content h1 {
    font-size: 28px;
    font-weight: 300;
    margin: 0 0 30px 0;
    color: #222;
    text-align: center;
}

.hero-content p {
    margin: 0 0 20px 0;
}

.hero-content strong {
    font-weight: 600;
    color: #222;
}

.hero-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

/* Site Header */
.site-header {
    text-align: center;
    padding: 20px 20px 10px;
    background: #f8f8f8;
}

.site-title {
    display: inline-block;
    cursor: pointer;
    margin: 0;
    background: transparent;
    border: none;
    padding: 0;
    transition: all 0.2s ease;
}

.site-title-text {
    font-family: ui-monospace, 'SF Mono', Monaco, Consolas, monospace;
    color: #444;
    font-size: 52px;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

.site-title:hover .site-title-text {
    color: #666;
}

/* Navigation */
.nav-container {
    text-align: center;
    padding: 20px 20px 30px;
    background: #f8f8f8;
}

.nav-item {
    display: inline-block;
    margin: 0 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px 25px;
    text-align: center;
    cursor: pointer;
    min-width: 120px;
    vertical-align: top;
    transition: all 0.2s ease;
}

.nav-item:hover {
    border-color: #aaa;
    background: #f8f8f8;
}

.nav-item.active {
    border-color: #777;
    background: #f0f0f0;
}

.step-number {
    font-size: 48px;
    font-weight: bold;
    color: #444;
    margin: 0 0 8px 0;
    line-height: 1;
}

.step-label {
    font-size: 24px;
    color: #666;
    line-height: 1.3;
    font-weight: normal;
}

.nav-item.active .step-number {
    color: #222;
}

.nav-item.active .step-label {
    color: #444;
    font-weight: 500;
}

/* Page Layout */
.page {
    display: none;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    background: white;
    min-height: 70vh;
}

.page.active {
    display: block;
}

.page-title {
    text-align: center;
    font-size: 24px;
    font-weight: 400;
    margin: 0 0 40px 0;
    color: #333;
}

.content {
    width: 100%;
}

/* Landing Page */
.landing-content {
    text-align: center;
    padding: 60px 20px;
}

/* Selected Template Display */
.selected-template {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.template-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.change-template-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.change-template-btn:hover {
    background: #357abd;
}

/* Upload Section */
.upload-section {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px 20px;
    margin-bottom: 40px;
    text-align: center;
    background: #fafafa;
    transition: all 0.2s ease;
}

.upload-section.dragover {
    border-color: #4a90e2;
    background: #f0f8ff;
}

.drop-zone {
    margin-bottom: 20px;
}

.drop-zone-text {
    font-size: 18px;
    color: #666;
    margin-bottom: 8px;
}

.drop-zone-subtext {
    font-size: 14px;
    color: #999;
}

.upload-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.upload-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.upload-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

/* Paste Document Section */
.paste-document-section {
    margin-top: 30px;
}

.paste-document-area {
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.paste-document-textbox {
    width: 100%;
    min-height: 120px;
    border: none;
    padding: 15px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.paste-document-actions {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.document-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.document-name-input:focus {
    border-color: #4a90e2;
}

.add-document-btn {
    background: #5cb85c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.add-document-btn:hover {
    background: #449d44;
}

/* Documents List */
.uploaded-documents {
    margin-top: 40px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.uploaded-documents h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.documents-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.document-name {
    font-weight: 500;
    color: #333;
}

.document-size {
    font-size: 12px;
    color: #666;
}

.document-actions {
    display: flex;
    gap: 8px;
}

.document-remove {
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}

.document-remove:hover {
    background: #c9302c;
}

.process-documents-section {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.process-btn {
    background: #ff6b35;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.process-btn:hover:not(:disabled) {
    background: #e5542e;
    transform: translateY(-1px);
}

.process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Top Buttons for Step 2 */
.top-buttons {
    text-align: center;
    margin-bottom: 40px;
}

.top-button {
    display: inline-block;
    margin: 0 10px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px 20px;
    text-align: center;
    cursor: pointer;
    min-width: 130px;
    vertical-align: top;
    transition: all 0.2s ease;
}

.top-button:hover {
    border-color: #aaa;
    background: #f8f8f8;
}

.top-button.active {
    border-color: #777;
    background: #f0f0f0;
}

.top-button-title {
    font-size: 30px;
    font-weight: bold;
    color: #444;
    margin: 0 0 6px 0;
    line-height: 1;
}

.top-button-desc {
    font-size: 15px;
    color: #666;
    line-height: 1.3;
    margin: 0;
}

/* Templates Grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.template-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-card:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.template-card.selected {
    border-color: #4a90e2;
    background: #f0f8ff;
}

.template-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.template-card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 15px;
}

.template-card-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
}

.gallery-actions {
    text-align: center;
    margin-top: 30px;
}

.start-assistant-btn {
    background: #5cb85c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-assistant-btn:hover {
    background: #449d44;
    transform: translateY(-1px);
}

/* Template Assistant */
.template-assistant-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
}

.start-over-container {
    text-align: right;
    margin-bottom: 20px;
}

.start-over-container-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.start-over-global-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.start-over-global-btn:hover {
    background: #c82333;
}

.start-over-icon {
    font-size: 14px;
}

.assistant-progress-container {
    margin-bottom: 40px;
}

.assistant-progress-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.assistant-flow-arrow {
    font-size: 16px;
    color: #6c757d;
    font-weight: 500;
}

.assistant-flow-step {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    min-width: 90px;
    flex: 1;
    max-width: 110px;
    transition: all 0.2s ease;
}

.assistant-flow-step.active {
    border-color: #4a90e2;
    background: #f8fbff;
}

.assistant-flow-step.completed {
    border-color: #d1e7dd;
    background: white;
    border-width: 1px;
}

.assistant-flow-step.completed .assistant-flow-title {
    color: #999;
}

.assistant-flow-title {
    font-size: 16px;
    font-weight: normal;
    color: #333;
    line-height: 1.3;
}

.assistant-flow-subtitle {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
}

.assistant-step-content {
    display: none;
}

.assistant-step-content.active {
    display: block;
    opacity: 1;
    animation: fadeIn 0.15s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.assistant-form-section {
    margin-bottom: 30px;
}

.assistant-form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.assistant-form-help {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

.assistant-textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    box-sizing: border-box;
}

.assistant-textarea:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.assistant-ai-response {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
}

.assistant-empty {
    color: #999;
    font-style: italic;
    text-align: center;
}

.assistant-button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* When there are multiple buttons, spread them apart */
.assistant-button-group > * + * {
    margin-left: auto;
}

.back-btn, .assistant-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-btn:hover, .assistant-btn-secondary:hover {
    background: #5a6268;
}

.assistant-btn-primary {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.assistant-btn-primary:hover {
    background: #357abd;
}

.assistant-columns-display {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.assistant-decision-container {
    text-align: center;
    margin-top: 30px;
}

.assistant-preview-hint {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: left;
}

.assistant-preview-hint p {
    margin: 0;
    color: #0056b3;
    font-size: 14px;
    line-height: 1.4;
}

.assistant-decision-question {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.assistant-decision-buttons {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.assistant-decision-btn {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    max-width: 200px;
}

.assistant-decision-btn:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
}

.assistant-decision-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.assistant-decision-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.assistant-decision-desc {
    font-size: 12px;
    color: #666;
}

.template-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.save-template-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.template-name-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.template-name-input:focus {
    border-color: #4a90e2;
}

.save-template-btn {
    background: #5cb85c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.save-template-btn:hover {
    background: #449d44;
}

/* Jobs List */
.jobs-container {
    display: grid;
    gap: 20px;
}

.job-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

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

.job-info {
    flex: 1;
}

.job-document-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.job-template-name {
    font-size: 14px;
    color: #666;
}

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

.job-status.queued {
    background: #fff3cd;
    color: #856404;
}

.job-status.processing {
    background: #cff4fc;
    color: #055160;
}

.job-status.completed {
    background: #d1e7dd;
    color: #0f5132;
}

.job-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.job-results {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.job-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.job-results-table th,
.job-results-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.job-results-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

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

.loading-content {
    background: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: #333;
}

/* Utility Classes */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.content-section {
    margin-bottom: 40px;
}

/* Step 4 Template Actions */
.template-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.template-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.template-action-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.template-action-btn.start-over-btn {
    background: #dc3545;
}

.template-action-btn.start-over-btn:hover {
    background: #c82333;
}

.action-icon {
    font-size: 16px;
}

/* Template Preview Section */
.template-preview-section {
    margin-bottom: 25px;
}

.template-preview-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

/* Template Direct Edit */
.template-edit-section {
    margin-bottom: 25px;
}

.template-edit-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.template-edit-textarea {
    width: 100%;
    min-height: 300px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 15px;
}

.template-edit-textarea:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.template-edit-actions {
    display: flex;
    gap: 10px;
}

.save-edit-btn {
    padding: 10px 20px;
    background: #5cb85c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.save-edit-btn:hover {
    background: #449d44;
}

.cancel-edit-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.cancel-edit-btn:hover {
    background: #545b62;
}

/* Validation Results */
.validation-results {
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.validation-results h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.validation-content {
    font-size: 14px;
    line-height: 1.6;
}

.validation-success {
    background: #d1e7dd;
    border-color: #a3cfbb;
    color: #0f5132;
}

.validation-error {
    background: #f8d7da;
    border-color: #f1aeb5;
    color: #721c24;
}

.validation-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Template Assistant Edit Choice Section */
.assistant-edit-choice-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.assistant-edit-choices {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.assistant-edit-choice-btn {
    flex: 1;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.assistant-edit-choice-btn:hover {
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.assistant-choice-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.assistant-choice-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.assistant-choice-desc {
    font-size: 12px;
    color: #666;
}

/* Direct Edit and AI Refinement Sections */
.assistant-direct-edit-section,
.assistant-ai-refinement-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.assistant-direct-edit-section .assistant-form-label,
.assistant-ai-refinement-section .assistant-form-label {
    color: #4a90e2;
    font-weight: 600;
}

/* Responsive design for edit choices */
@media (max-width: 768px) {
    .assistant-edit-choices {
        flex-direction: column;
        gap: 15px;
    }
    
    .assistant-edit-choice-btn {
        margin: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-item {
        margin: 0 8px;
        padding: 12px 16px;
        min-width: 90px;
    }
    
    .step-label {
        font-size: 12px;
    }
    
    .site-title-text {
        font-size: 36px;
    }
    
    .hero-content {
        padding: 40px 15px;
    }
    
    .upload-options {
        flex-direction: column;
        align-items: center;
    }
    
    .assistant-decision-buttons {
        flex-direction: column;
        gap: 15px;
    }
    
    .assistant-decision-btn {
        max-width: none;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

/* Template Detail Page */
.template-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.back-to-gallery-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-to-gallery-btn:hover {
    background: #5a6268;
}

.template-detail-title {
    flex: 1;
    text-align: center;
    margin: 0 20px;
    font-size: 28px;
    font-weight: 600;
    color: #333;
}

.use-template-btn {
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.use-template-btn:hover {
    background: #357abd;
}

.template-detail-content {
    max-width: 100%;
}

.template-detail-content h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.template-content-display {
    width: 100%;
    padding: 20px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #000 !important;
    color: #fff !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    box-sizing: border-box;
    overflow: visible;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Disabled message styling */
.assistant-disabled-message {
    margin-top: 20px;
    border-left: 4px solid #6c757d;
}

.assistant-disabled-message .assistant-message {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.assistant-disabled-message h4 {
    color: #495057;
    margin-bottom: 10px;
}

.assistant-disabled-message p {
    color: #6c757d;
}

.assistant-disabled-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.assistant-disabled-message li {
    color: #6c757d;
    margin: 5px 0;
}

/* Error message styling */
.assistant-error-message {
    margin-top: 20px;
    border-left: 4px solid #dc3545;
}

.assistant-error-message .assistant-message {
    background: #fff5f5;
    border: 1px solid #f5c6cb;
}

.assistant-error-message h4 {
    color: #dc3545;
    margin-bottom: 10px;
}

.assistant-error-message p {
    color: #721c24;
}

.assistant-error-message ul {
    margin: 10px 0;
    padding-left: 20px;
}

.assistant-error-message li {
    color: #721c24;
    margin: 5px 0;
}

/* Refine help text styling */
.refine-help {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
    border-radius: 4px;
}

.refine-help p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Template Deployment Styling */
.template-deployment-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.deployment-success h4 {
    color: #28a745;
    margin-bottom: 10px;
}

.deployment-options {
    margin-top: 25px;
}

.deployment-options h4 {
    color: #333;
    margin-bottom: 8px;
}

.deployment-form {
    margin-top: 15px;
}

.deployment-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.deployment-checkbox {
    margin-top: 2px;
    transform: scale(1.1);
}

.deployment-label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    color: #333;
}

.deployment-help {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-top: 2px;
}

.deployment-description {
    margin: 15px 0;
    margin-left: 25px;
}

.deployment-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.deployment-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.deployment-btn-secondary, .deployment-btn-primary {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.deployment-btn-secondary {
    background: #6c757d;
    color: white;
}

.deployment-btn-secondary:hover {
    background: #545b62;
}

.deployment-btn-primary {
    background: #28a745;
    color: white;
}

.deployment-btn-primary:hover {
    background: #218838;
}

.deployment-complete {
    text-align: center;
}

.deployment-success-message h4 {
    color: #28a745;
    margin-bottom: 15px;
}

.deployment-summary {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
}

.summary-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.summary-label {
    font-weight: 500;
    color: #666;
}

.summary-value {
    color: #333;
}

.deployment-next-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.action-btn-secondary, .action-btn-primary {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
}

.action-btn-secondary {
    background: #6c757d;
    color: white;
}

.action-btn-secondary:hover {
    background: #545b62;
}

.action-btn-primary {
    background: #4a90e2;
    color: white;
}

.action-btn-primary:hover {
    background: #357abd;
}

/* Step 3 Document Table */
.documents-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.documents-table th,
.documents-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.documents-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.documents-table tbody tr:hover {
    background: #f5f5f5;
}

/* Mint Buttons */
.mint-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.mint-ready {
    background: #4a90e2;
    color: white;
}

.mint-ready:hover {
    background: #357abd;
}

.mint-processing {
    background: #6c757d;
    color: white;
    cursor: not-allowed;
}

.mint-completed {
    background: #5cb85c;
    color: white;
}

.mint-completed:hover {
    background: #449d44;
}

.mint-failed {
    background: #d9534f;
    color: white;
}

.mint-failed:hover {
    background: #c9302c;
}

/* Upload Section */
.upload-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #dee2e6;
}

.drop-zone {
    border: 2px dashed #4a90e2;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    margin: 20px 0;
    background: #f8f9fa;
    transition: all 0.3s;
}

.drop-zone.drag-over {
    border-color: #357abd;
    background: #e3f2fd;
}

.drop-zone-content p {
    margin: 5px 0;
    color: #666;
}

.upload-limits {
    font-size: 14px;
    color: #999;
}

.browse-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 15px;
}

.browse-btn:hover {
    background: #357abd;
}

.template-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #e3f2fd;
    border: 1px solid #4a90e2;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 20px;
    color: #1976d2;
}

.inspect-btn {
    background: #1976d2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
    transition: all 0.2s ease;
}

.inspect-btn:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

/* Upload Progress Overlay */
.progress-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: 1000;
}

.progress-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    min-width: 300px;
}

.progress-bar {
    background: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    background: #4a90e2;
    height: 100%;
    transition: width 0.3s;
    border-radius: 10px;
}

.progress-text {
    color: #666;
    font-size: 14px;
}

/* ===== INSPECTION PAGE STYLES (from table.html) ===== */

.inspection-header {
    padding: 20px;
    background: white;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0;
}

.back-btn {
    background: #e3f2fd;
    border: 1px solid #64b5f6;
    color: #1976d2;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
}

.back-btn:hover {
    background: #bbdefb;
}

.template-info {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

#inspection-template-name {
    font-weight: 600;
    color: #1976d2;
}

/* Main container layout */
.main-container {
    display: flex;
    height: calc(100vh - 200px);
    width: 100vw;
    gap: 0;
    overflow: hidden; /* Container should not scroll */
}

/* Left metadata panel */
.metadata-section {
    flex: 0 0 450px; /* Fixed width, no grow/shrink */
    width: 450px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ddd;
    overflow: hidden; /* Panel should not scroll horizontally */
}

.metadata-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.metadata-header h2 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.metadata-hint {
    color: #666;
    font-size: 14px;
}

.metadata-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.no-selection {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.metadata-actions {
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.flag-btn {
    background: #fff3e0;
    border: 1px solid #ffb74d;
    color: #f57c00;
}

.flag-btn:hover {
    background: #ffe0b2;
}

.note-btn {
    background: #e8f5e8;
    border: 1px solid #81c784;
    color: #2e7d32;
}

.note-btn:hover {
    background: #c8e6c9;
}

/* Right table section */
.table-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    min-width: 0;
    overflow: hidden;
}

.table-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    background: #f8f9fa;
}

.table-header h2 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.table-instructions {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.table-stats {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.table-container {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.inspection-table {
    width: 100%;
    min-width: 1800px;
    border-collapse: collapse;
    font-size: 12px;
    border: 1px solid #ddd;
}

.inspection-table th,
.inspection-table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
    white-space: nowrap;
}

.inspection-table th {
    background: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    color: #333;
}

/* Sticky first column */
.inspection-table .doc-name,
.inspection-table .doc-column {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.inspection-table .doc-column {
    background: #f5f5f5;
    z-index: 3;
}

/* Cell status styling */
.data-cell.processing {
    background: #fff3e0;
    color: #f57c00;
}

.data-cell.failed {
    background: #ffebee;
    color: #f44336;
}

.data-cell.completed {
    background: white;
    color: #333;
}

.data-cell.no-data {
    background: #f5f5f5;
    color: #999;
}

.data-cell:hover {
    background: #e3f2fd !important;
    border: 2px solid #2196f3 !important;
    cursor: pointer;
}

.data-cell.selected {
    background: #e3f2fd !important;
    border: 2px solid #1976d2 !important;
    box-shadow: 0 0 8px rgba(25, 118, 210, 0.3);
}

/* Status indicators */
.processing-indicator {
    font-style: italic;
    color: #f57c00;
}

.error-indicator {
    font-weight: 600;
    color: #f44336;
}

.no-data {
    font-style: italic;
    color: #999;
}

/* Document info styling */
.doc-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filename {
    font-weight: 600;
    color: #333;
}

.status {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.status-completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-processing {
    background: #fff3e0;
    color: #f57c00;
}

.status-failed {
    background: #ffebee;
    color: #f44336;
}

/* Notes section */
.notes-section {
    height: 80px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.notes-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.notes-left h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.no-notes {
    color: #999;
    font-size: 14px;
}

.notes-right {
    display: flex;
    gap: 10px;
}

.export-btn, .clear-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid;
}

.export-btn {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.export-btn:hover {
    background: #1565c0;
}

.clear-btn {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.clear-btn:hover {
    background: #eee;
}

/* Hide all DataMint site elements when inspection page is active */
#inspection-page.active ~ * {
    display: none !important;
}

/* Hide navigation and header on inspection page */
body:has(#inspection-page.active) .nav-container,
body:has(#inspection-page.active) .main-header,
body:has(#inspection-page.active) .landing-page,
#inspection-page.active ~ .nav-container {
    display: none !important;
}

/* Make inspection page take full viewport */
#inspection-page.active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f8f8f8;
    z-index: 1000;
    overflow: hidden;
}

/* Prevent body scrolling when inspection page is active */
body:has(#inspection-page.active) {
    overflow: hidden;
}

/* Ensure inspection page main container fills viewport */
#inspection-page.active .main-container {
    height: calc(100vh - 80px); /* Account for notes section */
    width: 100vw;
}

/* Make only the table container scrollable */
#inspection-page .table-container {
    flex: 1;
    overflow: auto; /* ONLY the table container scrolls */
    padding: 20px;
}

/* Prevent other elements from scrolling */
#inspection-page .table-section {
    overflow: hidden; /* Section container should not scroll */
}

/* Keyboard navigation help text */
.keyboard-help {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

/* Inspection page header styling */
.inspection-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.inspection-title-section h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1976d2;
}

.inspection-title-section #inspection-status {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.back-button {
    padding: 10px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.back-button:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Selected cell highlighting */
.data-cell.selected {
    background: #e3f2fd !important;
    border: 2px solid #1976d2 !important;
    box-shadow: 0 0 0 1px #1976d2;
}

/* Metadata card styling */
.metadata-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 16px;
    overflow: hidden;
}

.metadata-card-header {
    background: #f8f9fa;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.metadata-card-body {
    padding: 16px;
}

.final-answer {
    font-size: 16px;
    font-weight: 600;
    color: #1976d2;
    line-height: 1.4;
}

.evidence-summary {
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
}

.key-quotes {
    color: #666;
    font-size: 14px;
}

.quote {
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 3px solid #1976d2;
    font-style: italic;
}

.confidence-metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.confidence-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.confidence-label {
    font-weight: 600;
    min-width: 120px;
    font-size: 13px;
    color: #555;
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff5722 0%, #ff9800 30%, #4caf50 70%, #2196f3 100%);
    transition: width 0.3s ease;
}

.confidence-value {
    font-weight: 600;
    font-size: 13px;
    color: #1976d2;
    min-width: 45px;
    text-align: right;
}

/* Project Card Styles */
.project-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.project-card:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.project-info {
    flex: 1;
}

.project-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.project-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.project-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #888;
}

.share-status {
    font-weight: 500;
}

.project-actions {
    display: flex;
    align-items: center;
}

.share-btn {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-btn:hover {
    background: #357abd;
}

.shared-indicator {
    color: #5cb85c;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================
   Enhanced Button Loading States
   ========================== */

/* Loading button styles */
button.btn-loading {
    background: #6c757d !important;
    cursor: not-allowed !important;
    opacity: 0.8;
    transition: all 0.3s ease;
}

button.btn-loading:hover {
    background: #6c757d !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Button loading spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: btn-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Enhanced button hover effects (for non-loading buttons) */
button:not(.btn-loading) {
    transition: all 0.3s ease;
}

button:not(.btn-loading):hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Specific Template Assistant button enhancements */
.decision-button,
.assistant-decision-btn,
button[onclick*="assistantSelectDecision"] {
    position: relative;
    overflow: hidden;
}

/* Smooth loading state transitions */
button.btn-loading {
    transform: none;
    box-shadow: none;
}

button.btn-loading .btn-spinner {
    animation-duration: 1s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Loading overlay enhancements for context */
.loading-overlay .loading-text {
    font-size: 1.1em;
    color: #495057;
    font-weight: 500;
    margin-top: 15px;
    text-align: center;
}

.loading-overlay .loading-spinner {
    animation-duration: 1s;
    animation-timing-function: linear;
}