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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Custom Tooltip */
.custom-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    pointer-events: none;
    z-index: 10000;
    max-width: 300px;
    white-space: pre-wrap;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: none;
}

.custom-tooltip.visible {
    opacity: 1;
    display: block;
}

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

.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.toolbar-label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.25rem;
}

.toolbar-separator {
    width: 1px;
    height: 30px;
    background-color: #ddd;
    margin: 0 0.5rem;
}

.btn-icon {
    display: inline-block;
    margin-right: 0.25rem;
    font-weight: bold;
    font-size: 14px;
}

/* Shortcut Button Styles */
.shortcut-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    min-width: 42px;
    height: 42px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    font-family: inherit;
}

.shortcut-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.shortcut-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.shortcut-btn:disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: #e0e0e0;
}

.shortcut-btn:disabled .shortcut-icon {
    opacity: 0.6;
}

.shortcut-btn:disabled .shortcut-key {
    opacity: 0.4;
}

.shortcut-icon {
    font-size: 18px;
    line-height: 1;
}

.shortcut-key {
    font-size: 9px;
    font-weight: 600;
    color: #7f8c8d;
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: white;
    padding: 1px 3px;
    border-radius: 3px;
}

.shortcut-btn.danger {
    border-color: #e74c3c;
}

.shortcut-btn.danger:hover:not(:disabled) {
    border-color: #c0392b;
    background-color: #fff5f5;
}

.shortcut-btn.success {
    border-color: #27ae60;
}

.shortcut-btn.success:hover:not(:disabled) {
    border-color: #229954;
    background-color: #f0fff4;
}

/* AI Generator Button */
.shortcut-btn.ai-generator {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #f8f8ff 0%, #f0e6ff 100%);
}

.shortcut-btn.ai-generator:hover:not(:disabled) {
    border-color: #8e44ad;
    background: linear-gradient(135deg, #f0e6ff 0%, #e8d5ff 100%);
    transform: translateY(-2px) scale(1.05);
}

.btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.825rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #229954;
}

.btn-info {
    background-color: #8e44ad;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background-color: #7d3c98;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.btn-warning {
    background-color: #f39c12;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e67e22;
}



.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: white;
    border-right: 1px solid #ddd;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.sidebar h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.tree-explanation-section {
    margin-bottom: 1rem;
}

.tree-explanation-section textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    resize: vertical;
    margin-bottom: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
}

/* Zoom controls */
.zoom-indicator {
    display: inline-block;
    min-width: 60px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    padding: 0 8px;
}

.btn.btn-sm {
    padding: 6px 12px;
    font-size: 16px;
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar hr {
    margin: 1rem 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.properties-panel {
    font-size: 0.875rem;
}

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

/* Unified Properties Panel Styles */
.properties-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-bottom: 20px;
}

.property-section {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.property-group {
    margin-bottom: 15px;
}

.property-group label {
    display: block;
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
    font-size: 13px;
}

.property-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    transition: border-color 0.15s;
}

.property-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

textarea.property-input {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
    line-height: 1.4;
    overflow: hidden;
    transition: height 0.2s ease;
}

/* Collapsible Sections */
.property-group-collapsible {
    margin: 10px 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.property-group-collapsible summary {
    cursor: pointer;
    font-weight: 500;
    padding: 12px 15px;
    user-select: none;
    background: #f8f9fa;
    transition: background 0.2s;
}

.property-group-collapsible summary:hover {
    background: #e9ecef;
}

.property-group-collapsible[open] summary {
    background: #e3f2fd;
    border-bottom: 1px solid #e0e0e0;
}

.collapsible-content {
    padding: 15px;
    background: #ffffff;
}

/* Visual Indicators for Different Input Types */
.positive-indicator {
    border-left: 3px solid #4CAF50;
}

.negative-indicator {
    border-left: 3px solid #f44336;
}

.true-path-indicator {
    border-left: 3px solid #2196F3;
}

.false-path-indicator {
    border-left: 3px solid #FF9800;
}

/* Label Inputs Grid */
.label-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.label-inputs > div {
    display: flex;
    flex-direction: column;
}

.path-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.path-label.true-path {
    color: #27ae60;
}

.path-label.false-path {
    color: #e74c3c;
}

/* Helper Text */
.input-helper {
    display: block;
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
}

.input-helper.warning {
    color: #f39c12;
}

/* Checkbox Labels */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

/* Connection Info */
.connection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.connection-info:last-child {
    border-bottom: none;
}

.connection-label {
    font-weight: 500;
    font-size: 12px;
}

/* Property Info Messages */
.property-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.info-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    font-size: 13px;
    color: #495057;
}

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


/* Compact Design for Sidebar */
.properties-panel .property-group {
    margin-bottom: 12px;
}

.properties-panel textarea.property-input {
    font-size: 12px;
    line-height: 1.3;
    min-height: 50px;
    overflow: hidden;
    transition: height 0.2s ease;
}

.properties-panel input.property-input {
    height: 32px;
    font-size: 12px;
}

.properties-panel select.property-input {
    height: 32px;
    font-size: 12px;
    cursor: pointer;
}

/* Property Value Display */
.property-value {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Properties Panel - New Design */
.properties-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
}

.properties-type-icon {
    font-size: 24px;
}

.properties-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2c3e50;
}

.property-section {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.property-section-collapsible {
    border-bottom: 1px solid #e9ecef;
}

.property-section-collapsible.collapsed .section-content {
    display: none !important;
}

.section-header {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    background: #f8f9fa;
    transition: background 0.2s;
    user-select: none;
}

.section-header:hover {
    background: #e9ecef;
}

.section-header.expanded {
    background: #e3f2fd;
}

.section-icon {
    font-size: 18px;
    margin-right: 10px;
}

.section-title {
    flex-grow: 1;
    font-weight: 500;
    color: #495057;
}

.section-toggle {
    color: #6c757d;
    font-size: 12px;
}

.section-content {
    padding: 15px;
    background: #ffffff;
}

/* Primary property group styling */
.property-group-primary {
    margin-bottom: 20px;
}

.label-primary {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.input-primary {
    font-size: 15px;
    padding: 10px;
    border: 2px solid #3498db;
    background: #f0f8ff;
}

.input-primary:focus {
    background: white;
    border-color: #2980b9;
}

/* Label with icons */
.label-icon {
    font-size: 16px;
    margin-right: 6px;
}

/* AI Suggest Button - New Style */
.ai-suggest-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 15px;
    font-weight: 500;
    margin-top: 15px;
}

.ai-suggest-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46a1 100%);
}

.btn-icon {
    margin-right: 8px;
    font-size: 18px;
}

/* Range input styling */
.input-with-helper {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type="range"] {
    flex-grow: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

.range-label {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: #3498db;
    font-size: 18px;
}

/* Checkbox styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Helper text */
.input-helper {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Inline tooltip - sempre visível */
.field-tooltip {
    display: block;
    margin-top: 6px;
    padding: 8px 12px;
    background: #e3f2fd;
    border-left: 3px solid #2196f3;
    border-radius: 4px;
    font-size: 12px;
    color: #1976d2;
    line-height: 1.4;
}

.field-tooltip.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    color: #856404;
}

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

.property-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #555;
}

.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 0.5rem;
    background-color: #e9ecef;
    color: #6c757d;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    cursor: help;
    position: relative;
    transition: all 0.2s;
}

.help-icon:hover {
    background-color: #3498db;
    color: white;
    transform: scale(1.1);
}

.help-tooltip {
    position: fixed;
    padding: 12px 16px;
    background-color: #2c3e50;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: normal;
    white-space: normal;
    width: 280px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 10000;
    display: none;
    transform: translateY(5px);
}

