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

body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
display: flex;
flex-direction: column;
height: 100vh;
overflow: hidden;
background: #f5f5f5;
}

#topBar {
height: 60px;
background: white;
border-bottom: 1px solid #e0e0e0;
display: flex;
align-items: center;
padding: 0 20px;
gap: 20px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
z-index: 100;
}

.logo {
display: flex;
align-items: center;
gap: 8px;
font-size: 20px;
font-weight: 700;
color: #1a1a1a;
}

.logo-icon {
width: 32px;
height: 32px;
background: linear-gradient(135deg, #3b83f6 0%, #170109 100%);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 18px;
}

.toolbar {
display: flex;
align-items: center;
gap: 8px;
margin-left: 20px;
}

.toolbar-btn {
width: 36px;
height: 36px;
border: 1px solid #e0e0e0;
background: white;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #666;
transition: all 0.2s;
}

.toolbar-btn:hover {
background: #f5f5f5;
border-color: #d0d0d0;
}

.file-info {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
padding: 8px 16px;
background: #f9fafb;
border-radius: 6px;
}

.file-name {
font-size: 14px;
color: #1a1a1a;
font-weight: 500;
}

.file-status {
font-size: 12px;
color: #999;
}

.action-buttons {
display: flex;
gap: 8px;
}

.btn-secondary {
padding: 8px 16px;
border: 1px solid #e0e0e0;
background: white;
border-radius: 6px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
color: #1a1a1a;
transition: all 0.2s;
}

.btn-secondary:hover {
background: #f5f5f5;
}

.btn-primary {
padding: 8px 16px;
border: none;
background: #3b82f6;
color: white;
border-radius: 6px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}

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

#mainContent {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
}

#workspaceArea {
display: flex;
flex: 1;
overflow: hidden;
}

#paletteDiv {
position: fixed;
left: -280px;
top: 60px;
width: 280px;
height: calc(100vh - 60px);
background: #fafafa;
border-right: 1px solid #e5e7eb;
display: flex;
flex-direction: column;
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
transition: left 0.3s ease;
z-index: 50;
}

#paletteDiv.show {
left: 0;
}

#paletteToggle.hidden {
display: none;
}

.palette-toggle {
position: fixed;
left: 20px;
top: 80px;
width: 44px;
height: 44px;
background: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
z-index: 60;
transition: all 0.3s;
color: #666;
font-size: 18px;
}

.palette-toggle:hover {
background: #f9fafb;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.palette-toggle.active {
left: 340px;
}

.palette-header {
padding: 24px 24px 20px 24px;
background: white;
border-bottom: 1px solid #e5e7eb;
display: flex;
align-items: center;
justify-content: space-between;
}

.palette-header h2 {
font-size: 20px;
font-weight: 700;
color: #111827;
letter-spacing: -0.01em;
}

.palette-close-btn {
width: 32px;
height: 32px;
border: 1px solid #e5e7eb;
background: white;
border-radius: 6px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 18px;
color: #9ca3af;
transition: all 0.2s;
padding: 0;
}

.palette-close-btn:hover {
background: #f9fafb;
border-color: #d1d5db;
color: #6b7280;
}

.palette-content {
flex: 1;
overflow-y: auto;
padding: 20px;
background: #fafafa;
}

.go-palette {
display: block !important;
width: 100%;
height: 100%;
}

.palette-footer {
border-top: 1px solid #e5e7eb;
padding: 16px 20px;
background: white;
}

.footer-button {
width: 100%;
padding: 12px;
border: 1px solid #e5e7eb;
background: white;
color: #374151;
font-size: 14px;
font-weight: 500;
cursor: pointer;
border-radius: 8px;
transition: all 0.2s;
margin-bottom: 8px;
text-align: left;
}

.footer-button:last-child {
margin-bottom: 0;
}

.footer-button:hover {
background: #f9fafb;
border-color: #d1d5db;
}

#myDiagramDiv {
flex: 1;
background: #fafbfc;
position: relative;
}

#propertiesPanel {
width: 350px;
background: white;
border-left: 1px solid #e0e0e0;
overflow-y: auto;
display: none;
box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
}

#propertiesPanel.show {
display: block;
}

.prop-header {
padding: 20px;
border-bottom: 1px solid #f0f0f0;
display: flex;
align-items: flex-start;
gap: 12px;
}

.prop-icon {
width: 40px;
height: 40px;
background: #f0f7ff;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
flex-shrink: 0;
}

.prop-title-section {
flex: 1;
}

