/* Global Styles */
:root {
    --primary-color: #2196f3;
    --secondary-color: #f5f5f5;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --text-color: #333;
    --border-color: #ddd;
    --modal-bg: rgba(0, 0, 0, 0.5);
    --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f9f9f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

button {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
}

.button {
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
}

.button--primary {
    background-color: var(--primary-color);
    color: white;
}

.button--primary:hover {
    background-color: #1976d2;
}

.button--primary:disabled {
    background-color: #90caf9;
    cursor: not-allowed;
}

.button--secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.button--secondary:hover {
    background-color: #e0e0e0;
}

.button--test {
    background-color: var(--success-color);
    color: white;
    margin-left: auto;
    margin-right: 10px;
}

.button--test:hover {
    background-color: #388e3c;
}

.button--edit {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

/* Legacy class names for backward compatibility */
.primary-button {
    background-color: var(--primary-color);
    color: white;
}

.primary-button:hover {
    background-color: #1976d2;
}

.primary-button:disabled {
    background-color: #90caf9;
    cursor: not-allowed;
}

.secondary-button {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.secondary-button:hover {
    background-color: #e0e0e0;
}

.test-button {
    background-color: var(--success-color);
    color: white;
    margin-left: auto;
    margin-right: 10px;
}

.test-button:hover {
    background-color: #388e3c;
}

.edit-button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

.placeholder {
    color: #888;
    font-style: italic;
}

.warning {
    background-color: #fff3e0;
    color: var(--warning-color);
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--warning-color);
}

.info {
    background-color: #e3f2fd;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary-color);
}

/* Header */
header {
    margin-bottom: 2rem;
}

/* Header toolbar styling */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-main {
    flex: 1;
}

.header-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.toolbar-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.toolbar-button .button-icon {
    font-size: 1rem;
}

/* Project modal styling */
.modal-content-save-project,
.modal-content-load-project {
    padding: 1rem;
}

.project-summary {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.project-summary h4 {
    margin-bottom: 0.75rem;
    color: #333;
}

.summary-list {
    list-style: none;
    padding: 0;
}

.summary-list li {
    padding: 0.25rem 0;
    color: #666;
}

.filename-section {
    margin-bottom: 1rem;
}

.filename-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.filename-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.load-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.warning-text {
    margin: 0;
    color: #856404;
}

.file-upload-section {
    margin-bottom: 1rem;
}

.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

.file-upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.upload-text {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.project-preview {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.project-preview h4 {
    margin-bottom: 0.75rem;
    color: #333;
}

.preview-content p {
    margin: 0.25rem 0;
    color: #666;
}

.preview-content .error {
    color: var(--danger-color);
}

/* Test Mode Indicator */
.test-mode-active {
    color: var(--success-color);
    font-weight: bold;
}

.test-mode-inactive {
    color: var(--text-color);
    font-weight: normal;
}

/* Visual indicator for test mode enabled steps */
.test-mode-enabled .step-number {
    border: 2px dashed var(--success-color);
}

/* Test mode only elements */
.test-mode-only {
    display: none !important;
}

/* When test mode is active, we'll override the display property */
body.test-mode-active .test-mode-only {
    display: inline-block !important;
}

/* Step Navigation */
.steps-navigation {
    margin-bottom: 2rem;
}

.steps-navigation ul {
    display: flex;
    list-style: none;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    cursor: pointer;
}

.step__number {
    width: 40px;
    height: 40px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step--active .step__number {
    background-color: var(--primary-color);
    color: white;
}

.step__label {
    font-size: 0.9rem;
    font-weight: 500;
}

.step--active .step__label {
    color: var(--primary-color);
}

/* Legacy class names for backward compatibility */
.step-number {
    width: 40px;
    height: 40px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary-color);
}


/* Main Content */
main {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.step-content {
    display: none;
    padding: 2rem;
}

.step-content.active {
    display: block;
}

.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

/* Step 1: Input */
/* No additional constraints on width */

/* Input form with button in a row */
#step1 .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

#step1 .form-group label {
    width: 100%;
}

#step1 .form-group input {
    flex: 1;
    min-width: 200px;
}

#step1 #fetch-data {
    width: auto;
}

.advanced-params {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.advanced-params summary {
    cursor: pointer;
    font-weight: 500;
}

.json-viewer {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.json-viewer__header {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-viewer__tree-view, .json-viewer__raw {
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
}

/* Legacy class names for backward compatibility */
.json-viewer-container {
    margin-top: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.json-viewer-header {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-tree-view, .raw-json {
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    overflow: auto;
}

.loading {
    margin: 1rem 0;
}

.selection-controls {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

/* Step 2: Mapping */
.entity-schema-selector {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.entity-schema-selector input {
    flex: 1;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
}

.key-sections {
    margin-top: 1.5rem;
}

.section {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.section summary {
    padding: 0.75rem 1rem;
    background-color: var(--secondary-color);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    flex: 1;
}

.section-count {
    color: #666;
    font-size: 0.9em;
    font-weight: 400;
}

.key-list {
    list-style: none;
    padding: 1rem;
}

.key-list li {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.key-list li:last-child {
    border-bottom: none;
}

/* Step 3: Reconciliation */
.reconciliation-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.reconciliation-table {
    width: 100%;
    border-collapse: collapse;
}

.reconciliation-table th, .reconciliation-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.reconciliation-table th {
    background-color: var(--secondary-color);
    font-weight: 500;
}

.reconciliation-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Step 4: Wikidata Designer */
.reference-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.reference-list {
    margin-bottom: 1rem;
}

.example-selector {
    margin-bottom: 1.5rem;
}

.designer-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.property-editor, .wikidata-preview {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
}

.validation-messages {
    margin-bottom: 1.5rem;
}

/* Step 5: Export */
.export-info {
    margin-bottom: 1.5rem;
}

.quick-statements-output {
    margin-bottom: 1.5rem;
}

.quick-statements-output textarea {
    width: 100%;
    margin-bottom: 0.5rem;
    font-family: monospace;
}

.json-export {
    margin-bottom: 1.5rem;
}

.export-buttons {
    display: flex;
    gap: 1rem;
}

.info-link {
    color: var(--primary-color);
    text-decoration: none;
}

.info-link:hover {
    text-decoration: underline;
}

/* Modal */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Important: This ensures the modal container is hidden properly */
.modal-container.hidden {
    display: none !important;
}

.modal {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content {
    padding: 1rem;
}

.modal-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Model preview styles for test mode */
.mapping-model-preview, .reconciliation-model-preview {
    max-height: 60vh;
    overflow-y: auto;
}

.model-explanation, .current-mapping-state, .current-reconciliation-state {
    margin-bottom: 20px;
}

.model-schema, .current-state-json {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 12px;
    overflow-x: auto;
}


/* Mapping Modal Styles */
.mapping-modal-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.key-info {
    background-color: var(--secondary-color);
    padding: 1rem;
    border-radius: 4px;
}

.key-info h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.key-info p {
    margin-bottom: 0.25rem;
}

.property-search {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.property-search h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.property-search-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
}


.property-suggestions {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
}

.suggestion-section h5 {
    background-color: var(--secondary-color);
    padding: 0.5rem 1rem;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.property-suggestion-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s;
}

.property-suggestion-item:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.property-suggestion-item.selected {
    background-color: var(--primary-color);
    color: white;
}

.property-suggestion-item.previous {
    background-color: rgba(76, 175, 80, 0.1);
}

.property-suggestion-item.previous.selected {
    background-color: var(--success-color);
    color: white;
}

.property-main {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.25rem;
}

.property-id {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
}

.property-suggestion-item.selected .property-id {
    background-color: rgba(255, 255, 255, 0.2);
}

.property-label {
    font-weight: 500;
}

.property-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* Sample JSON display in modal */
.sample-json-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f8f9fa;
    margin-top: 0.5rem;
}

.sample-json {
    margin: 0;
    padding: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: none;
    color: #333;
}

/* Scrollbar styling for sample JSON */
.sample-json-container::-webkit-scrollbar {
    width: 8px;
}

.sample-json-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.sample-json-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.sample-json-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Clickable key styling */
.clickable-key {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px dotted var(--primary-color);
    transition: all 0.2s ease;
}

.clickable-key:hover {
    color: var(--primary-dark);
    border-bottom-style: solid;
    background-color: rgba(33, 150, 243, 0.1);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

/* Clickable JSON keys styling */
.clickable-json-key {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    border-bottom: 1px dotted var(--primary-color);
    transition: color 0.2s ease;
}

.clickable-json-key:hover {
    color: var(--primary-dark);
    border-bottom-style: solid;
}

/* Sample value fallback styling */
.sample-value-fallback {
    padding: 0.75rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    font-style: italic;
}

.property-suggestion-item.selected .property-description {
    color: rgba(255, 255, 255, 0.9);
}

.selected-property {
    background-color: rgba(33, 150, 243, 0.1);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--primary-color);
}

.selected-property h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.selected-property-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.loading, .error, .no-results {
    padding: 1rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

.error {
    color: var(--danger-color);
}

/* Key item display styles - compact version */
.key-item-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-item-clickable-compact:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.key-name-compact {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.9rem;
}

.key-frequency {
    font-size: 0.75rem;
    color: #666;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    margin-left: auto;
}

.key-item-display-compact .key-name-compact {
    color: var(--success-color);
}

.property-info {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    margin-left: 0.5rem;
}

.key-list li {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.key-list li.clickable:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

/* Styles for keys not in current dataset */
.key-item-compact.not-in-current-dataset,
.key-list li.not-in-current-dataset {
    opacity: 0.5;
    filter: grayscale(50%);
}

.key-list li.not-in-current-dataset.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

.key-list li.not-in-current-dataset:hover {
    background-color: transparent;
}

.not-in-dataset-indicator {
    font-size: 0.75rem;
    color: #999;
    background-color: rgba(255, 152, 0, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    margin-left: auto;
    font-style: italic;
}

/* Animation for newly moved keys */
.key-list li.newly-moved {
    background: linear-gradient(90deg, 
        rgba(76, 175, 80, 0.3) 0%, 
        rgba(76, 175, 80, 0.1) 50%, 
        transparent 100%);
    animation: fadeToNormal 2s ease-out forwards;
}

@keyframes fadeToNormal {
    0% {
        background: linear-gradient(90deg, 
            rgba(76, 175, 80, 0.4) 0%, 
            rgba(76, 175, 80, 0.2) 50%, 
            rgba(76, 175, 80, 0.1) 100%);
        transform: translateX(-3px);
    }
    50% {
        background: linear-gradient(90deg, 
            rgba(76, 175, 80, 0.2) 0%, 
            rgba(76, 175, 80, 0.1) 50%, 
            transparent 100%);
        transform: translateX(0);
    }
    100% {
        background: transparent;
        transform: translateX(0);
    }
}

/* Legacy styles for backwards compatibility */
.key-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.key-item-clickable:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.key-name {
    font-weight: 500;
    color: var(--text-color);
}

.key-type {
    font-size: 0.8rem;
    color: #666;
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    margin-left: 0.5rem;
}

.key-sample {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}

/* Mapping Actions Styling */
.mapping-actions {
    margin: 1rem 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.mapping-file-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.mapping-file-actions .button {
    min-width: 120px;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
}

.key-item-display .key-name {
    color: var(--success-color);
}

/* Responsive */
@media (max-width: 768px) {
    .designer-layout {
        grid-template-columns: 1fr;
    }
    
    .steps-navigation ul {
        flex-wrap: wrap;
    }
    
    .step {
        flex-basis: 33.333%;
        margin-bottom: 1rem;
    }
    
    .mapping-modal-content {
        gap: 1rem;
    }
    
    .property-suggestions {
        max-height: 200px;
    }
}

/* =============================================================================
   Reconciliation Interface - Simplified Modal Design (Q&A Requirements)
   ============================================================================= */

/* Compact Reconciliation Modal */
.reconciliation-modal-compact {
    max-width: 600px;
    width: 100%;
    font-family: inherit;
}

/* Property Section - Compact Design */
.property-section {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    margin-bottom: 1rem;
}

.property-header {
    margin-bottom: 0.5rem;
}

.property-header .property-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.property-header .property-link:hover {
    text-decoration: underline;
    color: #1976d2;
}

.property-description {
    margin: 0 0 0.75rem 0;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
}

.mock-indicator {
    font-size: 0.7rem;
    color: #ff9800;
    font-weight: normal;
    background: rgba(255, 152, 0, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    margin-left: 0.25rem;
}

.original-info {
    background: #fff3cd;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid #ffeaa7;
}

.original-label {
    font-size: 0.8rem;
    color: #666;
    margin-right: 0.5rem;
}

.original-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-family: monospace;
    background: rgba(33, 150, 243, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.85rem;
}

.original-link:hover {
    text-decoration: underline;
    background: rgba(33, 150, 243, 0.2);
}

.value-context {
    font-size: 0.9rem;
    color: #555;
}

/* 3. Reconciliation Results */
.reconciliation-results {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    color: #666;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.matches-display {
    background: white;
}

.matches-header {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.matches-header h5 {
    margin: 0 0 0.5rem 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.confidence-note {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.matches-list {
    padding: 1rem;
}

.match-item-simplified {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.match-item-simplified:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    transform: translateY(-1px);
}

.match-item-simplified:last-child {
    margin-bottom: 0;
}

.match-score {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 60px;
    text-align: center;
    margin-right: 1rem;
}

.match-content {
    flex: 1;
    margin-right: 1rem;
}

.match-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.match-description {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.match-id a {
    color: var(--primary-color);
    text-decoration: none;
    font-family: monospace;
    font-size: 0.8rem;
}

.match-id a:hover {
    text-decoration: underline;
}

.match-select .btn {
    min-width: 80px;
}

.view-all-matches {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.no-matches {
    padding: 0.5rem;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Compact Reconciliation Modal Only - Removed unused sections */

/* =============================================================================
   Legacy Reconciliation Interface (Maintained for compatibility)
   ============================================================================= */


/* Reconciliation Table */
.reconciliation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.reconciliation-table th,
.reconciliation-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.reconciliation-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.item-header {
    width: 150px;
    min-width: 150px;
}

.property-header {
    min-width: 200px;
}

.reconciliation-row:hover {
    background-color: #f8f9fa;
}

.item-cell {
    font-weight: 500;
    color: #555;
    max-width: 150px;
    word-wrap: break-word;
}

.property-cell {
    position: relative;
    vertical-align: top;
}

.empty-cell {
    color: #999;
    font-style: italic;
}

.multi-value-cell {
    padding: 0.5rem 0.75rem;
}

.multi-value-cell .property-value {
    margin-bottom: 0.5rem;
}

.multi-value-cell .property-value:last-child {
    margin-bottom: 0;
}

/* Property Values */
.property-value {
    display: block;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    min-height: 60px;
}

.property-value:hover {
    background-color: #f0f8ff;
    border-color: var(--primary-color);
}


.property-value[data-status="pending"] {
    background-color: #fff;
    border-color: #ddd;
}

.property-value[data-status="reconciled"] {
    background-color: #e8f5e9;
    border-color: #4caf50;
    cursor: default;
}

.property-value[data-status="skipped"] {
    background-color: #fff3e0;
    border-color: #ff9800;
    cursor: default;
}

.value-text {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #333;
    word-wrap: break-word;
}

.value-status {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.value-status.reconciled {
    color: #2e7d32;
    font-weight: 500;
}

.value-status.skipped {
    color: #f57c00;
    font-weight: 500;
}

.value-status.auto-accepted {
    color: #1565c0;
    font-weight: 500;
    opacity: 0.8;
}

.value-status.with-match {
    color: #1976d2;
    font-weight: 500;
    font-size: 0.75rem;
}

/* Confidence level indicators */
.property-value.high-confidence-match {
    border-left: 3px solid #4caf50;
}

.property-value.medium-confidence-match {
    border-left: 3px solid #ff9800;
}

.property-value.low-confidence-match {
    border-left: 3px solid #f44336;
}

.property-value.high-confidence-match .value-status.with-match {
    color: #2e7d32;
}

.property-value.medium-confidence-match .value-status.with-match {
    color: #f57c00;
}

.property-value.low-confidence-match .value-status.with-match {
    color: #d32f2f;
}


.value-status a {
    color: inherit;
    text-decoration: none;
}

.value-status a:hover {
    text-decoration: underline;
}

/* Reconciliation Modal */
.reconciliation-modal {
    max-width: 800px;
    width: 100%;
}

.reconciliation-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.reconciliation-header h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.original-value {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.item-context {
    font-size: 0.9rem;
    color: #666;
}

.reconciliation-options {
    margin-bottom: 2rem;
}

.option-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

/* Tab-based styles removed - now using progressive disclosure design */

/* Loading and Match Display */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #666;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 0.5rem;
}

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

.matches-list {
    max-height: 400px;
    overflow-y: auto;
}

.match-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.match-item:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.match-item.recommended {
    border-color: var(--success-color);
    background-color: #f1f8e9;
}

.match-item.selected {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.match-score {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 1rem;
    min-width: 50px;
    text-align: center;
}

.match-info {
    flex: 1;
}

.match-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.match-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.match-id {
    font-size: 0.8rem;
    color: #999;
}

.match-id a {
    color: var(--primary-color);
    text-decoration: none;
}

.match-id a:hover {
    text-decoration: underline;
}

.match-source {
    color: #999;
    font-style: italic;
}

.match-actions {
    margin-left: 1rem;
}

.no-matches {
    text-align: center;
    padding: 0.5rem;
    color: #666;
}

/* Manual Search */
.manual-search {
    padding: 1rem 0;
}

.search-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
}

.search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
}

.search-btn:hover {
    background-color: #1976d2;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
}

.search-result-item.selected {
    background-color: #e3f2fd;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.result-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.result-id {
    font-size: 0.8rem;
    color: #999;
}

.result-id a {
    color: var(--primary-color);
    text-decoration: none;
}

.result-id a:hover {
    text-decoration: underline;
}

.result-actions {
    margin-left: 1rem;
}

/* Custom Value */
.custom-value {
    padding: 1rem 0;
}

.custom-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    margin: 1rem 0;
}

.note {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Reconciliation Actions */
.reconciliation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
}

.reconciliation-actions .btn.secondary {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid var(--border-color);
}

.reconciliation-actions .btn.secondary:hover {
    background-color: #e0e0e0;
}

.reconciliation-actions .btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.reconciliation-actions .btn.primary:hover {
    background-color: #1976d2;
}

.reconciliation-actions .btn.primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Reconciliation Error States */
.reconciliation-error {
    background-color: #ffebee !important;
    border: 1px solid var(--danger-color) !important;
    position: relative;
}

.reconciliation-error::after {
    content: '⚠️';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    color: var(--danger-color);
}

.reconciliation-service-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}


/* Progressive Disclosure Reconciliation Modal V2 */
.reconciliation-modal-v2 {
    max-width: 700px;
    width: 100%;
}

.reconciliation-modal-v2 .reconciliation-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.reconciliation-modal-v2 .expected-type {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.primary-recommendations {
    margin-bottom: 1.5rem;
}

.loading-state {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
}

.high-confidence-matches {
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid var(--success-color);
    padding: 1rem;
    margin-bottom: 1rem;
}

.matches-title {
    color: var(--success-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.matches-scroll-container {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-behavior: smooth;
}

.confidence-match-card {
    min-width: 280px;
    max-width: 300px;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.confidence-match-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.confidence-match-card.best-match {
    border-color: var(--success-color);
    border-width: 2px;
}

.match-confidence {
    color: var(--success-color);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.confidence-match-card .match-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.confidence-match-card .match-description {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.confidence-match-card .match-id {
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.select-match-btn {
    width: 100%;
    text-align: center;
}

.scroll-hint {
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.5rem;
    font-style: italic;
}

.fallback-options {
    padding: 1.5rem;
    background: #fff3cd;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-bottom: 1rem;
}

.search-wikidata {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-wikidata input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.create-new-item {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    margin-top: 0.5rem;
}

.create-new-item:hover {
    background: #1976d2;
}

.custom-input-primary {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.non-wikidata-input h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.input-actions {
    margin-top: 1rem;
    text-align: right;
}

.progressive-disclosure {
    margin-bottom: 1rem;
}

.expand-options {
    width: 100%;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: all 0.2s ease;
}

.expand-options:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.expanded-options {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: white;
    padding: 1rem;
}

.option-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.option-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.option-section h5 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.manual-search-expanded {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.search-input-expanded {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.search-btn-expanded {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.search-results-expanded {
    margin-top: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.custom-value-expanded {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.fallback-search-results {
    margin-top: 1rem;
}

.fallback-search-results h6 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.fallback-result-item,
.expanded-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    background: white;
}

.fallback-result-item .result-info,
.expanded-result-item .result-info {
    flex: 1;
    margin-right: 1rem;
}

.fallback-result-item .result-name,
.expanded-result-item .result-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.fallback-result-item .result-description,
.expanded-result-item .result-description {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.25rem;
}

.fallback-result-item .result-id,
.expanded-result-item .result-id {
    font-size: 0.8rem;
    color: #999;
}

.auto-advance-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-advance-toggle label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.auto-advance-toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Reconciliation Status Styling */
.property-value {
    transition: all 0.3s ease;
    min-height: 2.5em; /* Accommodate stacked layout */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    position: relative;
}

.property-value.checking {
    /* No background change to prevent layout shifts */
}

/* Queue indicators */
.property-value.queued {
    border-left: 2px dotted #2196f3;
    background-color: #f8fcff;
}

.property-value.processing {
    border-left: 2px solid #2196f3;
    background-color: #e3f2fd;
}

/* Queue status indicators */
.value-status.queued {
    color: #1976d2;
    font-style: italic;
}

/* Status color overrides for different states */
.value-status.reconciled {
    color: #4caf50;
    font-weight: 500;
}

.value-status.with-match {
    color: #ff9800;
    font-weight: 500;
}

.value-status.skipped {
    color: #ff9800;
    font-style: italic;
}

.value-status.no-item {
    color: #666;
    font-weight: 500;
}


.value-text {
    font-weight: 500;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.value-status {
    font-size: 0.8rem;
    line-height: 1.1;
    color: #666;
}

/* Loading indicator - top-right corner */
.property-value.checking::after {
    content: '';
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    width: 8px;
    height: 8px;
    border: 1px solid #2196f3;
    border-top: 1px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.value-status.loading {
    /* Remove text-based loading styles */
}

/* Property Edit Modal */
.property-edit-modal {
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
}

.property-values-container {
    margin-bottom: 2rem;
}

.property-value-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background-color: #fafafa;
}

.property-value-item .item-label {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.property-value-item .original-value {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
}

.property-value-item .current-value {
    margin-bottom: 0.5rem;
}

.property-value-item .current-value.reconciled {
    color: var(--success-color);
}

.property-value-item .current-value.not-reconciled {
    color: var(--warning-color);
}

.edit-value-btn {
    padding: 4px 12px;
    font-size: 0.9em;
}

.universal-update-section {
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.universal-update-section h4 {
    margin-bottom: 0.5rem;
}

.universal-update-section p {
    color: #666;
    margin-bottom: 1rem;
}

/* Session Restore Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.restore-session-modal {
    max-width: 500px;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.session-summary {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.session-summary h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

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

/* High confidence matches - green */
.property-value.high-confidence-match {
    background-color: #e8f5e8;
    border-left: 3px solid #4caf50;
}

/* Partial matches - yellow */
.property-value.partial-match {
    background-color: #fff8e1;
    border-left: 3px solid #ff9800;
}

/* Low confidence matches - light orange */
.property-value.low-confidence-match {
    background-color: #ffeaa7;
    border-left: 3px solid #fdcb6e;
}

/* Reconciled items - green */
.property-value.reconciled {
    background-color: #e8f5e8;
    border-left: 3px solid #4caf50;
}

/* No item status - grayed out */
.property-value.no-item {
    background-color: #f5f5f5;
    border-left: 3px solid #9e9e9e;
    color: #666;
    opacity: 0.8;
}

.value-status.no-item {
    color: #666;
    font-weight: 500;
}

/* No matches found */
.value-status.no-matches {
    color: #666;
}

/* No Wikidata Item button */
.btn.no-item {
    background-color: #9e9e9e;
    color: white;
    border: 1px solid #757575;
}

.btn.no-item:hover {
    background-color: #757575;
}

/* Button Variants */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

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

.btn.secondary {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid var(--border-color);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.error {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
}

/* Toast Message Notifications */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary-color);
    max-width: 400px;
    font-size: 0.9rem;
    line-height: 1.4;
    z-index: 10000;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    word-wrap: break-word;
}

.message-toast.visible {
    transform: translateX(0);
    opacity: 1;
}

.message-toast--success {
    border-left-color: var(--success-color);
    background-color: #f8fff9;
    color: #2d5a2f;
}

.message-toast--error {
    border-left-color: var(--danger-color);
    background-color: #fff8f8;
    color: #5a2d2d;
}

.message-toast--warning {
    border-left-color: var(--warning-color);
    background-color: #fffcf8;
    color: #5a4d2d;
}

.message-toast--info {
    border-left-color: var(--primary-color);
    background-color: #f8fcff;
    color: #2d4a5a;
}

.message-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.message-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #666;
}

/* Dynamic Date Precision Styles */
.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-input-group .flexible-date-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}


.date-input-group .flexible-date-input.precision-year {
    border-left: 4px solid #ff9800;
}

.date-input-group .flexible-date-input.precision-month {
    border-left: 4px solid #2196f3;
}

.date-input-group .flexible-date-input.precision-day {
    border-left: 4px solid #4caf50;
}

.date-input-group .flexible-date-input.precision-decade {
    border-left: 4px solid #9c27b0;
}

.date-picker-fallback {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.date-picker-btn {
    align-self: flex-start;
    padding: 0.5rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.date-picker-btn:hover {
    background: #e0e0e0;
}

.date-format-hint {
    font-size: 0.8em;
    color: #666;
    margin-top: 4px;
    padding: 0.25rem;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #ddd;
    transition: all 0.2s;
}

.precision-select, .calendar-select {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
}

.date-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-input-row .flexible-date-input {
    flex: 1;
    margin: 0;
}

.date-input-row .date-picker-btn {
    flex-shrink: 0;
    margin: 0;
    align-self: stretch;
}

/* Step 4: Wikidata Designer Styles */
.designer-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Item Selector */
.item-selector-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.item-selector-container label {
    font-weight: 600;
    margin-right: 1rem;
    color: #333;
}

.item-selector {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-size: 1rem;
    min-width: 300px;
    cursor: pointer;
}

/* References Section */
.references-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.references-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.references-list {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    min-height: 80px;
}

.reference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.reference-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.reference-item.auto-detected {
    border-left: 3px solid var(--success-color);
}

.reference-info {
    flex: 1;
}

.reference-url {
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
}

.reference-url:hover {
    text-decoration: underline;
}

.reference-type {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Item-specific reference section styling */
.item-specific-section {
    border-left: 3px solid var(--primary-color);
    background-color: #f8f9fa;
}

.item-specific-aggregate {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.reference-samples-toggle {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 0.5rem 0;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.reference-samples-toggle::before {
    content: "▶";
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.3s;
}

.reference-samples-toggle.expanded::before {
    transform: rotate(90deg);
}

.reference-samples-toggle:hover {
    color: var(--primary-color);
    opacity: 0.8;
}

.reference-samples {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.reference-sample-container {
    padding: 0.5rem 0.75rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.reference-sample-container:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.reference-sample-url {
    display: block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.reference-sample-url:hover {
    text-decoration: underline;
    white-space: normal;
    word-break: break-all;
}

.reference-sample-source {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
}

.reference-more {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    padding: 0.25rem 0;
}

.reference-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.reference-status .status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-icon.status-applied {
    color: var(--success-color);
    font-weight: bold;
}

.status-text {
    font-size: 0.85rem;
    color: #666;
}

/* Item-specific references modal styling */
.item-specific-references-modal {
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.categorized-references {
    margin: 1rem 0;
}

.reference-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.category-title {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.reference-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reference-item-detail {
    padding: 0.5rem;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.reference-item-detail:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.reference-url-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    display: block;
    margin-bottom: 0.25rem;
}

.reference-url-link:hover {
    text-decoration: underline;
}

.reference-meta {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.reference-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-toggle label {
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
}

.references-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reference-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin-top: 1rem;
}

.warning-icon {
    font-size: 1.1rem;
}

.warning-text {
    color: #856404;
    font-size: 0.9rem;
}

/* Item Designer Section */
.item-designer-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.item-designer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Wikidata-like item header */
.wikidata-item-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
}

.item-label-group,
.item-description-group {
    margin-bottom: 1rem;
}

.item-label-group:last-child,
.item-description-group:last-child {
    margin-bottom: 0;
}

.item-label-group label,
.item-description-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.item-label-input,
.item-description-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.item-label-input:focus,
.item-description-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Statements section */
.statements-section h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

/* Add statement container */
.add-statement-container {
    margin-top: 1rem;
    text-align: right;
}

/* Wikidata-style statements container */
.properties-list {
    background-color: white;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    padding: 0;
}

/* Individual Wikidata statement */
.wikidata-statement {
    display: flex;
    border-bottom: 1px solid #eaecf0;
    min-height: 3rem;
}

.wikidata-statement:last-child {
    border-bottom: none;
}

.wikidata-statement:hover {
    background-color: #f8f9fa;
}

/* Property label section (left column) - compact design */
.statement-property {
    width: 200px;
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    border-right: 1px solid #eaecf0;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.property-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    line-height: 1.3;
}

.property-label {
    font-size: 0.875rem;
    color: #222;
    font-weight: normal;
    margin-right: 0.25rem;
}

.property-id-link {
    font-size: 0.75rem;
    color: #0645ad;
    font-family: monospace;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.2s ease;
}

.property-id-link:hover {
    text-decoration: underline;
    color: #0b0080;
}

/* Legacy property-id for backwards compatibility */
.property-id {
    font-size: 0.75rem;
    color: #72777d;
    font-family: monospace;
    font-weight: normal;
}

/* Property value section (right column) - compact design */
.statement-value {
    flex: 1;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.statement-value > :first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Statement main value - compact row layout */
.statement-main-value {
    flex: 1;
    font-size: 0.875rem;
    color: #222;
    line-height: 1.4;
}

.value-display-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.value-qid-link {
    color: #0645ad;
    text-decoration: none;
    font-weight: 500;
}

.value-qid-link:hover {
    text-decoration: underline;
}

.value-qid-badge {
    color: #0645ad;
    text-decoration: none;
    font-family: monospace;
    font-size: 0.8em;
    font-weight: bold;
}

.value-qid-badge:hover {
    text-decoration: underline;
}

.value-label {
    font-weight: 500;
    color: #222;
}

.example-text {
    color: #72777d;
    font-style: italic;
}

.value-count-link {
    color: #0645ad;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.value-count-link:hover {
    text-decoration: underline;
}

/* Legacy statement value count for backwards compatibility */
.statement-value-count {
    font-size: 0.75rem;
    color: #72777d;
    margin-bottom: 0.5rem;
}

/* Statement actions - aligned to the right */
.statement-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

/* Wikidata-style buttons */
.wikidata-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    color: #0645ad;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.1s ease;
}

.wikidata-btn:hover {
    background-color: #ffffff;
    border-color: #72777d;
}

.wikidata-btn--reference {
    color: #00af89;
}

/* Statement references section */
.statement-references {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #eaecf0;
    border-radius: 2px;
}

.references-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #72777d;
    margin-bottom: 0.5rem;
}

.reference-item-small {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background-color: white;
    border: 1px solid #eaecf0;
    border-radius: 2px;
    font-size: 0.8rem;
}

.reference-item-small:last-child {
    margin-bottom: 0;
}

.reference-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-link {
    color: #0645ad;
    text-decoration: none;
    font-size: 0.8rem;
    word-break: break-all;
}

.reference-link:hover {
    text-decoration: underline;
}

.reference-date {
    color: #72777d;
    font-size: 0.75rem;
}

.reference-remove-btn {
    padding: 0.15rem 0.4rem;
    font-size: 1rem;
    line-height: 1;
    color: #c8102e;
    background-color: transparent;
    border: 1px solid #c8102e;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reference-remove-btn:hover {
    background-color: #c8102e;
    color: white;
}

.wikidata-btn--edit {
    color: #0645ad;
}

/* Values Modal Styles */
.values-modal-list {
    max-height: 400px;
    overflow-y: auto;
}

.value-modal-item {
    padding: 1rem;
    border-bottom: 1px solid #eaecf0;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.value-modal-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.value-item-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.value-content {
    color: #222;
    line-height: 1.4;
}

.value-link {
    color: #0645ad;
    text-decoration: none;
    font-weight: 500;
}

.value-link:hover {
    text-decoration: underline;
}

.no-values-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

/* New Statement Modal */
.new-statement-modal {
    width: 500px;
    max-width: 90vw;
}

.values-modal {
    width: 600px;
    max-width: 90vw;
}

.property-search-section,
.value-section {
    margin-bottom: 1.5rem;
}

.property-search-section {
    position: relative;
}

.property-search-section label,
.value-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.property-search-input,
.value-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #a2a9b1;
    border-radius: 2px;
    font-size: 0.875rem;
}

.property-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eaecf0;
    border-top: none;
    background-color: white;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.property-search-results:not(:empty) {
    display: block;
}

.property-result-item {
    padding: 0.75rem;
    border-bottom: 1px solid #eaecf0;
    cursor: pointer;
    line-height: 1.4;
}

.property-result-item:hover {
    background-color: #f8f9fa;
}

.property-result-item:last-child {
    border-bottom: none;
}

.prop-compact {
    display: inline;
    word-wrap: break-word;
}

.prop-label {
    font-weight: bold;
    color: #222;
}

.prop-id-link {
    font-family: monospace;
    font-size: 0.9em;
    color: #0645ad;
    text-decoration: none;
    font-weight: bold;
}

.prop-id-link:hover {
    text-decoration: underline;
}

.prop-description {
    color: #72777d;
}

/* Legacy classes for backwards compatibility */
.prop-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: #72777d;
    font-weight: bold;
}



/* Unavailable properties */
.unavailable-properties {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px dashed #999;
}

.unavailable-properties h4 {
    color: #666;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.unavailable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.unavailable-property {
    padding: 0.4rem 0.8rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.unavailable-property:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f0f8ff;
}

/* Preview Section */
.preview-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.preview-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.preview-container {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.preview-content {
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #333;
}

/* Issues Section */
.issues-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #fff8f8;
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.issues-section h3 {
    color: var(--danger-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.issues-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.issue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background-color: white;
    border: 1px solid #ffcdd2;
    border-radius: 4px;
    font-size: 0.9rem;
}

.issue-icon {
    color: var(--danger-color);
    font-size: 1.1rem;
}

.issue-text {
    flex: 1;
    color: #666;
}

.issue-action {
    padding: 0.3rem 0.6rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.issue-action:hover {
    background-color: #c62828;
}

/* Placeholder styling */
.designer-container .placeholder {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem;
}

/* Modal Container Styles */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    max-height: 90vh;
    width: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #333;
}

.modal-content {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background-color: #f8f9fa;
}

/* Reference Search Modal Styles */
.reference-search-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-input-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-input-section label {
    font-weight: 500;
    color: #333;
}

.reference-search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.reference-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.search-results-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.results-header {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.reference-search-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: #f8f9fa;
}

.search-placeholder {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

.no-search-results {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 1.5rem;
}

/* Language Selector Styles */
.labels-section,
.descriptions-section,
.aliases-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.labels-section h4,
.descriptions-section h4,
.aliases-section h4 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.language-mappings-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.language-mapping-row {
    display: grid;
    grid-template-columns: 80px 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    transition: box-shadow 0.2s;
}

.language-mapping-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.language-mapping-row.default-language {
    border-color: var(--primary-color);
    background-color: rgba(33, 150, 243, 0.02);
}

.language-code {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    min-width: 60px;
}

.default-indicator {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: normal;
    background: rgba(33, 150, 243, 0.1);
    padding: 0.15rem 0.3rem;
    border-radius: 2px;
    margin-left: 0.25rem;
    white-space: nowrap;
}

.property-selector {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    transition: border-color 0.2s;
}

.property-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.language-preview {
    padding: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.remove-language-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 32px;
    text-align: center;
}

.remove-language-btn:hover:not(:disabled) {
    background-color: #d32f2f;
}

.remove-language-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.button--small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Language Modal Styles */
.language-modal {
    max-width: 500px;
    width: 90%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.language-select,
.custom-language-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.language-select:focus,
.custom-language-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.custom-language-group {
    transition: opacity 0.3s;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #333;
}

/* Responsive adjustments for language selectors */
@media (max-width: 768px) {
    .language-mapping-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: left;
    }
    
    .language-code {
        justify-content: flex-start;
        margin-bottom: 0.25rem;
    }
    
    .remove-language-btn {
        justify-self: start;
        margin-top: 0.5rem;
    }
}

.results-count {
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

.reference-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: white;
    transition: background-color 0.2s;
}

.reference-search-result:hover {
    background-color: #f8f9fa;
}

.reference-search-result:last-child {
    border-bottom: none;
}

.reference-search-result.already-added {
    background-color: #e8f5e8;
    border-left: 3px solid var(--success-color);
}

.reference-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reference-info .reference-url {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    font-size: 0.9rem;
}

.reference-info .reference-url:hover {
    text-decoration: underline;
}

.reference-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.reference-type {
    font-size: 0.8rem;
    color: #666;
}

.reference-context {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.reference-actions {
    display: flex;
    align-items: center;
    margin-left: 1rem;
    flex-shrink: 0;
}

.reference-added-label {
    color: var(--success-color);
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Scrollbar styling for search results */
.reference-search-results::-webkit-scrollbar {
    width: 8px;
}

.reference-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.reference-search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.reference-search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* =============================================================================
   Enhanced Export Step Styling
   ============================================================================= */

/* Export Settings Panel */
.export-settings {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.export-settings h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
}

.export-mode-selection {
    margin-bottom: 1.5rem;
}

.radio-label {
    display: block;
    margin-bottom: 1rem;
    cursor: pointer;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #fff;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.radio-label input[type="radio"] {
    margin-right: 0.5rem;
}

.radio-text {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 0.25rem;
}

.radio-description {
    font-size: 0.875rem;
    color: #6c757d;
    display: block;
    margin-left: 1.25rem;
}

.radio-label input[type="radio"]:checked + .radio-text {
    color: var(--primary-color);
}

.radio-label:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: #e3f2fd;
}

/* Item Selection */
.item-selection {
    margin-bottom: 1.5rem;
}

.item-selection h5 {
    margin: 0 0 0.75rem 0;
    color: #495057;
    font-size: 1rem;
}

.item-selection-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fff;
    padding: 0.5rem;
}

.item-checkbox-wrapper {
    display: flex;
    align-items: center;
    padding: 0.375rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.item-checkbox-wrapper:hover {
    background: #f8f9fa;
}

.item-checkbox-wrapper input[type="checkbox"] {
    margin-right: 0.5rem;
}

.item-checkbox-label {
    cursor: pointer;
    color: #495057;
    font-size: 0.875rem;
}

/* Export Options */
.export-options {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

.checkbox-text {
    color: #495057;
    font-size: 0.875rem;
}

/* Validation Display */
.validation-display {
    margin-bottom: 1.5rem;
}

.validation-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.validation-errors {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.validation-warnings {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 0.75rem;
}

.validation-errors h4,
.validation-warnings h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.error-list,
.warning-list {
    margin: 0;
    padding-left: 1.25rem;
}

.error-list li,
.warning-list li {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

/* Enhanced QuickStatements Output */
.quick-statements-output {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.output-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
}

.output-actions {
    display: flex;
    gap: 0.5rem;
}

.output-actions .button {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

#quick-statements {
    width: 100%;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 1rem;
    background: #f8f9fa;
    resize: vertical;
    min-height: 200px;
}

#quick-statements:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* Info Links */
.info-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.info-link:hover {
    text-decoration: underline;
}

.info-separator {
    margin: 0 0.5rem;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .output-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .output-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .output-actions .button {
        flex: 1;
    }
    
    .radio-label {
        padding: 0.5rem;
    }
    
    .export-settings {
        padding: 1rem;
    }
}

/* Fold button styles */
.fold-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 0.25rem;
    font-size: 0.8rem;
    color: #72777d;
    transition: color 0.2s;
}

.fold-button:hover {
    color: #0645ad;
}

/* Key name text for non-generic references */
.key-name-text {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin-left: 0.25rem;
}

/* Expanded values container */
.expanded-values-container {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #eaecf0;
    border-radius: 2px;
    width: 100%;
}

/* Expanded item rows */
.expanded-item-row {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
}

.expanded-item-row:not(:last-child) {
    border-bottom: 1px dotted #eaecf0;
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

.expanded-item-label {
    font-weight: 500;
    color: #72777d;
    margin-right: 0.5rem;
    min-width: 80px;
}

.expanded-value-link {
    color: #0645ad;
    text-decoration: none;
}

.expanded-value-link:hover {
    text-decoration: underline;
}

.expanded-value-text {
    color: #202122;
}

.expanded-value-text.original {
    color: #666;
    font-style: italic;
}