.help-tooltip.show {
    opacity: 1;
    display: block;
    transform: translateY(0);
}

.help-icon:hover .help-tooltip {
    opacity: 1;
    display: block;
    transform: translateY(0);
}

/* Removed arrow for tooltip since position is dynamic */

.property-group input,
.property-group textarea,
.property-group select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.2s;
    background: #ffffff;
}

.property-group input:focus,
.property-group textarea:focus,
.property-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.property-group textarea {
    min-height: 60px;
    resize: vertical;
    font-family: inherit;
}

/* Select styling */
.property-group select {
    cursor: pointer;
    background-image: 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='%236c757d' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    appearance: none;
}


/* Flow Legend */
.flow-legend {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.flow-legend h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #2c3e50;
    text-align: center;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
}

.legend-icon {
    font-weight: bold;
    font-size: 14px;
    color: #2c3e50;
    display: inline-block;
    width: 30px;
    text-align: center;
}

.legend-note {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
}

.canvas {
    min-width: 100%;
    min-height: 100%;
    background-color: #fafafa;
    background-image: 
        linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

.node {
    cursor: pointer;
    transition: all 0.2s;
}

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

.node:hover .node-rect {
    stroke-width: 3;
}

@keyframes selectedPulse {
    0% { 
        filter: drop-shadow(0 0 15px rgba(52, 152, 219, 1)) drop-shadow(0 0 30px rgba(52, 152, 219, 0.9));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(52, 152, 219, 1)) drop-shadow(0 0 50px rgba(52, 152, 219, 1));
    }
    100% { 
        filter: drop-shadow(0 0 15px rgba(52, 152, 219, 1)) drop-shadow(0 0 30px rgba(52, 152, 219, 0.9));
    }
}

@keyframes selectedPulseRed {
    0% { 
        filter: drop-shadow(0 0 15px rgba(231, 76, 60, 1)) drop-shadow(0 0 30px rgba(231, 76, 60, 0.9));
    }
    50% { 
        filter: drop-shadow(0 0 25px rgba(231, 76, 60, 1)) drop-shadow(0 0 50px rgba(231, 76, 60, 1));
    }
    100% { 
        filter: drop-shadow(0 0 15px rgba(231, 76, 60, 1)) drop-shadow(0 0 30px rgba(231, 76, 60, 0.9));
    }
}

.node.selected {
    animation: selectedPulse 1.5s ease-in-out infinite;
}

.node-semaphore.selected {
    animation: selectedPulseRed 1.5s ease-in-out infinite;
}

.node.selected .node-rect {
    stroke: #3498db !important;
    stroke-width: 5px !important;
    stroke-dasharray: 10,5 !important;
    fill: rgba(52, 152, 219, 0.1) !important;
}

.node-semaphore.selected .semaphore-body {
    stroke: #e74c3c !important;
    stroke-width: 5px !important;
    stroke-dasharray: 10,5 !important;
    fill: rgba(231, 76, 60, 0.1) !important;
}

