/* Custom styles for DMN Comparator */

/* ============================================
   BASE BODY STYLES
   ============================================ */

/* Light mode body (default) */
body {
    background-color: #f3f4f6; /* gray-100 */
    color: #1f2937; /* gray-800 */
}

/* Dark mode body */
.dark body,
html.dark body {
    background-color: #111827; /* gray-900 */
    color: #f3f4f6; /* gray-100 */
}

/* File Upload Styles */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-zone:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.upload-zone.newer-bg {
    background-color: #eff6ff;
}

.upload-zone.older-bg {
    background-color: #f9fafb;
}

.upload-zone.newer-border {
    border-color: #93c5fd;
}

.upload-zone.older-border {
    border-color: #d1d5db;
}

.upload-zone.dragging {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

.upload-zone.loaded {
    border-color: #22c55e;
    background-color: #f0fdf4;
}

.upload-zone.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.upload-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.upload-status {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.upload-status.success {
    color: #16a34a;
}

.upload-status.error-text {
    color: #dc2626;
}

.file-input {
    display: none;
}

.browse-btn {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.browse-btn:hover {
    background-color: #f9fafb;
}

.error-container {
    margin-top: 1rem;
}

.error-message {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.375rem;
    padding: 1rem;
    color: #dc2626;
}

.hidden {
    display: none;
}

.loading {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Diff highlighting colors */
.diff-added {
    background-color: rgba(34, 197, 94, 0.2);
    border-left: 3px solid #22c55e;
}

.diff-removed {
    background-color: rgba(239, 68, 68, 0.2);
    border-left: 3px solid #ef4444;
}

.diff-modified {
    background-color: rgba(245, 158, 11, 0.2);
    border-left: 3px solid #f59e0b;
}

/* Split view styles */
.split-panel {
    overflow: auto;
    height: calc(100vh - 400px);
    min-height: 300px;
}

/* Sync scroll indicator */
.sync-active {
    box-shadow: 0 0 0 2px #3b82f6;
}


/* Split View Container */
.split-view-container {
    display: flex;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.split-panel.newer-panel,
.split-panel.older-panel {
    flex: 1;
    min-width: 0;
}

.split-divider {
    width: 4px;
    background-color: #d1d5db;
    cursor: col-resize;
    transition: background-color 0.2s;
}

.split-divider:hover {
    background-color: #3b82f6;
}

.panel-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.maximize-btn {
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.15s ease;
}

.maximize-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.split-panel.hidden {
    display: none !important;
}

.split-panel.maximized {
    flex: 1 !important;
    width: 100%;
}

.split-divider.hidden {
    display: none !important;
}

.panel-header.newer-header {
    background-color: #eff6ff;
    color: #1e40af;
}

.panel-header.older-header {
    background-color: #f9fafb;
    color: #374151;
}

.panel-content {
    padding: 1rem;
    overflow: auto;
}

.split-panel.maximized .panel-content {
    overflow: auto;
    width: 100%;
}

.empty-state {
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
}

/* DMN Document Styles */
.dmn-document {
    font-size: 14px;
}

.document-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1f2937;
}

/* Decision Table Styles */
.decision-table {
    margin-bottom: 1.5rem;
    border-radius: 0.375rem;
    padding: 0.5rem;
}

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

.table-name {
    font-weight: 600;
    color: #374151;
}

.hit-policy {
    font-size: 0.75rem;
    color: #6b7280;
}

.dmn-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #d1d5db;
}

.dmn-table th,
.dmn-table td {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.dmn-table th {
    background-color: #f3f4f6;
    font-weight: 600;
}

.input-header {
    background-color: #f3f4f6;
}

.output-header {
    background-color: #dbeafe;
}

.input-cell {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
}

.output-cell {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    background-color: #eff6ff;
}

.type-ref {
    font-size: 0.625rem;
    color: #9ca3af;
    font-weight: normal;
}

/* Enhanced Diff Highlighting */
.diff-added,
.dmn-table th.diff-added,
.dmn-table td.diff-added,
th.input-header.diff-added,
th.output-header.diff-added {
    background-color: rgba(34, 197, 94, 0.3) !important;
    border-left: 3px solid #22c55e;
}

.diff-added td,
.diff-added th,
th.diff-added,
td.diff-added {
    background-color: rgba(34, 197, 94, 0.2) !important;
}

.diff-removed,
.dmn-table th.diff-removed,
.dmn-table td.diff-removed,
th.input-header.diff-removed,
th.output-header.diff-removed {
    background-color: rgba(239, 68, 68, 0.3) !important;
    border-left: 3px solid #ef4444;
}

.diff-removed td,
.diff-removed th,
th.diff-removed,
td.diff-removed {
    background-color: rgba(239, 68, 68, 0.2) !important;
}

.diff-modified,
.dmn-table th.diff-modified,
.dmn-table td.diff-modified,
th.input-header.diff-modified,
th.output-header.diff-modified {
    background-color: rgba(245, 158, 11, 0.3) !important;
    border-left: 3px solid #f59e0b;
}

.diff-modified td,
.diff-modified th,
th.diff-modified,
td.diff-modified {
    background-color: rgba(245, 158, 11, 0.2) !important;
}

/* Element Focus Highlight */
.highlight-focus {
    box-shadow: 0 0 0 2px #3b82f6;
    animation: pulse-ring 0.5s ease-in-out;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.3); }
}

/* Diff Summary Card */
.summary-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    text-align: center;
}

.summary-item {
    padding: 0.75rem;
    border-radius: 0.375rem;
}

.summary-item.additions {
    background-color: #f0fdf4;
}

.summary-item.removals {
    background-color: #fef2f2;
}

.summary-item.modifications {
    background-color: #fffbeb;
}

.summary-item.unchanged {
    background-color: #f9fafb;
}

.summary-count {
    font-size: 1.5rem;
    font-weight: 700;
}

.summary-count.additions { color: #16a34a; }
.summary-count.removals { color: #dc2626; }
.summary-count.modifications { color: #d97706; }
.summary-count.unchanged { color: #6b7280; }

.summary-label {
    font-size: 0.875rem;
    color: #6b7280;
}


/* Sync Control Styles */
.sync-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.sync-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.sync-toggle input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.sync-toggle-label {
    font-size: 0.875rem;
    color: #374151;
}

.sync-mode-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    background-color: white;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    background-color: #d1d5db;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.split-panel:hover .scroll-indicator {
    opacity: 1;
}

.scroll-indicator-thumb {
    background-color: #3b82f6;
    border-radius: 2px;
    min-height: 20px;
}


/* Diff Table Styles */
.diff-table-container {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-top: 1rem;
}

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

.summary-counts {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.summary-counts > span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.summary-counts .count {
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.status-dot.added {
    background-color: #22c55e;
}

.status-dot.removed {
    background-color: #ef4444;
}

.status-dot.modified {
    background-color: #f59e0b;
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    background-color: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    background-color: #f3f4f6;
}

.filter-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Diff Table */
.diff-table-wrapper {
    max-height: 16rem;
    overflow: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
}

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

.diff-table th {
    position: sticky;
    top: 0;
    background-color: #f3f4f6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

.diff-table .col-status {
    width: 4rem;
}

.diff-table .col-element {
    width: 10rem;
}

.diff-table .col-description {
    /* Takes remaining space */
}

.diff-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.diff-table tbody tr:hover {
    background-color: #f9fafb;
}

.diff-table tbody tr.highlighted {
    background-color: #dbeafe !important;
}

.diff-table td {
    padding: 0.75rem;
    font-size: 0.875rem;
}

.diff-table .col-element {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
}

.diff-table .col-description {
    color: #4b5563;
}

/* Row status indicators */
.diff-row.row-added {
    border-left: 3px solid #22c55e;
}

.diff-row.row-removed {
    border-left: 3px solid #ef4444;
}

.diff-row.row-modified {
    border-left: 3px solid #f59e0b;
}

/* Empty message */
.empty-message {
    text-align: center;
    color: #9ca3af;
    padding: 2rem !important;
}


/* Application Header */
.app-header {
    margin-bottom: 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1f2937;
}

.app-subtitle {
    color: #6b7280;
}

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

.reset-btn {
    background-color: #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
}

.reset-btn:hover {
    background-color: #d1d5db;
}

/* Application Status */
.app-status {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.app-status.error {
    color: #dc2626;
}

/* Section spacing */
.section {
    margin-bottom: 1.5rem;
}


/* ============================================
   SIMULATOR STYLES
   ============================================ */

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tab-button:hover {
    color: #3b82f6;
}

.tab-button.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Shared Upload Section (for Simulator & Flow tabs) */
.shared-upload-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-top: none;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.shared-upload-section.hidden {
    display: none;
}

.shared-upload-content {
    max-width: 600px;
}

.shared-upload-section .section-title {
    margin-top: 0;
}

.shared-upload-section .file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.shared-upload-section .file-upload-area:hover {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.shared-upload-section .file-upload-area.drag-over {
    border-color: #3b82f6;
    background-color: #dbeafe;
}

.shared-upload-section .table-selector-section {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shared-upload-section .table-selector-section.hidden,
.shared-upload-section .table-selector-section.flow-mode-hidden {
    display: none;
}

.shared-upload-section .table-selector {
    flex: 1;
    max-width: 400px;
}

/* Dark mode for shared upload */
.dark .shared-upload-section {
    background: #1f2937;
    border-color: #374151;
}

.dark .shared-upload-section .file-upload-area {
    background: #111827;
    border-color: #4b5563;
}

.dark .shared-upload-section .file-upload-area:hover {
    border-color: #3b82f6;
    background-color: #1e3a5f;
}

.tab-content-container {
    min-height: 400px;
    padding-top: 1.5rem;
}

.tab-content {
    display: none;
}

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

/* Flow Diagram Tab - needs explicit height for SVG rendering */
#tab-content-flow-diagram {
    min-height: 700px;
}

#tab-content-flow-diagram.active {
    display: flex;
    flex-direction: column;
}

#tab-content-flow-diagram .flow-view {
    flex: 1;
    min-height: 600px;
}

/* Simulator View */
.simulator-view {
    padding: 0;
}

.simulator-section {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* File Upload Area */
.simulator-upload .file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simulator-upload .file-upload-area:hover,
.simulator-upload .file-upload-area.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.simulator-upload .file-input {
    display: none;
}

.simulator-upload .file-label {
    cursor: pointer;
    display: block;
}

.simulator-upload .file-label-text {
    color: #6b7280;
}

.simulator-upload .file-status {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.simulator-upload .file-status.success {
    color: #16a34a;
}

.simulator-upload .file-status.error {
    color: #dc2626;
}

.simulator-upload .file-status.loading {
    color: #3b82f6;
}

/* Table Selector */
.table-selector {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background-color: white;
}

/* Simulator Main Content */
.simulator-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

.simulator-main.hidden {
    display: none;
}

.simulator-column {
    min-width: 0;
}

/* Input Controls Panel */
.input-controls-panel {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.input-controls-header {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.controls-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-inputs-message {
    color: #9ca3af;
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

/* Input Control Container */
.input-control-container {
    margin-bottom: 0.75rem;
}

.input-control-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.input-type-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: normal;
}

.input-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.input-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.input-control-select {
    background-color: white;
}

.input-control-boolean {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
}

.boolean-option {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
}

.boolean-radio {
    width: 1rem;
    height: 1rem;
}

.boolean-label {
    font-size: 0.875rem;
    color: #374151;
}

/* Simulator Table Container */
.simulator-table-container {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.simulator-table-container .decision-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.simulator-table-container .decision-table th,
.simulator-table-container .decision-table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.simulator-table-container .decision-table th {
    background-color: #f3f4f6;
    font-weight: 600;
}

.simulator-table-container .rule-num-header,
.simulator-table-container .rule-num {
    width: 2.5rem;
    text-align: center;
    color: #6b7280;
}

.simulator-table-container .input-header {
    background-color: #f3f4f6;
}

.simulator-table-container .output-header {
    background-color: #dbeafe;
}

.simulator-table-container .input-entry {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
}

.simulator-table-container .output-entry {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8125rem;
    background-color: #eff6ff;
}

/* Rule Highlighting */
.rule-row.rule-matched {
    background-color: rgba(34, 197, 94, 0.2) !important;
}

.rule-row.rule-matched td {
    background-color: rgba(34, 197, 94, 0.15) !important;
}

.rule-row.rule-matched .output-entry {
    background-color: rgba(34, 197, 94, 0.25) !important;
}

.rule-row.rule-first-match {
    background-color: rgba(34, 197, 94, 0.35) !important;
    box-shadow: inset 0 0 0 2px #22c55e;
}

/* Output Panel */
.output-panel {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.output-panel-header {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.output-content {
    min-height: 3rem;
}

.output-message {
    color: #6b7280;
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.output-message.output-no-match {
    color: #d97706;
    background-color: #fffbeb;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.no-match-icon {
    font-size: 1.25rem;
}

.output-policy-info {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.output-rule-info,
.output-rule-header {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.output-values {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.output-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.output-label {
    color: #6b7280;
    font-weight: 500;
}

.output-value {
    color: #1f2937;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.output-collected-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.output-rule-result {
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 0.375rem;
    border-left: 3px solid #22c55e;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .simulator-main {
        grid-template-columns: 1fr;
    }
    
    .simulator-inputs {
        order: 1;
    }
    
    .simulator-results {
        order: 2;
    }
}


/* Ctrl+Click Row Auto-Fill */
.simulator-table-container .rule-row {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.simulator-table-container .rule-row:hover {
    background-color: #f3f4f6;
}

.simulator-table-container .rule-row:hover td {
    background-color: inherit;
}

.simulator-table-container .rule-row:hover .output-entry {
    background-color: #e0e7ff;
}

/* Visual hint for Ctrl+click */
.simulator-table-container .rule-row::after {
    content: 'Ctrl+click to fill';
    position: absolute;
    right: 0.5rem;
    opacity: 0;
    font-size: 0.75rem;
    color: #6b7280;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.simulator-table-container .decision-table {
    position: relative;
}

.simulator-table-container tbody {
    position: relative;
}


/* Table Hint */
.table-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #0369a1;
}

.table-hint .hint-icon {
    font-size: 1rem;
}

.table-hint .hint-text {
    flex: 1;
}

.table-hint kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.75rem;
    background-color: #e0f2fe;
    border: 1px solid #7dd3fc;
    border-radius: 0.25rem;
    box-shadow: 0 1px 0 #7dd3fc;
}


/* ============================================
   DARK MODE STYLES - File Upload Components
   ============================================ */

/* Upload Zone Base Dark Mode */
.dark .upload-zone {
    border-color: #4b5563;
    background-color: #1f2937;
}

.dark .upload-zone:hover {
    border-color: #60a5fa;
    background-color: #1e3a5f;
}

/* Upload Zone Background Variants Dark Mode */
.dark .upload-zone.newer-bg {
    background-color: #1e3a5f;
}

.dark .upload-zone.older-bg {
    background-color: #1f2937;
}

/* Upload Zone Border Variants Dark Mode */
.dark .upload-zone.newer-border {
    border-color: #3b82f6;
}

.dark .upload-zone.older-border {
    border-color: #4b5563;
}

/* Upload Zone Dragging State Dark Mode */
.dark .upload-zone.dragging {
    border-color: #60a5fa;
    background-color: #1e40af;
}

/* Upload Zone Loaded State Dark Mode */
.dark .upload-zone.loaded {
    border-color: #22c55e;
    background-color: #14532d;
}

/* Upload Zone Error State Dark Mode */
.dark .upload-zone.error {
    border-color: #ef4444;
    background-color: #450a0a;
}

/* Upload Icon Dark Mode */
.dark .upload-icon {
    color: #9ca3af;
}

/* Upload Label Dark Mode */
.dark .upload-label {
    color: #f3f4f6;
}

/* Upload Hint Dark Mode */
.dark .upload-hint {
    color: #9ca3af;
}

/* Upload Status Dark Mode */
.dark .upload-status {
    color: #d1d5db;
}

.dark .upload-status.success {
    color: #4ade80;
}

.dark .upload-status.error-text {
    color: #f87171;
}

/* Browse Button Dark Mode */
.dark .browse-btn {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .browse-btn:hover {
    background-color: #4b5563;
}

/* Error Container Dark Mode */
.dark .error-container .error-message {
    background-color: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}


/* ============================================
   DARK MODE STYLES - Split View Components
   ============================================ */

/* Split View Container Dark Mode */
.dark .split-view-container {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Panel Headers Dark Mode - Maintaining newer/older distinction */
.dark .panel-header {
    border-bottom-color: #374151;
}

.dark .panel-header.newer-header {
    background-color: #1e3a5f;
    color: #93c5fd;
}

.dark .panel-header.older-header {
    background-color: #374151;
    color: #d1d5db;
}

/* Split Divider Dark Mode */
.dark .split-divider {
    background-color: #4b5563;
}

.dark .split-divider:hover {
    background-color: #60a5fa;
}

/* Panel Content Dark Mode */
.dark .panel-content {
    background-color: #1f2937;
    color: #f3f4f6;
}

/* Maximize Button Dark Mode */
.dark .maximize-btn {
    background-color: transparent;
    border-color: #4b5563;
    color: #9ca3af;
}

.dark .maximize-btn:hover {
    background-color: #374151;
    border-color: #6b7280;
    color: #f3f4f6;
}

/* Empty State Dark Mode */
.dark .empty-state {
    color: #6b7280;
}


/* ============================================
   DARK MODE STYLES - Core Layout Components
   ============================================ */

/* Application Header Dark Mode */
.dark .app-header {
    border-color: #374151;
}

.dark .app-title {
    color: #f9fafb;
}

.dark .app-subtitle {
    color: #9ca3af;
}

/* Reset Button Dark Mode */
.dark .reset-btn {
    background-color: #374151;
    color: #f9fafb;
    border-color: #4b5563;
}

.dark .reset-btn:hover {
    background-color: #4b5563;
}

/* Application Status Dark Mode */
.dark .app-status {
    color: #9ca3af;
}

.dark .app-status.error {
    color: #f87171;
}


/* ============================================
   DARK MODE STYLES - DMN Table Components
   ============================================ */

/* DMN Table Base Dark Mode */
.dark .dmn-table {
    border-color: #4b5563;
}

/* DMN Table Headers and Cells Dark Mode */
.dark .dmn-table th,
.dark .dmn-table td {
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .dmn-table th {
    background-color: #374151;
}

/* Input Header Dark Mode - Maintaining distinction from output */
.dark .input-header {
    background-color: #374151;
    color: #f3f4f6;
}

/* Output Header Dark Mode - Blue tint for distinction */
.dark .output-header {
    background-color: #1e3a5f;
    color: #93c5fd;
}

/* Input Cell Dark Mode */
.dark .input-cell {
    background-color: #1f2937;
    color: #e5e7eb;
}

/* Output Cell Dark Mode - Blue tint background */
.dark .output-cell {
    background-color: #172554;
    color: #bfdbfe;
}

/* Table Name Dark Mode */
.dark .table-name {
    color: #f3f4f6;
}

/* Hit Policy Dark Mode */
.dark .hit-policy {
    color: #9ca3af;
}

/* Type Reference Dark Mode */
.dark .type-ref {
    color: #6b7280;
}

/* Document Title Dark Mode */
.dark .document-title {
    color: #f9fafb;
}

/* Decision Table Container Dark Mode */
.dark .decision-table {
    background-color: #1f2937;
}


/* ============================================
   THEME TRANSITION ANIMATIONS
   ============================================ */

/* Base transition for theme changes */
body,
.app-header,
.app-title,
.app-subtitle,
.reset-btn,
.app-status,
.upload-zone,
.upload-label,
.upload-hint,
.browse-btn,
.split-view-container,
.panel-header,
.panel-content,
.split-divider,
.maximize-btn,
.dmn-table,
.dmn-table th,
.dmn-table td,
.table-name,
.hit-policy,
.type-ref,
.diff-added,
.diff-removed,
.diff-modified,
.diff-row,
.diff-table-container,
.diff-table th,
.diff-table td,
.filter-btn,
.summary-card,
.summary-item,
.summary-count,
.summary-label,
.tab-navigation,
.tab-button,
.input-controls-panel,
.input-controls-header,
.input-control-label,
.input-control,
.input-type-hint,
.input-control-boolean,
.boolean-label,
.table-selector,
.output-panel,
.output-panel-header,
.output-message,
.output-values,
.output-label,
.output-value,
.output-policy-info,
.output-rule-info,
.output-rule-header,
.output-rule-result,
.output-content,
.simulator-table-container,
.simulator-upload .file-upload-area,
.simulator-upload .file-label-text,
.simulator-upload .file-status,
.section-title,
.no-inputs-message,
.rule-row,
.sync-controls,
.sync-toggle,
.table-hint,
.empty-state,
.empty-message,
.error-message {
    transition: background-color 0.2s ease, 
                color 0.2s ease, 
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

/* ============================================
   DARK MODE STYLES - Diff Highlighting
   ============================================ */

/* Diff Added - Dark Mode Green Tones */
.dark .diff-added,
.dark .dmn-table th.diff-added,
.dark .dmn-table td.diff-added,
.dark th.input-header.diff-added,
.dark th.output-header.diff-added {
    background-color: rgba(34, 197, 94, 0.25) !important;
    border-left: 3px solid #4ade80;
}

.dark .diff-added td,
.dark .diff-added th,
.dark th.diff-added,
.dark td.diff-added {
    background-color: rgba(34, 197, 94, 0.15) !important;
}

/* Diff Removed - Dark Mode Red Tones */
.dark .diff-removed,
.dark .dmn-table th.diff-removed,
.dark .dmn-table td.diff-removed,
.dark th.input-header.diff-removed,
.dark th.output-header.diff-removed {
    background-color: rgba(248, 113, 113, 0.25) !important;
    border-left: 3px solid #f87171;
}

.dark .diff-removed td,
.dark .diff-removed th,
.dark th.diff-removed,
.dark td.diff-removed {
    background-color: rgba(248, 113, 113, 0.15) !important;
}

/* Diff Modified - Dark Mode Amber Tones */
.dark .diff-modified,
.dark .dmn-table th.diff-modified,
.dark .dmn-table td.diff-modified,
.dark th.input-header.diff-modified,
.dark th.output-header.diff-modified {
    background-color: rgba(251, 191, 36, 0.25) !important;
    border-left: 3px solid #fbbf24;
}

.dark .diff-modified td,
.dark .diff-modified th,
.dark th.diff-modified,
.dark td.diff-modified {
    background-color: rgba(251, 191, 36, 0.15) !important;
}

/* Diff Row Status Indicators - Dark Mode */
.dark .diff-row.row-added {
    border-left: 3px solid #4ade80;
}

.dark .diff-row.row-removed {
    border-left: 3px solid #f87171;
}

.dark .diff-row.row-modified {
    border-left: 3px solid #fbbf24;
}

/* Element Focus Highlight - Dark Mode */
.dark .highlight-focus {
    box-shadow: 0 0 0 2px #60a5fa;
}


/* ============================================
   DARK MODE STYLES - Diff Table Component
   ============================================ */

/* Diff Table Container Dark Mode */
.dark .diff-table-container {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Diff Table Header Dark Mode */
.dark .diff-table-header {
    color: #f3f4f6;
}

/* Diff Table Wrapper Dark Mode */
.dark .diff-table-wrapper {
    border-color: #374151;
}

/* Diff Table Header Row Dark Mode */
.dark .diff-table th {
    background-color: #374151;
    color: #9ca3af;
    border-bottom-color: #4b5563;
}

/* Diff Table Body Rows Dark Mode */
.dark .diff-table tbody tr {
    border-bottom-color: #374151;
}

.dark .diff-table tbody tr:hover {
    background-color: #374151;
}

.dark .diff-table tbody tr.highlighted {
    background-color: #1e3a5f !important;
}

/* Diff Table Cells Dark Mode */
.dark .diff-table td {
    color: #f3f4f6;
}

.dark .diff-table .col-element {
    color: #e5e7eb;
}

.dark .diff-table .col-description {
    color: #9ca3af;
}

/* Filter Buttons Dark Mode */
.dark .filter-btn {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .filter-btn:hover {
    background-color: #4b5563;
}

.dark .filter-btn.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Summary Counts Dark Mode */
.dark .summary-counts {
    color: #f3f4f6;
}

.dark .summary-counts .summary-label {
    color: #9ca3af;
}

.dark .summary-counts .count {
    color: #f3f4f6;
}

/* Status Dots Dark Mode - Maintaining semantic colors with better visibility */
.dark .status-dot.added {
    background-color: #4ade80;
}

.dark .status-dot.removed {
    background-color: #f87171;
}

.dark .status-dot.modified {
    background-color: #fbbf24;
}

/* Empty Message Dark Mode */
.dark .diff-table .empty-message {
    color: #6b7280;
}


/* ============================================
   DARK MODE STYLES - Simulator Components
   ============================================ */

/* Simulator Upload Area Dark Mode */
.dark .simulator-upload .file-upload-area {
    border-color: #4b5563;
    background-color: #1f2937;
}

.dark .simulator-upload .file-upload-area:hover,
.dark .simulator-upload .file-upload-area.drag-over {
    border-color: #60a5fa;
    background-color: #1e3a5f;
}

.dark .simulator-upload .file-label-text {
    color: #9ca3af;
}

.dark .simulator-upload .file-status {
    color: #d1d5db;
}

.dark .simulator-upload .file-status.success {
    color: #4ade80;
}

.dark .simulator-upload .file-status.error {
    color: #f87171;
}

.dark .simulator-upload .file-status.loading {
    color: #60a5fa;
}

/* Table Selector Dark Mode */
.dark .table-selector {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .table-selector:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

/* Input Controls Panel Dark Mode */
.dark .input-controls-panel {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .input-controls-header {
    color: #f3f4f6;
    border-bottom-color: #374151;
}

.dark .no-inputs-message {
    color: #6b7280;
}

/* Input Control Label Dark Mode */
.dark .input-control-label {
    color: #f3f4f6;
}

.dark .input-type-hint {
    color: #6b7280;
}

/* Input Control Fields Dark Mode */
.dark .input-control {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .input-control:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.dark .input-control::placeholder {
    color: #6b7280;
}

/* Input Control Select Dark Mode */
.dark .input-control-select {
    background-color: #374151;
    color: #f3f4f6;
}

/* Boolean Input Controls Dark Mode */
.dark .input-control-boolean {
    color: #f3f4f6;
}

.dark .boolean-label {
    color: #f3f4f6;
}

.dark .boolean-radio {
    accent-color: #3b82f6;
}

/* Simulator Table Container Dark Mode */
.dark .simulator-table-container {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark .simulator-table-container .decision-table th,
.dark .simulator-table-container .decision-table td {
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .simulator-table-container .decision-table th {
    background-color: #374151;
}

.dark .simulator-table-container .rule-num-header,
.dark .simulator-table-container .rule-num {
    color: #9ca3af;
}

.dark .simulator-table-container .input-header {
    background-color: #374151;
    color: #f3f4f6;
}

.dark .simulator-table-container .output-header {
    background-color: #1e3a5f;
    color: #93c5fd;
}

.dark .simulator-table-container .input-entry {
    background-color: #1f2937;
    color: #e5e7eb;
}

.dark .simulator-table-container .output-entry {
    background-color: #172554;
    color: #bfdbfe;
}

/* Rule Row Hover Dark Mode */
.dark .simulator-table-container .rule-row:hover {
    background-color: #374151;
}

.dark .simulator-table-container .rule-row:hover td {
    background-color: inherit;
}

.dark .simulator-table-container .rule-row:hover .output-entry {
    background-color: #1e3a5f;
}

/* Rule Highlighting Dark Mode */
.dark .rule-row.rule-matched {
    background-color: rgba(74, 222, 128, 0.2) !important;
}

.dark .rule-row.rule-matched td {
    background-color: rgba(74, 222, 128, 0.15) !important;
}

.dark .rule-row.rule-matched .output-entry {
    background-color: rgba(74, 222, 128, 0.25) !important;
}

.dark .rule-row.rule-first-match {
    background-color: rgba(74, 222, 128, 0.35) !important;
    box-shadow: inset 0 0 0 2px #4ade80;
}

/* Section Title Dark Mode */
.dark .section-title {
    color: #f3f4f6;
}


/* ============================================
   DARK MODE STYLES - Output Panel
   ============================================ */

/* Output Panel Dark Mode */
.dark .output-panel {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Output Panel Header Dark Mode */
.dark .output-panel-header {
    color: #f3f4f6;
    border-bottom-color: #374151;
}

/* Output Message Dark Mode */
.dark .output-message {
    color: #9ca3af;
}

/* Output No Match Warning Dark Mode */
.dark .output-message.output-no-match {
    color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Output Policy Info Dark Mode */
.dark .output-policy-info {
    color: #9ca3af;
    border-bottom-color: #374151;
}

/* Output Rule Info Dark Mode */
.dark .output-rule-info,
.dark .output-rule-header {
    color: #f3f4f6;
}

/* Output Values Dark Mode */
.dark .output-values {
    color: #f3f4f6;
}

/* Output Label Dark Mode */
.dark .output-label {
    color: #9ca3af;
}

/* Output Value Dark Mode */
.dark .output-value {
    color: #e5e7eb;
}

/* Output Rule Result Dark Mode */
.dark .output-rule-result {
    background-color: #374151;
    border-left-color: #4ade80;
}

/* Output Content Dark Mode */
.dark .output-content {
    color: #f3f4f6;
}


/* ============================================
   DARK MODE STYLES - Summary Cards
   ============================================ */

/* Summary Card Dark Mode */
.dark .summary-card {
    background-color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Summary Item Backgrounds Dark Mode - Tinted colors for semantic meaning */
.dark .summary-item.additions {
    background-color: rgba(74, 222, 128, 0.15);
}

.dark .summary-item.removals {
    background-color: rgba(248, 113, 113, 0.15);
}

.dark .summary-item.modifications {
    background-color: rgba(251, 191, 36, 0.15);
}

.dark .summary-item.unchanged {
    background-color: #374151;
}

/* Summary Count Dark Mode - Semantic colors with sufficient contrast */
.dark .summary-count {
    color: #f3f4f6;
}

.dark .summary-count.additions {
    color: #4ade80;
}

.dark .summary-count.removals {
    color: #f87171;
}

.dark .summary-count.modifications {
    color: #fbbf24;
}

.dark .summary-count.unchanged {
    color: #9ca3af;
}

/* Summary Label Dark Mode */
.dark .summary-label {
    color: #9ca3af;
}


/* ============================================
   DARK MODE STYLES - Tab Navigation
   ============================================ */

/* Tab Navigation Border Dark Mode */
.dark .tab-navigation {
    border-bottom-color: #374151;
}

/* Tab Button Base Dark Mode - Inactive state with sufficient contrast */
.dark .tab-button {
    color: #9ca3af;
}

/* Tab Button Hover Dark Mode - Visible feedback */
.dark .tab-button:hover {
    color: #60a5fa;
}

/* Tab Button Active Dark Mode - Visible indicator */
.dark .tab-button.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}


/* ============================================
   DARK MODE STYLES - Miscellaneous Components
   ============================================ */

/* Sync Controls Dark Mode */
.dark .sync-controls {
    background-color: #1f2937;
    border-bottom-color: #374151;
}

/* Sync Toggle Dark Mode */
.dark .sync-toggle {
    color: #f3f4f6;
}

.dark .sync-toggle-label {
    color: #f3f4f6;
}

.dark .sync-toggle input[type="checkbox"] {
    accent-color: #3b82f6;
}

/* Sync Mode Select Dark Mode */
.dark .sync-mode-select {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

/* Table Hint Dark Mode */
.dark .table-hint {
    background-color: rgba(30, 58, 95, 0.5);
    border-color: #1e40af;
    color: #93c5fd;
}

.dark .table-hint kbd {
    background-color: #1e3a5f;
    border-color: #3b82f6;
    box-shadow: 0 1px 0 #3b82f6;
    color: #bfdbfe;
}

/* Empty State Dark Mode (general) */
.dark .empty-state {
    color: #6b7280;
}

/* Empty Message Dark Mode (general) */
.dark .empty-message {
    color: #6b7280;
}

/* Error Message Dark Mode */
.dark .error-message {
    background-color: rgba(127, 29, 29, 0.3);
    border-color: #7f1d1d;
    color: #fca5a5;
}


/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    body,
    .app-header,
    .app-title,
    .app-subtitle,
    .reset-btn,
    .app-status,
    .upload-zone,
    .upload-label,
    .upload-hint,
    .browse-btn,
    .split-view-container,
    .panel-header,
    .panel-content,
    .split-divider,
    .maximize-btn,
    .dmn-table,
    .dmn-table th,
    .dmn-table td,
    .table-name,
    .hit-policy,
    .type-ref,
    .diff-added,
    .diff-removed,
    .diff-modified,
    .diff-row,
    .diff-table-container,
    .diff-table th,
    .diff-table td,
    .filter-btn,
    .summary-card,
    .summary-item,
    .summary-count,
    .summary-label,
    .tab-navigation,
    .tab-button,
    .input-controls-panel,
    .input-controls-header,
    .input-control-label,
    .input-control,
    .input-type-hint,
    .input-control-boolean,
    .boolean-label,
    .table-selector,
    .output-panel,
    .output-panel-header,
    .output-message,
    .output-values,
    .output-label,
    .output-value,
    .output-policy-info,
    .output-rule-info,
    .output-rule-header,
    .output-rule-result,
    .output-content,
    .simulator-table-container,
    .simulator-upload .file-upload-area,
    .simulator-upload .file-label-text,
    .simulator-upload .file-status,
    .section-title,
    .no-inputs-message,
    .rule-row,
    .sync-controls,
    .sync-toggle,
    .table-hint,
    .empty-state,
    .empty-message,
    .error-message {
        transition: none;
    }
}


/* ============================================
   THEME SWITCHER COMPONENT STYLES
   ============================================ */

/* Theme Switcher Container */
.theme-switcher {
    position: relative;
    display: inline-block;
}

/* Theme Switcher Button */
.theme-switcher-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    color: #374151;
}

.theme-switcher-button:hover {
    background-color: #d1d5db;
}

.theme-switcher-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Theme Switcher Icon */
.theme-switcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme Switcher Label */
.theme-switcher-label {
    font-weight: 500;
}

/* Theme Switcher Chevron */
.theme-switcher-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

/* Theme Switcher Dropdown */
.theme-switcher-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 140px;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: opacity 0.15s, visibility 0.15s, transform 0.15s;
    z-index: 50;
}

.theme-switcher-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Theme Switcher Option */
.theme-switcher-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s;
    color: #374151;
    text-align: left;
}

.theme-switcher-option:first-child {
    border-radius: 0.375rem 0.375rem 0 0;
}

.theme-switcher-option:last-child {
    border-radius: 0 0 0.375rem 0.375rem;
}

.theme-switcher-option:hover,
.theme-switcher-option.focused {
    background-color: #f3f4f6;
}

.theme-switcher-option.selected {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.theme-switcher-option:focus {
    outline: none;
    background-color: #f3f4f6;
}

/* Theme Option Icon */
.theme-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Theme Option Label */
.theme-option-label {
    flex: 1;
}


/* ============================================
   THEME SWITCHER DARK MODE STYLES
   ============================================ */

/* Theme Switcher Button Dark Mode */
.dark .theme-switcher-button {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .theme-switcher-button:hover {
    background-color: #4b5563;
}

.dark .theme-switcher-button:focus {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5);
}

/* Theme Switcher Dropdown Dark Mode */
.dark .theme-switcher-dropdown {
    background-color: #1f2937;
    border-color: #4b5563;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* Theme Switcher Option Dark Mode */
.dark .theme-switcher-option {
    color: #f3f4f6;
}

.dark .theme-switcher-option:hover,
.dark .theme-switcher-option.focused {
    background-color: #374151;
}

.dark .theme-switcher-option.selected {
    background-color: #1e3a5f;
    color: #93c5fd;
}

.dark .theme-switcher-option:focus {
    background-color: #374151;
}


/* ============================================
   APP CONTAINER WIDTH CONTROL
   ============================================ */

/* App Container - Adjustable width */
.app-container {
    max-width: 1280px;
    transition: max-width 0.2s ease;
}

/* Width Control Container */
.width-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
}

/* Width Control Label */
.width-control-label {
    display: flex;
    align-items: center;
    color: #6b7280;
}

/* Width Slider */
.width-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #d1d5db;
    border-radius: 2px;
    cursor: pointer;
}

.width-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s;
}

.width-slider::-webkit-slider-thumb:hover {
    background: #2563eb;
}

.width-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #3b82f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s;
}

.width-slider::-moz-range-thumb:hover {
    background: #2563eb;
}

/* Width Value Display */
.width-value {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 50px;
    text-align: right;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

/* Width Control Dark Mode */
.dark .width-control {
    background-color: #374151;
    border-color: #4b5563;
}

.dark .width-control-label {
    color: #9ca3af;
}

.dark .width-slider {
    background: #4b5563;
}

.dark .width-slider::-webkit-slider-thumb {
    background: #60a5fa;
}

.dark .width-slider::-webkit-slider-thumb:hover {
    background: #3b82f6;
}

.dark .width-slider::-moz-range-thumb {
    background: #60a5fa;
}

.dark .width-slider::-moz-range-thumb:hover {
    background: #3b82f6;
}

.dark .width-value {
    color: #9ca3af;
}

/* Responsive - Hide width control on small screens */
@media (max-width: 768px) {
    .width-control {
        display: none;
    }
    
    .app-container {
        max-width: 100% !important;
    }
}

/* ============================================
   FLOW DIAGRAM STYLES
   ============================================ */

/* Main View Container */
.flow-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 600px;
    background: var(--bg-primary, #ffffff);
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Flow Upload Section */
.flow-upload-section {
    padding: 1rem;
    background: var(--bg-secondary, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    flex-shrink: 0;
}

.flow-upload-section .section-title {
    margin-bottom: 0.75rem;
}

.flow-file-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

.flow-file-upload-area:hover,
.flow-file-upload-area.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.flow-upload-section .file-input {
    display: none;
}

.flow-upload-section .file-label {
    cursor: pointer;
    display: block;
}

.flow-upload-section .file-label-text {
    color: #6b7280;
}

.flow-upload-section .file-status {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.flow-upload-section .file-status.success {
    color: #16a34a;
}

.flow-upload-section .file-status.error {
    color: #dc2626;
}

.flow-upload-section .file-status.loading {
    color: #3b82f6;
}

.flow-table-selector-section {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flow-table-selector-section label {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.flow-table-selector-section .table-selector {
    flex: 1;
}

/* Dark Mode for Flow Upload */
.dark .flow-upload-section {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

.dark .flow-file-upload-area {
    border-color: #4b5563;
    background-color: #1f2937;
}

.dark .flow-file-upload-area:hover,
.dark .flow-file-upload-area.drag-over {
    border-color: #60a5fa;
    background-color: #1e3a5f;
}

.dark .flow-upload-section .file-label-text {
    color: #9ca3af;
}

.dark .flow-upload-section .file-status {
    color: #d1d5db;
}

.dark .flow-upload-section .file-status.success {
    color: #4ade80;
}

.dark .flow-upload-section .file-status.error {
    color: #f87171;
}

.dark .flow-upload-section .file-status.loading {
    color: #60a5fa;
}

/* Toolbar */
.flow-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.flow-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.flow-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary, #1f2937);
}

.flow-stats {
    font-size: 0.875rem;
    color: var(--text-secondary, #6b7280);
}

.flow-toolbar-right {
    display: flex;
    gap: 0.5rem;
}

.flow-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 0.375rem;
    background: var(--bg-primary, #ffffff);
    color: var(--text-primary, #374151);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.15s ease;
}

.flow-btn:hover {
    background: var(--bg-hover, #f3f4f6);
    border-color: var(--border-hover, #9ca3af);
}

/* Content Area */
.flow-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

.flow-diagram-container {
    flex: 1;
    overflow: hidden;
    background: var(--bg-diagram, #fafafa);
    background-image: 
        radial-gradient(circle, var(--dot-color, #d1d5db) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 400px;
}

/* SVG Styles */
.flow-diagram-svg {
    display: block;
    min-width: 100%;
    min-height: 100%;
    user-select: none;
    -webkit-user-select: none;
}

/* Node Styles */
.flow-node {
    cursor: move;
}

.flow-node-hitarea {
    cursor: move;
    pointer-events: all;
}

.flow-node-shape {
    pointer-events: all;
}

.flow-node-label {
    pointer-events: none;
}

.flow-node--hover .flow-node-shape {
    filter: brightness(1.1);
}

.flow-node--dragging {
    opacity: 0.9;
}

.flow-node--dragging .flow-node-shape {
    filter: brightness(1.15) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.flow-node--selected .flow-node-shape {
    stroke: #3b82f6 !important;
    stroke-width: 3px !important;
}

.flow-node-shape {
    fill: var(--node-bg, #ffffff);
    stroke: var(--node-border, #d1d5db);
    stroke-width: 2px;
}

.flow-node-shape--start {
    fill: #3b82f6;
    stroke: #2563eb;
}

.flow-node-shape--output {
    fill: #10b981;
    stroke: #059669;
}

.flow-node-shape--branch {
    fill: #f59e0b;
    stroke: #d97706;
}

.flow-arrow {
    fill: var(--flow-edge-color, #9ca3af);
}

.flow-node-label {
    font-size: 12px;
    font-family: system-ui, -apple-system, sans-serif;
    fill: var(--text-primary, #1f2937);
    pointer-events: none;
}

.flow-node-label--output {
    fill: #ffffff;
    font-weight: 600;
}

.flow-node-sublabel {
    font-size: 10px;
    fill: rgba(255, 255, 255, 0.8);
}

.flow-node--start .flow-node-label {
    fill: #ffffff;
}

/* Edge Styles */
.flow-edge-path {
    fill: none;
    stroke: var(--flow-edge-color, #9ca3af);
    stroke-width: 2px;
}

.flow-edge--negation .flow-edge-path {
    stroke: #ef4444;
}

.flow-edge--any .flow-edge-path {
    stroke-dasharray: 5, 5;
    stroke: #9ca3af;
}

.flow-edge-label-bg {
    fill: var(--bg-primary, #ffffff);
    stroke: var(--border-color, #e5e7eb);
    stroke-width: 1px;
}

.flow-edge-label {
    font-size: 10px;
    font-family: system-ui, -apple-system, sans-serif;
    fill: var(--text-secondary, #6b7280);
}

/* Details Panel */
.flow-details-panel {
    width: 280px;
    background: var(--bg-primary, #ffffff);
    border-left: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
}

.flow-details-panel--visible {
    transform: translateX(0);
}

.flow-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
}

.flow-details-title {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
}

.flow-details-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary, #6b7280);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.flow-details-close:hover {
    color: var(--text-primary, #1f2937);
}

.flow-details-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.flow-details-placeholder {
    color: var(--text-secondary, #9ca3af);
    text-align: center;
    padding: 2rem 1rem;
}

.flow-detail-section {
    margin-bottom: 1.25rem;
}

.flow-detail-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.5rem;
}

.flow-detail-table {
    width: 100%;
    font-size: 0.875rem;
}

.flow-detail-table td {
    padding: 0.25rem 0;
}

.flow-detail-label {
    color: var(--text-secondary, #6b7280);
    width: 50%;
}

.flow-detail-value {
    color: var(--text-primary, #1f2937);
    font-weight: 500;
}

.flow-rule-list {
    font-size: 0.875rem;
    color: var(--text-primary, #374151);
    word-break: break-word;
}

.flow-path-item {
    padding: 0.5rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.8125rem;
}

.flow-path-rule {
    font-weight: 600;
    color: var(--text-primary, #374151);
}

.flow-path-conditions {
    color: var(--text-secondary, #6b7280);
    display: block;
    margin-top: 0.25rem;
}

.flow-input-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.flow-input-list li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-primary, #374151);
    border-bottom: 1px solid var(--border-color, #f3f4f6);
}

/* Summary Panel */
.flow-summary-panel {
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    max-height: 200px;
    overflow-y: auto;
}

.flow-summary-header {
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary, #374151);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    position: sticky;
    top: 0;
    background: var(--bg-secondary, #f9fafb);
}

.flow-summary-content {
    padding: 0.75rem 1rem;
}

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

.flow-summary-item {
    padding: 0.5rem;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.flow-summary-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.flow-summary-output {
    font-family: monospace;
    font-size: 0.8125rem;
    color: var(--text-primary, #1f2937);
    margin-bottom: 0.375rem;
    word-break: break-all;
}

.flow-summary-bar {
    height: 4px;
    background: var(--bg-tertiary, #e5e7eb);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.flow-summary-bar-fill {
    height: 100%;
    background: #10b981;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.flow-summary-count {
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}

.flow-summary-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.flow-summary-section h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.5rem;
}

.flow-key-inputs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.flow-key-inputs li {
    padding: 0.25rem 0.5rem;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-primary, #374151);
}

.flow-significance {
    color: var(--text-secondary, #9ca3af);
    margin-left: 0.25rem;
}

/* Dark Mode Overrides */
.dark .flow-view {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #374151;
    --bg-diagram: #0f172a;
    --bg-hover: #374151;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --border-hover: #4b5563;
    --node-bg: #1f2937;
    --node-border: #4b5563;
    --dot-color: #374151;
    --flow-edge-color: #6b7280;
}

.dark .flow-node-shape {
    fill: #1f2937;
    stroke: #4b5563;
}

.dark .flow-edge-label-bg {
    fill: #1f2937;
    stroke: #374151;
}

/* Responsive */
@media (max-width: 768px) {
    .flow-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .flow-details-panel {
        width: 100%;
    }
}


/* Flow Diagram Empty State */
.flow-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
    padding: 2rem;
}

.flow-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.flow-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #374151);
    margin-bottom: 0.5rem;
}

.flow-empty-state p {
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1.5rem;
}

.flow-btn--primary {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
    cursor: pointer;
}

.flow-btn--primary:hover {
    background: #2563eb;
}

.flow-btn--upload {
    cursor: pointer;
}

.dark .flow-empty-state h3 {
    color: #f3f4f6;
}

.dark .flow-empty-state p {
    color: #9ca3af;
}
