/* Enhanced Execution Flow Styling */

/* Container styling */
.execution-flow {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.execution-flow h3 {
    margin: 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
}

.flow-container {
    display: flex;
    width: 100%;
    height: 500px; /* Increased height for better visibility */
}

/* Steps sidebar */
.flow-steps {
    flex: 0 0 200px;
    overflow-y: auto;
    border-right: 1px solid #ddd;
    background-color: #f8f8f8;
}

.flow-step {
    padding: 15px;
    margin: 0;
    border-left: 3px solid #ccc;
    border-bottom: 1px solid #e0e0e0;
    background-color: #f8f8f8;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
}

.flow-step:hover {
    background-color: #f0f0f0;
}

.flow-step.active {
    border-left-color: #4CAF50;
    background-color: #e8f5e9;
    font-weight: bold;
}

.flow-step .step-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    background-color: #ddd;
    color: #333;
    margin-right: 8px;
    font-weight: bold;
}

.flow-step.active .step-number {
    background-color: #4CAF50;
    color: white;
}

.flow-step .status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 5px;
    background-color: #ccc;
}

.flow-step .status-indicator.complete {
    background-color: #4CAF50;
}

.flow-step .status-indicator.in-progress {
    background-color: #2196F3;
}

.flow-step .status-indicator.error {
    background-color: #f44336;
}

/* Results panel */
.flow-results {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.flow-result {
    display: none;
    padding: 15px;
    overflow: auto;
    background-color: #fff;
    height: 100%;
}

.flow-result.active {
    display: block;
}

/* Step visualization */
.step-visualization {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.step-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.step-header h4 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.step-content-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex: 1;
    min-height: 0; /* Fix for Firefox */
}

.step-input-panel, 
.step-output-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.panel-header {
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.panel-content {
    padding: 15px;
    overflow: auto;
    flex: 1;
    background-color: #fff;
}

/* Parsing step specific styling */
.query-text {
    font-style: italic;
    padding: 10px;
    background-color: #f9f9f9;
    border-left: 3px solid #4CAF50;
    margin-bottom: 10px;
    border-radius: 4px;
}

.intent-chip {
    display: inline-block;
    padding: 5px 10px;
    background-color: #e8f5e9;
    border: 1px solid #4CAF50;
    border-radius: 16px;
    font-weight: bold;
    color: #2e7d32;
}

.confidence-meter {
    display: inline-block;
    position: relative;
    width: 100px;
    height: 10px;
    background-color: #f5f5f5;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 10px;
    vertical-align: middle;
}

.confidence-meter::after {
    content: '';
    position: absolute;
    height: 100%;
    width: var(--confidence);
    background-color: #4CAF50;
    left: 0;
    top: 0;
    border-radius: 5px;
}

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

.entity-item {
    display: flex;
    margin-bottom: 5px;
    padding: 5px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.entity-name {
    flex: 0 0 120px;
    font-weight: bold;
    color: #333;
}

.entity-value {
    flex: 1;
    word-break: break-word;
}

.no-entities {
    font-style: italic;
    color: #666;
}

/* Planning step specific styling */
.plan-step {
    display: flex;
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #2196F3;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background-color: #2196F3;
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    font-weight: bold;
}

.step-details {
    flex: 1;
}

.step-method {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    margin-right: 8px;
    font-size: 12px;
}

.method-get { background-color: #61affe; }
.method-post { background-color: #49cc90; }
.method-put { background-color: #fca130; }
.method-delete { background-color: #f93e3e; }
.method-patch { background-color: #50e3c2; }

.step-endpoint {
    font-weight: bold;
    margin-bottom: 5px;
}

.step-parameters {
    margin-top: 10px;
}

.parameters-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.parameters-json {
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
}

.no-steps {
    font-style: italic;
    color: #666;
    padding: 10px 0;
}

/* Execution step specific styling */
.execution-calls-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.execution-call {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.call-header {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
}

.call-header.status-success {
    background-color: #e8f5e9;
}

.call-header.status-error {
    background-color: #ffebee;
}

.call-method {
    flex: 0 0 60px;
    font-weight: bold;
}

.call-url {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-status {
    flex: 0 0 80px;
    text-align: right;
    font-weight: bold;
}

.status-code-200 { color: #2e7d32; }
.status-code-201 { color: #2e7d32; }
.status-code-400 { color: #d32f2f; }
.status-code-401 { color: #d32f2f; }
.status-code-403 { color: #d32f2f; }
.status-code-404 { color: #d32f2f; }
.status-code-500 { color: #d32f2f; }

.call-details {
    padding: 10px;
}

.call-request, .call-response {
    margin-bottom: 10px;
}

.section-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.request-params, .response-data {
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 13px;
}

.no-calls {
    font-style: italic;
    color: #666;
    padding: 10px 0;
}

/* Response step specific styling */
.input-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-item {
    display: flex;
}

.summary-label {
    flex: 0 0 100px;
    font-weight: bold;
    color: #555;
}

.summary-value {
    flex: 1;
}

.key-fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.key-field-item {
    display: flex;
    padding: 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 3px solid #2196F3;
}

.key-field-name {
    flex: 0 0 120px;
    font-weight: bold;
    color: #333;
}

.key-field-value {
    flex: 1;
}

.boolean-value {
    font-weight: bold;
}

.boolean-value.true {
    color: #2e7d32;
}

.boolean-value.false {
    color: #d32f2f;
}

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

.full-results {
    margin-top: 20px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.results-json {
    max-height: 300px;
    overflow: auto;
    margin: 0;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

/* JSON syntax highlighting */
.string { color: #0a3069; }
.number { color: #116329; }
.boolean { color: #cf222e; }
.null { color: #953800; }
.key { color: #8250df; font-weight: bold; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-content-container {
        flex-direction: column;
    }
    
    .step-input-panel, .step-output-panel {
        flex: none;
        height: auto;
    }
    
    .flow-container {
        height: 700px;
    }
}