.node-rect {
    fill: white;
    stroke-width: 2;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.node-question .node-rect {
    stroke: #3498db;
    fill: #ecf6ff;
}

.node-semaphore .node-rect {
    stroke: #7f8c8d;
    fill: #f8f9fa;
    stroke-width: 2;
}

.node-conditioning-rect {
    stroke: #e67e22;
    fill: #fef5e7;
    stroke-width: 3;
    stroke-dasharray: 5,5;
}

.node-switchcase .node-rect {
    stroke: #9b59b6;
    fill: #f4ecf7;
    stroke-width: 2;
}

.node-switchcase-rect {
    stroke: #9b59b6;
    fill: #f4ecf7;
    stroke-width: 2;
}

/* Passthrough node styles */
.node-passthrough .node-rect {
    stroke: #7f8c8d;
    fill: #ecf0f1;
    stroke-width: 2;
}

.node-passthrough-rect {
    stroke: #7f8c8d;
    fill: #ecf0f1;
    stroke-width: 2;
}

/* Passthrough icon at top-left corner */
.passthrough-icon-bg {
    stroke: #7f8c8d;
    fill: #95a5a6;
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Passthrough with trigger enabled styles */
.node-passthrough-trigger-rect {
    stroke: #f39c12;
    fill: #fef7e4;
    stroke-width: 2;
}

/* Trigger indicator icon */
.trigger-icon-bg {
    stroke: #f39c12;
    fill: #f1c40f;
    stroke-width: 1.5;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.trigger-icon {
    fill: #d68910;
    font-weight: bold;
    pointer-events: none;
}

.node-icon-bg {
    fill: white;
    stroke-width: 2;
}

/* Question icon at top-left corner */
.question-icon-bg {
    stroke: #3498db;
    fill: #3498db;
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Semaphore icon at top-left corner */
.semaphore-icon-bg {
    stroke: #34495e;
    fill: #2c3e50;
    stroke-width: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Conditioning icon at top corner */
.conditioning-icon-bg {
    stroke: #d35400;
    fill: #e67e22;
    stroke-width: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* SwitchCase icon at top corner */
.switchcase-icon-bg {
    stroke: #8e44ad;
    fill: #9b59b6;
    stroke-width: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Response node styles */
.node-response .node-rect {
    stroke: #16a085;
    fill: #e8f8f5;
    stroke-width: 2;
}

.node-response-rect {
    stroke: #16a085;
    fill: #e8f8f5;
    stroke-width: 2;
}

/* Response icon at top-left corner */
.response-icon-bg {
    stroke: #16a085;
    fill: #1abc9c;
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}


/* Simulation Modal Styles */
.simulation-modal .modal-content {
    width: 95%;
    max-width: 1400px;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.simulation-modal .modal-header {
    flex-shrink: 0;
}

.simulation-modal .modal-body {
    flex: 1;
    overflow: hidden; /* Changed from overflow-y: auto to prevent modal scrolling */
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for Firefox */
    padding-bottom: 20px;
}

/* Style scrollbar for modal body */
.simulation-modal .modal-body::-webkit-scrollbar {
    width: 10px;
}

.simulation-modal .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.simulation-modal .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.simulation-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.simulation-layout {
    display: flex;
    gap: 20px;
    min-height: 0; /* Important for Firefox */
    flex: 1; /* Fill available space */
    overflow: hidden; /* Prevent content from expanding modal */
}

.simulation-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    min-height: 0; /* Important for flex children */
    overflow: hidden; /* Prevent expansion */
}

.simulation-config-wrapper {
    width: 400px;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flex children */
    overflow: hidden; /* Prevent expansion */
}

.simulation-config-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1; /* Fill available space */
    overflow-y: auto; /* Allow scrolling for config panel */
    min-height: 0; /* Important for flex behavior */
}

/* Ensure all children respect the container width */
.simulation-config-panel > * {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix scrollbar styling */
.simulation-config-panel::-webkit-scrollbar {
    width: 8px;
}

.simulation-config-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.simulation-config-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.simulation-config-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.simulation-status {
    margin-bottom: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

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

.status-indicator.status-starting { background-color: #e3f2fd; }
.status-indicator.status-waiting { background-color: #fff3cd; }
.status-indicator.status-processing { background-color: #e8f5e9; }
.status-indicator.status-completed { background-color: #d4edda; }
.status-indicator.status-stopped { background-color: #f8d7da; }
.status-indicator.status-error { background-color: #f8d7da; }

.progress-container {
    margin-top: 10px;
}

.progress-bar {
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    min-height: 0; /* Critical for proper flex behavior */
    max-height: 100%; /* Ensure it doesn't exceed parent */
}

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

.chat-welcome p {
    margin: 10px 0;
}

.chat-message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

.user-message {
    text-align: right;
}

.assistant-message {
    text-align: left;
}

.system-message {
    text-align: center;
    font-style: italic;
    color: #666;
    margin: 10px 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.user-message .message-header {
    justify-content: flex-end;
}

.message-role {
    font-weight: 600;
}

.message-time {
    color: #999;
}

.message-node {
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

.message-content {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

/* Wendy toggle styles */
.wendy-toggle {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    font-weight: 500;
}

.wendy-toggle:hover {
    background: #e0e0e0;
    border-color: #999;
}

.wendy-toggle:active {
    transform: scale(0.95);
}

/* Message content wrapper for toggle functionality */
.message-content-wrapper {
    position: relative;
}

.message-content-wrapper .message-content {
    display: none;
}

.message-content-wrapper .message-content.active {
    display: inline-block;
}

/* Wendy message specific styling */
.message-content.wendy-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.assistant-message .message-content.wendy-message {
    background: #fff3cd;
    color: #856404;
}

.user-message .message-content {
    background: #007bff;
    color: white;
}

.assistant-message .message-content {
    background: #f1f3f4;
    color: #333;
}

.chat-input-container {
    display: flex;
    gap: 10px;
}

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

.chat-input:focus {
    border-color: #007bff;
}

.chat-send-button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.chat-send-button:hover:not(:disabled) {
    background: #0056b3;
}

.chat-send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.config-section,
.debug-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.config-section h3,
.debug-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.payload-editor label,
.initial-message label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.payload-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    resize: vertical;
}

.initial-message-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

.debug-info {
    font-size: 12px;
}

.debug-item {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.debug-item strong {
    color: #555;
}

.debug-item span {
    font-family: monospace;
    color: #333;
}

.node-states-summary {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.node-states-summary h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #555;
}

.states-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.state-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

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

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

.simulation-controls {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.simulation-controls button {
    flex: 1;
}

/* AI Reasoning Styles - Used by AI Reasoning History */

.reasoning-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.reasoning-item {
    font-size: 14px;
}

.reasoning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.reasoning-node-id {
    font-weight: 600;
    color: #2c3e50;
    font-size: 13px;
}

.reasoning-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
    font-weight: 500;
}

.reasoning-status.pending {
    background: #fff3cd;
    color: #856404;
}

.reasoning-status.not_answered {
    background: #f8d7da;
    color: #721c24;
}

.reasoning-status.answered {
    background: #d4edda;
    color: #155724;
}

.reasoning-text {
    line-height: 1.6;
    color: #444;
}

/* AI Reasoning History Section */
.ai-reasoning-history-section {
    background: #f0f4f8;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border: 1px solid #d4e0ec;
}

.ai-reasoning-history-section.collapsible {
    padding: 0;
    overflow: visible !important; /* Allow content to be visible */
}

.ai-reasoning-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    user-select: none;
}

.ai-reasoning-history-section .section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.history-count {
    color: #666;
    font-weight: normal;
    font-size: 14px;
}

.history-content {
    padding: 0 15px 15px 15px;
    display: block !important; /* Ensure visibility */
}

/* When history content is shown */
.ai-reasoning-history-section .history-content.collapsible-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.history-controls {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-search {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.clear-search-btn {
    padding: 4px 8px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.clear-search-btn:hover {
    background: #e0e0e0;
}

.history-items {
    height: 300px; /* Fixed height for consistent scrolling */
    overflow-y: auto; /* Show scrollbar when needed */
    overflow-x: hidden;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
    position: relative;
    display: block !important; /* Force display */
}

/* Ensure items inside are properly styled */
.history-items:empty::after {
    content: "Nenhum histórico de análise disponível ainda...";
    display: block;
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.history-item {
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

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

.history-item.current-item {
    background: #fffce0;
}

.history-item-header {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.history-item-header:hover {
    background: #f5f5f5;
}

.history-item.current-item .history-item-header:hover {
    background: #fff9c4;
}

.history-item-header .toggle-icon {
    color: #666;
    font-size: 10px;
    width: 12px;
}

.history-item-header .node-id {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.history-item-header .node-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.node-status.answered {
    background: #d4edda;
    color: #155724;
}

.node-status.not-answered {
    background: #f8d7da;
    color: #721c24;
}

.node-status.pending {
    background: #fff3cd;
    color: #856404;
}

.current-indicator {
    color: #ff9800;
    margin-left: auto;
}

.history-item-header .timestamp {
    color: #666;
    font-size: 12px;
    margin-left: auto;
}

.history-item-content {
    padding: 0 12px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.history-item-content.expanded {
    max-height: 400px;
    padding: 8px 12px 12px 12px;
    overflow-y: auto;
}

.user-answer {
    background: #e3f2fd;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
}

.history-item-content .reasoning-text {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-line; /* Changed from pre-wrap to pre-line to collapse multiple spaces */
    word-wrap: break-word;
    margin-bottom: 8px;
}

.copy-reasoning-btn {
    font-size: 12px;
    padding: 4px 10px;
}

.no-results {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* Debug JSON Section */
.debug-json-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.debug-json-section.collapsible {
    padding: 0;
    overflow: hidden;
}

.debug-json-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    user-select: none;
}

.debug-json-section.collapsible h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.toggle-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.toggle-btn:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
}

.collapsible-content {
    padding: 0 15px 15px 15px;
}

.debug-json-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.json-panels {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.json-panel {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.panel-header {
    background: #f5f5f5;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.panel-controls {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 2px 8px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #f0f0f0;
    border-color: #bbb;
}

.json-viewer {
    max-height: 300px;
    overflow: auto;
    padding: 12px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    background: #fafafa;
}

.json-viewer::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.json-viewer::-webkit-scrollbar-track {
    background: #eee;
    border-radius: 3px;
}

.json-viewer::-webkit-scrollbar-thumb {
    background: #aaa;
    border-radius: 3px;
}

.json-viewer::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.json-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.json-formatted, .json-raw {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* JSON Syntax Highlighting */
.json-string {
    color: #c41a16;
}

.json-number {
    color: #1c00cf;
}

.json-boolean {
    color: #0000ff;
}

.json-null {
    color: #808080;
}

.json-key {
    color: #881391;
    font-weight: 600;
}

/* Simulation Visual States */
.node.simulation-answered {
    filter: drop-shadow(0 0 5px #28a745);
}

.node.simulation-pending {
    filter: drop-shadow(0 0 5px #ffc107);
}

.node.simulation-current {
    animation: pulse 1.5s infinite;
}

.node.simulation-current .node-rect {
    stroke: #e74c3c;
    stroke-width: 3;
}

.node.simulation-passed {
    filter: drop-shadow(0 0 5px #28a745);
}

/* Semaphore specific visual when passed */
.node.node-semaphore.simulation-passed .semaphore-light.light-green {
    fill: #28a745 !important;
    animation: semaphoreGreenBlink 1s ease-in-out infinite !important;
}

.node.node-semaphore.simulation-passed .semaphore-light.light-yellow.always-animated {
    animation: none !important;
    fill: #f5f5dc !important; /* Turn off yellow light */
    opacity: 0.3 !important;
}

@keyframes semaphoreGreenBlink {
    0%, 100% {
        fill: #28a745;
        filter: drop-shadow(0 0 5px #28a745);
    }
    50% {
        fill: #5cb85c;
        filter: drop-shadow(0 0 15px #28a745);
    }
}

.node.simulation-blocked {
    filter: drop-shadow(0 0 5px #dc3545);
}

/* Semaphore specific visual when blocked */
.node.node-semaphore.simulation-blocked .semaphore-light.light-red {
    fill: #dc3545 !important;
    animation: semaphoreRedBlink 1s ease-in-out infinite !important;
}

.node.node-semaphore.simulation-blocked .semaphore-light.light-yellow.always-animated {
    animation: none !important;
    fill: #f5f5dc !important; /* Turn off yellow light */
    opacity: 0.3 !important;
}

@keyframes semaphoreRedBlink {
    0%, 100% {
        fill: #dc3545;
        filter: drop-shadow(0 0 5px #dc3545);
    }
    50% {
        fill: #d9534f;
        filter: drop-shadow(0 0 15px #dc3545);
    }
}

.node.simulation-true-path {
    filter: drop-shadow(0 0 5px #28a745);
}

.node.simulation-false-path {
    filter: drop-shadow(0 0 5px #dc3545);
}

.node.simulation-switch-case {
    filter: drop-shadow(0 0 5px #17a2b8);
}

/* Simulation connection highlight */
.connection.simulation-connection-active {
    stroke: #ff0000;
    stroke-width: 3;
    filter: drop-shadow(0 0 3px #ff0000);
    animation: connectionPulse 1s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes pulse {
    0% {
        filter: drop-shadow(0 0 0 rgba(255, 0, 0, 0.8));
    }
    50% {
        filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 0 rgba(255, 0, 0, 0.8));
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.node-icon {
    font-size: 14px;
    font-weight: bold;
    fill: white;
    pointer-events: none;
    user-select: none;
    dominant-baseline: central;
    text-anchor: middle;
}

.node-icon-path {
    stroke: white;
    pointer-events: none;
}

/* Conditioning labels */
.conditioning-label {
    font-size: 11px;
    font-weight: bold;
    fill: #d35400;
    user-select: none;
}

.conditioning-label.label-left {
    fill: #27ae60;
}

.conditioning-label.label-right {
    fill: #e74c3c;
}

/* SwitchCase case labels */
.case-label {
    font-size: 10px;
    font-weight: 700;
    fill: #512e5f;
    user-select: none;
    cursor: default;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8), -1px -1px 2px rgba(255, 255, 255, 0.8);
}

/* Add hover effect for case labels */
.case-label:hover {
    fill: #8e44ad;
    font-weight: 700;
}

/* Style for case label groups */
.node-switchcase g[transform*="translate"] text.case-label {
    transition: all 0.2s ease;
}

/* Add visual separation between labels */
.node-switchcase .case-label {
    letter-spacing: 0.5px;
}

/* Improve readability when node is selected */
.node.selected .case-label {
    fill: #512e5f;
    font-weight: 700;
}

/* Background for case labels */
.case-label-bg {
    fill: rgba(255, 255, 255, 0.9);
    stroke: #d4b5dd;
    stroke-width: 1;
    transition: all 0.2s ease;
}

/* Hover effect for label background */
.case-label-bg:hover {
    fill: #f3e5f5;
    stroke: #9b59b6;
    stroke-width: 2;
}

/* Selected node label background */
.node.selected .case-label-bg {
    fill: #f3e5f5;
    stroke: #8e44ad;
}

.case-count-bg {
    fill: #9b59b6;
    stroke: none;
}

.case-count-text {
    fill: white;
    font-weight: bold;
    user-select: none;
}

/* Semaphore traffic lights */
.semaphore-light {
    stroke: none;
    opacity: 0.3;
}

.semaphore-light.light-red {
    fill: #e74c3c;
}

.semaphore-light.light-yellow {
    fill: #f39c12;
}

/* Always animated yellow light for semaphores */
.semaphore-light.light-yellow.always-animated {
    opacity: 1;
    animation: blink 1.5s infinite;
}

.semaphore-light.light-green {
    fill: #27ae60;
}

/* Preview state for semaphore during flow simulation */

/* Hover effect for semaphore */
.node-semaphore:hover .node-rect {
    stroke: #34495e;
    stroke-width: 3;
}

/* Flow preview highlighting */
.node-semaphore.flow-preview-current .light-yellow {
    opacity: 1;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

.node-text {
    font-size: 13px;
    fill: #333;
    pointer-events: none;
    user-select: none;
}

.node-id {
    font-size: 14px;
    fill: #2c3e50;
    font-weight: bold;
    opacity: 1;
}

.node-text {
    fill: #555;
    font-family: Arial, sans-serif;
    pointer-events: none;
}

.counter-bg {
    fill: #f39c12;
    opacity: 0.9;
}

.counter-text {
    font-size: 11px;
    fill: white;
    font-weight: bold;
    pointer-events: none;
}

/* Editor indicators */
.max-attempts-bg {
    fill: #9b59b6;
    opacity: 0.9;
}

.max-attempts-text {
    fill: white;
    font-weight: bold;
}

.history-window-bg {
    fill: #3498db;
    opacity: 0.9;
}

.history-window-text {
    fill: white;
    font-weight: bold;
}

.context-indicator {
    font-size: 16px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    min-width: 250px;
    max-width: 400px;
}

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

.toast-icon {
    font-size: 20px;
    line-height: 1;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #27ae60;
}

.toast-success .toast-icon {
    color: #27ae60;
}

.toast-error {
    border-left: 4px solid #e74c3c;
}

.toast-error .toast-icon {
    color: #e74c3c;
}

.toast-warning {
    border-left: 4px solid #f39c12;
}

.toast-warning .toast-icon {
    color: #f39c12;
}

.toast-info {
    border-left: 4px solid #3498db;
}

.toast-info .toast-icon {
    color: #3498db;
}

.toast-copy {
    border-left: 4px solid #8e44ad;
}

.toast-copy .toast-icon {
    color: #8e44ad;
}

.toast-cut {
    border-left: 4px solid #e67e22;
}

.toast-cut .toast-icon {
    color: #e67e22;
}

.toast-paste {
    border-left: 4px solid #16a085;
}

.toast-paste .toast-icon {
    color: #16a085;
}

.toast-undo {
    border-left: 4px solid #95a5a6;
}

.toast-undo .toast-icon {
    color: #95a5a6;
}

.toast-redo {
    border-left: 4px solid #7f8c8d;
}

.toast-redo .toast-icon {
    color: #7f8c8d;
}

/* Visual feedback for cut nodes */
.node-cut {
    opacity: 0.5;
}

.node-cut .node-rect {
    stroke-dasharray: 5, 5;
    stroke-width: 2;
}

/* Clipboard indicator on paste button */
.paste-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    min-width: 16px;
    text-align: center;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
    z-index: 10001;
    min-width: 180px;
    font-size: 13px;
}

.context-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.context-menu-item:hover:not(.disabled) {
    background-color: #f0f0f0;
}

.context-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.context-menu-icon {
    font-size: 16px;
    margin-right: 8px;
    width: 20px;
    text-align: center;
}

.context-menu-label {
    flex: 1;
}

.context-menu-shortcut {
    font-size: 11px;
    color: #666;
    margin-left: 20px;
}

.context-menu-separator {
    height: 1px;
    background: #e0e0e0;
    margin: 4px 0;
}

/* Flow Preview Styles */
.preview-info {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 1000;
    width: 400px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
}

.preview-info h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.preview-info .preview-node-type {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 10px;
}

.preview-info .preview-node-text {
    font-size: 16px;
    line-height: 1.5;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    font-style: italic;
}

.preview-info .preview-node-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.preview-info .preview-node-details p {
    margin: 5px 0;
    font-size: 13px;
    color: #555;
}

.preview-conditioning-note {
    font-style: italic;
    color: #e67e22;
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

/* Preview Controls */
.preview-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    gap: 10px;
}

/* Node states during preview */
.node.preview-current .node-rect {
    stroke: #e74c3c;
    stroke-width: 4;
    animation: pulseStroke 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(231, 76, 60, 0.8));
}

.node.preview-next .node-rect {
    stroke: #f39c12;
    stroke-width: 3;
    stroke-dasharray: 5, 5;
    animation: dashMove 1s linear infinite;
}

.node.preview-processed .node-rect {
    opacity: 0.6;
}

@keyframes pulseStroke {
    0% {
        stroke-width: 4;
        filter: drop-shadow(0 0 10px rgba(231, 76, 60, 0.8));
    }
    50% {
        stroke-width: 6;
        filter: drop-shadow(0 0 20px rgba(231, 76, 60, 1));
    }
    100% {
        stroke-width: 4;
        filter: drop-shadow(0 0 10px rgba(231, 76, 60, 0.8));
    }
}

@keyframes dashMove {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -10;
    }
}

.connection {
    fill: none;
    stroke: #95a5a6;
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    marker-end: url(#arrowhead);
    transition: stroke 0.2s, stroke-width 0.2s;
}

.connection:hover {
    stroke: #34495e;
    stroke-width: 3;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-properties {
    max-width: 900px;
    height: 90vh;
    max-height: 90vh;
    padding: 0;
    overflow: hidden;
}

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

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.modal-body .properties-panel {
    max-width: 800px;
    margin: 0 auto;
}

.modal-body .property-section,
.modal-body .property-section-collapsible {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.modal-body .property-group {
    margin-bottom: 1.5rem;
}

.modal-body textarea {
    min-height: 80px;
}

.modal-body .ai-suggest-btn {
    width: 100%;
    margin-top: 1rem;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.export-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.export-output {
    flex: 1;
    min-height: 300px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    overflow-y: auto;
    background-color: #f8f8f8;
    margin-bottom: 1rem;
}

.export-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.state-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.state-not-answered {
    background-color: #95a5a6;
}

.state-answered {
    background-color: #27ae60;
}

.state-pending {
    background-color: #f39c12;
}

/* Loading animation for AI buttons */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Improve button interactions */
button {
    transition: all 0.2s;
}

button:active {
    transform: translateY(1px);
}

/* Make placeholders more helpful */
::placeholder {
    color: #adb5bd;
    font-style: italic;
}

/* Improve scrollbar in sidebar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Canvas container with proper scroll */
.canvas-container {
    flex: 1;
    position: relative;
    overflow: auto;
    background-color: #fafafa;
}

/* Pan hint */
.canvas-container:hover .pan-hint {
    opacity: 1;
}

.pan-hint {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

/* Canvas container scrollbar */
.canvas-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.canvas-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.canvas-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 6px;
}

.canvas-container::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.canvas-container::-webkit-scrollbar-corner {
    background: #f1f1f1;
}

/* Simple Properties Styles */
.simple-properties {
    margin-top: 1rem;
}

.simple-properties .property-group {
    margin-bottom: 1rem;
}

.simple-properties label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #34495e;
    display: block;
    margin-bottom: 0.25rem;
}

.property-value {
    font-family: monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    color: #2c3e50;
}

.simple-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.2s;
    font-family: inherit;
    resize: vertical;
}

.simple-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.more-options-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ecf0f1;
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* SwitchCase specific styles */
.cases-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.case-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

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

.case-number {
    font-weight: bold;
    color: #8e44ad;
}

.btn-remove-case {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-remove-case:hover {
    background: #c0392b;
}

.case-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.case-item .property-input {
    margin-bottom: 0.5rem;
}

.case-id {
    font-family: monospace;
}

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

.case-description {
    min-height: 60px;
}

.case-indicators {
    font-size: 0.875rem;
}

/* Server connection status */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 16px;
    font-size: 12px;
    margin-left: 8px;
}

.status-indicator {
    font-size: 10px;
}

/* Tree sync status */
.tree-info {
    display: inline-block;
    margin-left: 20px;
    font-size: 14px;
    color: #666;
    z-index: 10;
}

.sync-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.sync-status.saved {
    background: #d4edda;
    color: #155724;
}

.sync-status.unsaved {
    background: #fff3cd;
    color: #856404;
}

.sync-status.saving {
    background: #cce5ff;
    color: #004085;
    animation: pulse 1s ease-in-out infinite;
}

.sync-status.autosave-enabled {
    background: #e2e3e5;
    color: #383d41;
    font-size: 11px;
    margin-left: 5px;
}

.sync-status.local {
    background: #e7f1ff;
    color: #004085;
}

/* Connection status styles */
.connection-status {
    margin: 16px 0;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.connection-status.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.connection-status.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.connection-status.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Tree list modal styles */
.tree-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modern-search-container {
    flex: 1;
    max-width: 500px;
    margin-right: 16px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-input-wrapper:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-icon {
    padding: 0 12px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}

.modern-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 16px 14px 0;
    font-size: 15px;
    background: transparent;
    color: #374151;
}

.modern-search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.clear-search-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 18px;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.clear-search-btn:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.tree-list-container {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.tree-list-table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

.tree-list-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #e0e0e0;
}

.tree-list-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.tree-list-table th.sortable:hover {
    background: #e9e9e9;
}

.tree-list-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

/* Specific column widths */
.tree-list-table td:nth-child(1) { /* Nome */
    width: 25%;
    min-width: 150px;
    word-break: break-word;
}

.tree-list-table td:nth-child(2) { /* Propósito */
    width: 35%;
    min-width: 200px;
    word-break: break-word;
}

.tree-list-table td:nth-child(3) { /* Criado em */
    width: 20%;
    min-width: 120px;
    white-space: nowrap;
}

.tree-list-table td:nth-child(4) { /* Ações */
    width: 20%;
    min-width: 200px;
}

.tree-list-table tr:hover {
    background: #f9f9f9;
}

.tree-name {
    font-weight: 500;
}

.tree-purpose {
    color: #666;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    cursor: help;
}

.tree-actions {
    text-align: center;
    white-space: nowrap;
    padding: 8px !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* Specific styles for tree list action buttons */
.tree-action-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    min-width: 90px;
    justify-content: center;
    white-space: nowrap;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
}

.tree-action-btn .btn-icon {
    font-size: 14px;
    line-height: 1;
    display: inline-block;
}

.tree-action-btn .btn-text {
    font-weight: 500;
}

/* Ensure primary and danger colors work */
.tree-action-btn.btn-primary {
    background-color: #3498db !important;
    color: white !important;
}

.tree-action-btn.btn-primary:hover {
    background-color: #2980b9 !important;
}

.tree-action-btn.btn-danger {
    background-color: #e74c3c !important;
    color: white !important;
}

.tree-action-btn.btn-danger:hover {
    background-color: #c0392b !important;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.page-info {
    font-size: 14px;
    color: #666;
}

.status-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    display: none;
}

.status-message.status-success {
    background: #d4edda;
    color: #155724;
}

.status-message.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    font-weight: 500;
}

.status-message.status-info {
    background: #d1ecf1;
    color: #0c5460;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* AI Generator Modal Styles */
.ai-generator-section {
    padding: 20px 0;
}

.ai-examples {
    margin: 20px 0;
}

.example-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.example-chip {
    padding: 8px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-chip:hover {
    background: #e0e0e0;
    border-color: #bbb;
    transform: translateY(-1px);
}

.ai-generator-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.ai-preview-section {
    padding: 20px 0;
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
}

.ai-preview-section h3 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.ai-preview-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.preview-field {
    margin-bottom: 15px;
}

.preview-field:last-child {
    margin-bottom: 0;
}

.preview-field strong {
    display: block;
    color: #495057;
    margin-bottom: 5px;
    font-size: 13px;
}

.preview-value {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
}

.preview-config {
    display: flex;
    gap: 20px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.preview-config span {
    font-size: 14px;
    color: #666;
}

.preview-config strong {
    color: #2c3e50;
    font-weight: 600;
    display: inline;
    margin: 0;
}

.ai-preview-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.ai-loading-state {
    text-align: center;
    padding: 60px 20px;
}

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

.loading-message {
    font-size: 16px;
    color: #666;
    font-style: italic;
}

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

/* Success Toast */
.ai-success-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-size: 16px;
    font-weight: 500;
    animation: slideInUp 0.3s ease;
    z-index: 10000;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Environment Selector Styles */
.env-label {
    font-size: 12px;
    color: #bdc3c7;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 0.5rem;
}

.env-selector {
    background: #34495e;
    color: white;
    border: 1px solid #2c3e50;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

.env-selector:hover {
    background: #4a5f7a;
}

.env-selector:focus {
    outline: none;
    border-color: #3498db;
}

.env-indicator {
    font-size: 14px;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-left: 0.5rem;
}

.env-indicator.env-prod {
    background: #e74c3c;
    color: white;
}

.env-indicator.env-sandbox {
    background: #f39c12;
    color: white;
}

.env-indicator.env-dev {
    background: #27ae60;
    color: white;
}

/* Environment Change Notification */
.env-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #34495e;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.env-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Environment selector in debug view */
.env-selector-container {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-left: 1px solid #34495e;
}

/* Modal header controls for simulation modal */
.modal-header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toggle Switch Styles for Wendy Mode */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    transition: background-color 0.3s;
    margin-right: 8px;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background-color: #007bff;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-switch .toggle-label {
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}

/* Toggle switch in toolbar */
.toolbar .toggle-switch .toggle-label {
    color: white;
    font-size: 13px;
}
/* Internal Response Styles */
.node-internal-response {
    stroke: #7b68ee \!important;
    fill: #f0e6ff \!important;
    stroke-width: 2;
}

.internal-response-icon-bg {
    stroke: #7b68ee \!important;
    fill: #8a7fff \!important;
    stroke-width: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.internal-action-label {
    fill: #5a4fcf;
    font-weight: 600;
}

/* Internal Response Properties Panel */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.internal-action-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
}

.json-preview-section {
    margin-top: 1.5rem;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.json-preview-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 14px;
    color: #666;
}

.json-preview {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 4px;
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 12px;
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 0.5rem;
}

.required {
    color: #d32f2f;
    font-weight: bold;
}

.mt-2 {
    margin-top: 0.5rem \!important;
}

/* ============================================
   Dropdown Menu Styles
   ============================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    padding-right: 2rem;
}

.dropdown-arrow {
    position: absolute;
    right: 0.5rem;
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.2s;
}

.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 200px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 5px;
    overflow: hidden;
    animation: dropdown-fade-in 0.2s ease-out;
}

@keyframes dropdown-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
    position: relative;
}

.dropdown-item:hover {
    background-color: #f5f5f5;
}

.dropdown-item:active {
    background-color: #e8e8e8;
}

.dropdown-item-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
}

.dropdown-item-text {
    flex: 1;
}

.dropdown-item-shortcut {
    font-size: 12px;
    color: #888;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 0.5rem;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 0;
}

.dropdown-section {
    padding: 0.5rem 0;
}

.dropdown-section-header {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.5rem 1rem 0.25rem;
}

/* Zoom controls inside dropdown */
.zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    gap: 0.5rem;
}

.zoom-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.zoom-btn:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.zoom-btn:active {
    background: #e8e8e8;
}

.dropdown .zoom-indicator {
    min-width: 50px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}

/* Help icon button in header */
.help-icon-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    margin: 0;
    outline: none;
}

.help-icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.help-icon-btn .help-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Toggle switch in dropdown */
.dropdown-toggle-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 1rem;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s;
}

.dropdown-toggle-item:hover {
    background-color: #f5f5f5;
}

.dropdown-toggle-item input[type="checkbox"] {
    display: none;
}

.toggle-slider-small {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    background-color: #ccc;
    border-radius: 18px;
    transition: background-color 0.3s;
    margin-right: 0.75rem;
}

.toggle-slider-small::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.dropdown-toggle-item input[type="checkbox"]:checked + .toggle-slider-small {
    background-color: #007bff;
}

.dropdown-toggle-item input[type="checkbox"]:checked + .toggle-slider-small::after {
    transform: translateX(18px);
}

/* Toolbar groups visual improvements */
.toolbar-group-primary {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 6px;
}

/* Header adjustments for help button */
.header {
    position: relative;
}

.header h1 {
    margin-right: 50px; /* Space for help button */
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet view (max-width: 1200px) */
@media (max-width: 1200px) {
    .header h1 {
        font-size: 1.25rem;
    }
    
    .btn-text {
        display: none;
    }
    
    .toolbar-label {
        display: none;
    }
    
    .toggle-label {
        display: none;
    }
    
    .dropdown-toggle {
        padding: 0.4rem 1.5rem 0.4rem 0.6rem;
    }
    
    .toolbar {
        gap: 0.25rem;
    }
    
    .toolbar-separator {
        margin: 0 0.25rem;
    }
}

/* Mobile view (max-width: 768px) */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem;
    }
    
    .header h1 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .toolbar-group {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .toolbar-separator {
        display: none;
    }
    
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
        animation: mobile-slide-up 0.3s ease-out;
    }
    
    @keyframes mobile-slide-up {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .dropdown-item {
        padding: 1rem;
        font-size: 16px;
    }
    
    .sidebar {
        display: none;
    }
    
    .main {
        grid-template-columns: 1fr;
    }
    
    /* Mobile-specific toolbar adjustments */
    .env-selector {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .shortcut-btn {
        min-width: 38px;
        height: 38px;
    }
    
    .shortcut-icon {
        font-size: 16px;
    }
    
    .shortcut-key {
        display: none;
    }
}

/* Small mobile view (max-width: 480px) */
@media (max-width: 480px) {
    .toolbar-group {
        gap: 0.25rem;
    }
    
    .btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .dropdown-toggle {
        padding: 0.3rem 1.2rem 0.3rem 0.5rem;
    }
}

/* ============================================
   Wendy Prompt Management Styles
   ============================================ */

/* Wendy Tabs Navigation */
.wendy-tabs {
    display: flex;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

.wendy-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wendy-tab:hover {
    background: rgba(255, 255, 255, 0.7);
    color: #333;
}

.wendy-tab.active {
    background: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wendy-tab-mae.active {
    border-left: 3px solid #4CAF50;
}

.wendy-tab-avo.active {
    border-left: 3px solid #9C27B0;
}

.wendy-tab .tab-icon {
    font-size: 16px;
}

.wendy-tab .tab-label {
    font-size: 12px;
    font-weight: 400;
    color: #888;
}

.wendy-tab.active .tab-label {
    color: #666;
}

/* Wendy Modal Structure */
.wendy-view {
    display: block;
}

.wendy-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
}

.wendy-list-container {
    min-height: 400px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
}

/* Wendy Prompt Table */
.wendy-prompt-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wendy-prompt-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #2c3e50;
}

.wendy-prompt-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.wendy-prompt-table tr:hover {
    background: #f9f9f9;
}

.wendy-prompt-table tr:last-child td {
    border-bottom: none;
}

/* Column specific styles */
.prompt-name {
    font-weight: 500;
    color: #2c3e50;
}

.prompt-status {
    font-size: 14px;
}

.active-indicator {
    color: #27ae60;
    font-weight: 600;
}

.inactive-indicator {
    color: #bdc3c7;
}

.prompt-actions {
    text-align: right;
    white-space: nowrap;
}

/* Small buttons for table actions */
.btn-sm {
    padding: 4px 10px !important;
    font-size: 12px !important;
    margin-left: 4px;
}

/* Wendy Form Styles */
.wendy-form {
    max-width: 800px;
    margin: 0 auto;
}

.wendy-form .property-group {
    margin-bottom: 1.5rem;
}

.wendy-form .form-textarea {
    font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
    font-size: 13px;
    line-height: 1.5;
}

.wendy-form .form-range {
    width: 100%;
    cursor: pointer;
}

/* Temperature range slider */
.wendy-form input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    margin: 10px 0;
}

.wendy-form input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.wendy-form input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
}

.wendy-form input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

.wendy-form input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
}

/* Form actions */
.form-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}


/* Success button variant */
.btn-success {
    background-color: #27ae60;
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-success:active {
    background-color: #1e8449;
}

/* Help text for form fields */
.help-text {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Responsive adjustments for Wendy modal */
@media (max-width: 768px) {
    .wendy-tabs {
        flex-direction: column;
        gap: 2px;
    }

    .wendy-tab {
        padding: 10px 12px;
        font-size: 13px;
    }

    .wendy-tab .tab-label {
        display: none; /* Hide labels on mobile */
    }

    .wendy-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .wendy-controls .search-container {
        width: 100%;
    }

    .wendy-controls .btn {
        width: 100%;
    }

    .wendy-prompt-table {
        font-size: 14px;
    }

    .wendy-prompt-table th,
    .wendy-prompt-table td {
        padding: 8px;
    }

    .prompt-actions {
        text-align: left;
    }

    .prompt-actions .btn-sm {
        display: block;
        width: 100%;
        margin: 4px 0;
    }
}

/* Reasoning Models Styles */
.reasoning-section {
    background-color: #fff9e6;
    border: 1px solid #ffcc00;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.reasoning-section h4 {
    margin: 0 0 16px 0;
    color: #cc8800;
    font-size: 16px;
}

.reasoning-warning {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #cc0000;
}

.reasoning-badge {
    background: #ff6b6b;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
    font-weight: 500;
    text-transform: uppercase;
}

/* Disabled temperature field for reasoning models */
#wendyTemperature:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#wendyTemperature:disabled + .help-text {
    color: #cc8800;
    font-style: italic;
}


/* Tab Navigation Styles */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background-color: #f8f9fa;
    padding: 0 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.tab-button.active {
    color: #3498db;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #3498db;
}

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

.tab-panel {
    display: none;
    height: 100%;
    overflow: hidden; /* Prevent panel expansion */
    flex: 1; /* Fill available space */
}

.tab-panel.active {
    display: flex; /* Use flex layout for proper height distribution */
    flex-direction: column;
}

/* Execution History Layout */
.execution-history-layout {
    display: flex;
    gap: 20px;
    height: 100%;
}

.execution-sidebar {
    width: 350px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.execution-filters {
    padding: 1rem;
    background: #e9ecef;
    border-bottom: 1px solid #dee2e6;
}

.execution-filters h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #495057;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.execution-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.execution-list-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.execution-count {
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #6c757d;
}

.execution-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.execution-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.execution-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.execution-item.selected {
    border-color: #3498db;
    background-color: #e3f2fd;
}

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

.execution-item-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.execution-item-info {
    font-size: 0.8rem;
    color: #6c757d;
}

.execution-details-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    overflow-y: auto;
}

.execution-info-header {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.execution-info-header h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.execution-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.info-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.execution-timeline-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.execution-timeline-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.execution-timeline {
    max-height: 300px;
    overflow-y: auto;
}

.timeline-item {
    background: #f8f9fa;
    border-left: 3px solid #dee2e6;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.timeline-item:hover {
    background: #e9ecef;
    transform: translateX(3px);
}

.timeline-item.current {
    border-left-color: #ffc107;
    background: #fffaf0;
}

.timeline-item.completed {
    border-left-color: #28a745;
}

.timeline-item.error {
    border-left-color: #dc3545;
}

.timeline-item.selected {
    box-shadow: 0 0 0 2px #007bff;
}

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

.timeline-number {
    font-weight: bold;
    color: #495057;
}

.timeline-message-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: #6c757d;
}

.timeline-node-info {
    margin-bottom: 0.5rem;
}

.timeline-node-id {
    font-weight: 500;
    color: #2c3e50;
    margin-right: 0.5rem;
}

.timeline-response-node {
    font-size: 0.85rem;
    color: #6c757d;
}

.timeline-user-message,
.timeline-bot-response {
    background: white;
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #e9ecef;
}

.timeline-user-message strong,
.timeline-bot-response strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.timeline-status {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.can-pass-badge,
.has-pending-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    background: #e3f2fd;
    color: #1976d2;
}

.has-pending-badge {
    background: #fff3cd;
    color: #856404;
}

.execution-history-redirect {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
}

.redirect-content {
    text-align: center;
    max-width: 500px;
}

.redirect-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.redirect-content h2 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.redirect-content p {
    margin-bottom: 1.5rem;
    color: #6c757d;
    line-height: 1.6;
}

.btn-large {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.redirect-note {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #868e96;
}

.timeline-time {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.timeline-node-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: #e9ecef;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.timeline-node-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.timeline-node-status {
    font-size: 0.85rem;
    color: #495057;
}

.execution-ai-history-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.execution-ai-history-section h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.error-state {
    padding: 2rem;
    text-align: center;
    color: #dc3545;
    font-style: italic;
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* State badges */
.state-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.state-active {
    background: #ffc107;
    color: #856404;
}

.state-completed {
    background: #28a745;
    color: white;
}

.state-failed {
    background: #dc3545;
    color: white;
}

.state-answered {
    background: #28a745;
    color: white;
}

.state-pending {
    background: #ffc107;
    color: #856404;
}

.state-not-answered {
    background: #6c757d;
    color: white;
}

/* History search */
.history-search {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* User answer in history */
.user-answer {
    background: #e3f2fd;
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
/* Wendy Debug Panel - Complete UX Redesign */

/* Header Card */
.wendy-header-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

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

.wendy-main-title {
    margin: 0;
    font-size: 1.2rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wendy-model-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #e3f2fd;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.model-icon {
    font-size: 1rem;
}

.model-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1976d2;
    font-family: monospace;
}

/* Comparison Card */
.wendy-comparison-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.wendy-comparison-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: stretch;
}

.wendy-response-section {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.wendy-response-header {
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid;
}

.wendy-response-header.technical {
    background-color: #fff8e1;
    border-bottom-color: #ffc107;
}

.wendy-response-header.humanized {
    background-color: #e8f5e9;
    border-bottom-color: #28a745;
}

.response-type {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.response-origin {
    font-size: 0.75rem;
    color: #6c757d;
    background: rgba(255,255,255,0.7);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
}

.wendy-response-body {
    padding: 1.25rem;
}

.wendy-message-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #2c3e50;
}

/* Transformation Arrow */
.wendy-transformation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.transformation-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.transformation-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #28a745;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Reasoning Card */
.wendy-reasoning-card {
    background: #f0f7ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #d1e7ff;
}

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

.reasoning-emoji {
    font-size: 1.5rem;
}

.reasoning-title {
    margin: 0;
    font-size: 1rem;
    color: #1976d2;
    font-weight: 600;
}

.wendy-reasoning-body {
    padding-left: 2.25rem;
}

.reasoning-text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #495057;
}

/* Technical Details Section */
.wendy-details-section {
    margin-top: 2rem;
}

.wendy-detail-block {
    background: white;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.wendy-detail-summary {
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafbfc;
    transition: background-color 0.2s;
    user-select: none;
}

.wendy-detail-summary:hover {
    background: #f5f7fa;
}

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

.detail-emoji {
    font-size: 1.125rem;
}

.detail-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #495057;
}

.detail-chevron {
    font-size: 1.25rem;
    color: #6c757d;
    transition: transform 0.2s;
    font-weight: 300;
}

details[open] .detail-chevron {
    transform: rotate(90deg);
}

.wendy-detail-body {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid #e9ecef;
}

.wendy-code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #495057;
    white-space: pre-wrap;
    word-break: break-word;
}

.wendy-system-prompt {
    max-height: 400px;
    overflow-y: auto;
}

/* Scrollbar for system prompt */
.wendy-system-prompt::-webkit-scrollbar {
    width: 8px;
}

.wendy-system-prompt::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.wendy-system-prompt::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.wendy-system-prompt::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wendy-comparison-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .wendy-transformation {
        padding: 1rem 0;
    }
    
    .transformation-icon svg {
        transform: rotate(90deg);
    }
    
    .wendy-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .wendy-reasoning-body {
        padding-left: 0;
    }
}

/* Empty State */
.wendy-empty {
    text-align: center;
    color: #6c757d;
    padding: 3rem 2rem;
    font-style: italic;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Timeline Indicator */
.timeline-item.has-wendy {
    position: relative;
}

.wendy-indicator {
    font-size: 14px;
    margin-left: 8px;
    opacity: 0.7;
}

/* Media queries for AI Reasoning History in small screens */
@media (max-height: 900px) {
    .history-items {
        height: 250px !important; /* Slightly reduced for medium screens */
    }
}

@media (max-height: 768px) {
    .history-items {
        height: 200px !important; /* Fixed height for smaller screens */
    }
    
    /* Ensure the AI reasoning section doesn't overflow */
    .simulation-config-panel {
        max-height: calc(100vh - 200px); /* Account for modal header and controls */
        overflow-y: auto !important;
    }
    
    /* Make the config wrapper more flexible */
    .simulation-config-wrapper {
        max-height: calc(100vh - 150px);
        overflow-y: auto !important;
    }
}

@media (max-height: 600px) {
    .history-items {
        height: 150px !important; /* Fixed height for very small screens */
    }
    
    /* Make the config panel more compact */
    .ai-reasoning-history-section {
        margin-top: 10px;
    }
    
    .ai-reasoning-history-section .section-header {
        padding: 10px;
    }
    
    .history-content {
        padding: 0 10px 10px 10px;
    }
    
    /* Reduce padding in simulation layout for small screens */
    .simulation-layout {
        gap: 10px;
    }
    
    .simulation-config-panel {
        gap: 10px;
        padding: 10px;
    }
}

/* Ensure AI Reasoning History is scrollable when expanded */
.ai-reasoning-history-section.collapsible .history-content {
    display: block !important; /* Ensure it's visible when expanded */
}

/* Make sure the history placeholder doesn't interfere with scroll */
.history-placeholder {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    min-height: 60px; /* Ensure some minimum height */
}

/* Force history items to be scrollable */
.history-items .history-item {
    flex-shrink: 0; /* Prevent items from shrinking */
}

/* Ensure the section is properly sized on small screens */
@media (max-height: 768px) {
    .ai-reasoning-history-section {
        max-height: 60vh; /* Limit the section height */
    }
}

/* Add scrollbar styling for history content */
.history-content::-webkit-scrollbar,
.history-items::-webkit-scrollbar {
    width: 6px;
}

.history-content::-webkit-scrollbar-track,
.history-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.history-content::-webkit-scrollbar-thumb,
.history-items::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.history-content::-webkit-scrollbar-thumb:hover,
.history-items::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===================== Deployment Modal Styles ===================== */

.deployment-modal {
    z-index: 10000;
}

.deployment-modal .modal-content {
    width: 800px;
    max-width: 95vw;
    max-height: 90vh;
    position: relative;
    z-index: 10001;
    overflow-y: auto;
}

.deployment-modal .tree-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.deployment-modal .tree-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.deployment-modal .tree-id {
    font-size: 0.85rem;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.deployment-modal .deployment-status {
    margin-bottom: 1.5rem;
}

.deployment-modal .deployment-status h3 {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 1rem;
}

.deployment-modal .status-content {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    min-height: 80px;
}

.deployment-modal .loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.deployment-modal .current-deployment {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.deployment-modal .current-deployment.is-current {
    background: #e7f5ff;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #74c0fc;
}

.deployment-modal .status-indicator {
    font-size: 1rem;
    font-weight: 600;
}

.deployment-modal .status-indicator.active {
    color: #28a745;
}

.deployment-modal .status-indicator.inactive {
    color: #6c757d;
}

.deployment-modal .deployment-details {
    flex: 1;
}

.deployment-modal .deployment-tree-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.deployment-modal .deployment-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.deployment-modal .current-indicator {
    color: #0066cc;
    font-weight: 500;
    margin-top: 0.5rem;
}

.deployment-modal .no-deployment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
}

.deployment-modal .deployment-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.deployment-modal .deployment-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 1rem;
    color: #856404;
}

.deployment-modal .deployment-warning p {
    margin: 0;
    line-height: 1.5;
}

.deployment-modal .error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 1rem;
    color: #721c24;
}

.deployment-modal .error-details {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Deployment Badge in Toolbar */
.deployment-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: pulse 2s infinite;
}

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

/* Button Styles for Deployment Modal */
.deployment-modal .btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    min-width: 150px;
    justify-content: center;
}

.deployment-modal .btn-primary {
    background: #007bff;
    color: white;
}

.deployment-modal .btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.deployment-modal .btn-danger {
    background: #dc3545;
    color: white;
}

.deployment-modal .btn-danger:hover:not(:disabled) {
    background: #c82333;
}

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

.deployment-modal .btn-secondary:hover {
    background: #5a6268;
}

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

.deployment-modal .btn-icon {
    font-size: 1.1rem;
}

/* Status Selection Dropdown */
.deployment-modal .status-selection {
    margin-bottom: 1.5rem;
}

.deployment-modal .status-selection h3 {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 1rem;
}

.deployment-modal .status-dropdown {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.deployment-modal .status-dropdown:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.deployment-modal .variant-select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.deployment-modal .variant-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Deployment Actions at Top */
.deployment-modal .deployment-actions {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* All Deployments Section */
.deployment-modal .all-deployments {
    margin-bottom: 1.5rem;
}

.deployment-modal .all-deployments h3 {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 1rem;
}

.deployment-modal .all-deployments-content {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Deployments Grid */
.deployments-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

/* Deployment Card */
.deployment-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.deployment-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.deployment-card.is-current {
    background: #e7f5ff;
    border-color: #74c0fc;
    box-shadow: 0 0 0 2px rgba(116, 192, 252, 0.2);
}

.deployment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.deployment-status {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.deployment-body {
    color: #495057;
}

.deployment-body .deployment-tree-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.deployment-body .deployment-date {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.deployment-body .current-indicator {
    font-size: 0.85rem;
    color: #28a745;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* No Deployments State */
.no-deployments {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

/* Node Search Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 9999;
    padding-top: 10vh;
}

.search-container {
    background: white;
    border-radius: 12px;
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.search-header input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.search-header input:focus {
    border-color: #3498db;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    margin-left: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e9ecef;
}

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

.search-result-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.search-result-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

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

.result-id {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #2c3e50;
    font-size: 14px;
}

.result-type {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

.result-text {
    color: #495057;
    margin-bottom: 6px;
    line-height: 1.4;
}

.result-matches {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.search-info {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 14px;
    text-align: center;
}