.prop-title {
font-size: 16px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 2px;
}

.prop-subtitle {
font-size: 12px;
color: #999;
}

.prop-menu {
color: #999;
cursor: pointer;
font-size: 20px;
}

.prop-section {
padding: 20px;
border-bottom: 1px solid #f0f0f0;
}

.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16px;
cursor: pointer;
}

.section-title {
font-size: 13px;
font-weight: 600;
color: #1a1a1a;
}

.section-toggle {
color: #999;
transition: transform 0.2s;
font-size: 12px;
}

.section-toggle.collapsed {
transform: rotate(-90deg);
}

.form-group {
margin-bottom: 16px;
}

.form-label {
display: block;
font-size: 12px;
color: #666;
margin-bottom: 6px;
}

.form-input {
width: 100%;
padding: 9px 12px;
border: 1px solid #e0e0e0;
border-radius: 6px;
font-size: 13px;
font-family: inherit;
transition: border-color 0.2s;
background: white;
}

.form-input:focus {
outline: none;
border-color: #3b82f6;
}

.form-textarea {
min-height: 70px;
resize: vertical;
}

.form-select {
appearance: none;
background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
padding-right: 36px;
cursor: pointer;
}

.conditions-box {
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 6px;
padding: 12px;
position: relative;
}

.condition-chips {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 12px;
}

.condition-chip {
background: white;
border: 1px solid #e0e0e0;
padding: 5px 10px;
border-radius: 4px;
font-size: 12px;
color: #3b82f6;
font-family: 'Courier New', monospace;
}

.conditions-label {
font-size: 10px;
color: #999;
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 8px;
}

.conditions-count {
font-size: 12px;
color: #666;
margin-top: 8px;
}

.path-item {
display: flex;
align-items: center;
gap: 8px;
color: #666;
font-size: 13px;
padding: 6px 0;
}

.path-icon {
font-size: 14px;
color: #999;
}

.add-condition-btn {
position: absolute;
top: 12px;
right: 12px;
width: 20px;
height: 20px;
border: 1px solid #e0e0e0;
background: white;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
color: #666;
}

.info-icon {
display: inline-block;
width: 14px;
height: 14px;
background: #e0e0e0;
border-radius: 50%;
text-align: center;
line-height: 14px;
font-size: 10px;
color: white;
margin-left: 4px;
cursor: help;
}

.toggle-icon {
width: 16px;
height: 16px;
color: #ccc;
cursor: pointer;
}

.go-palette {
display: none !important;
}

/* Modal styles */
.modal-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 1000;
align-items: center;
justify-content: center;
}

.modal-overlay.show {
display: flex;
}

.modal {
background: white;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
max-width: 900px;
width: 90%;
max-height: 80vh;
display: flex;
flex-direction: column;
}

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

.modal-title {
font-size: 18px;
font-weight: 600;
color: #1a1a1a;
}

.modal-close {
width: 32px;
height: 32px;
border: none;
background: none;
cursor: pointer;
color: #999;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 6px;
transition: all 0..2s;
}

.modal-close:hover {
background: #f5f5f5;
color: #666;
}

.modal-body {
padding: 24px;
overflow-y: auto;
flex: 1;
}

.json-preview {
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 16px;
font-family: 'Courier New', monospace;
font-size: 12px;
color: #374151;
max-height: 400px;
overflow: auto;
white-space: pre-wrap;
word-break: break-all;
}

.modal-footer {
padding: 16px 24px;
border-top: 1px solid #e5e7eb;
display: flex;
gap: 8px;
justify-content: flex-end;
}

.notification {
position: fixed;
top: 80px;
right: 20px;
background: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 16px 20px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
display: none;
align-items: center;
gap: 12px;
z-index: 2000;
animation: slideIn 0.3s ease;
}

.notification.show {
display: flex;
}

.notification.success {
border-left: 4px solid #10b981;
}

.notification.error {
border-left: 4px solid #ef4444;
}

.notification-icon {
font-size: 20px;
}

..notification-message {
font-size: 14px;
color: #1a1a1a;
}

@keyframes slideIn {
from {
transform: translateX(400px);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}

/* Bottom Panel Styles */
#bottomPanel {
height: 0;
background: white;
border-top: 1px solid #e5e7eb;
display: flex;
flex-direction: column;
transition: height 0.3s ease;
overflow: hidden;
z-index: 99999;
}

#bottomPanel.show {
height: 400px;
}

.bottom-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
height: 48px;
border-bottom: 1px solid #e5e7eb;
background: #fafafa;
}

.bottom-tabs {
display: flex;
gap: 4px;
}

.bottom-tab {
padding: 8px 16px;
border: none;
background: transparent;
color: #666;
font-size: 13px;
font-weight: 500;
cursor: pointer;
border-radius: 6px 6px 0 0;
transition: all 0.2s;
position: relative;
}

.bottom-tab:hover {
background: #f0f0f0;
color: #333;
}

.bottom-tab.active {
background: white;
color: #3b82f6;
}

.bottom-tab.active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 2px;
background: #3b82f6;
}

.bottom-panel-actions {
display: flex;
gap: 8px;
align-items: center;
}

.panel-action-btn {
width: 28px;
height: 28px;
border: none;
background: transparent;
border-radius: 4px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: #666;
font-size: 16px;
transition: all 0.2s;
}

.panel-action-btn:hover {
background: #e5e7eb;
color: #333;
}

.bottom-panel-content {
flex: 1;
overflow: auto;
padding: 20px;
background: white;
}

.tab-content {
display: none;
height: 100%;
}

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

.run-output {
font-family: 'Courier New', monospace;
font-size: 13px;
line-height: 1.6;
color: #1a1a1a;
}

.run-step {
padding: 12px;
margin-bottom: 8px;
border-left: 3px solid #e5e7eb;
background: #f9fafb;
border-radius: 4px;
}

.run-step.success {
border-left-color: #10b981;
background: #f0fdf4;
}

.run-step.error {
border-left-color: #ef4444;
background: #fef2f2;
}

.run-step.running {
border-left-color: #3b82f6;
background: #eff6ff;
}

.step-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}

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

.step-title {
font-weight: 600;
color: #1a1a1a;
}

.step-time {
margin-left: auto;
font-size: 11px;
color: #999;
}

.step-details {
font-size: 12px;
color: #666;
margin-top: 4px;
}

.json-viewer {
font-family: 'Courier New', monospace;
font-size: 12px;
line-height: 1.6;
color: #1a1a1a;
background: #f9fafb;
padding: 16px;
border-radius: 8px;
overflow: auto;
white-space: pre-wrap;
word-break: break-all;
}

.run-controls {
display: flex;
gap: 8px;
margin-bottom: 16px;
padding-bottom: 16px;
border-bottom: 1px solid #e5e7eb;
}

.run-btn {
padding: 8px 16px;
border: 1px solid #e5e7eb;
background: white;
color: #1a1a1a;
border-radius: 6px;
font-size: 13px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 6px;
}

.run-btn:hover {
background: #f9fafb;
border-color: #d1d5db;
}

.run-btn.primary {
background: #3b82f6;
color: white;
border-color: #3b82f6;
}

.run-btn.primary:hover {
background: #2563eb;
border-color: #2563eb;
}

.run-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}

.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: #999;
text-align: center;
}

.empty-state-icon {
font-size: 48px;
margin-bottom: 12px;
opacity: 0.5;
}

.empty-state-text {
font-size: 14px;
}

.panel-toggle-btn {
position: fixed;
bottom: 20px;
right: 20px;
width: 48px;
height: 48px;
border: 1px solid #e5e7eb;
background: white;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
z-index: 100;
transition: all 0.3s;
color: #666;
font-size: 20px;
}

.panel-toggle-btn:hover {
background: #f9fafb;
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
transform: translateY(-2px);
}

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

/* Data Input Modal Styles */
.data-section {
margin-bottom: 24px;
}

.data-section-title {
font-size: 14px;
font-weight: 600;
color: #1a1a1a;
margin-bottom: 12px;
}

.data-textarea {
width: 100%;
min-height: 200px;
padding: 12px;
border: 1px solid #e5e7eb;
border-radius: 6px;
font-family: 'Courier New', monospace;
font-size: 12px;
line-height: 1.5;
resize: vertical;
}

.data-textarea:focus {
outline: none;
border-color: #3b82f6;
}

.data-help {
font-size: 12px;
color: #999;
margin-top: 8px;
}

.json-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f9fafb;
  cursor: pointer;
  transition: all 0.2s;
}

.json-list-item:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

.json-list-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.json-list-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.json-list-date {
  font-size: 12px;
  color: #999;
}

.json-list-meta {
  font-size: 12px;
  color: #666;
  text-align: right;
}

.json-list-actions {
  display: flex;
  gap: 6px;
}

.json-list-actions button {
  padding: 4px 10px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.json-list-actions button:hover {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

.json-list-actions button.delete-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
}