/* Function Execute Modal Styles */
.function-execute-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.function-execute-section {
    margin-bottom: 20px;
}

/* Function Info Section */
.function-execute-function-info {
    margin-bottom: 25px;
    padding: 15px;
    background: var(--secondary-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.function-execute-function-info h3 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.function-execute-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.function-execute-function-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg, var(--background));
    color: var(--text-color);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.function-execute-function-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.function-execute-function-select option {
    padding: 8px;
    font-family: 'Courier New', monospace;
}

.function-execute-description {
    color: var(--text-color-secondary);
    font-size: 14px;
    line-height: 1.4;
    margin-top: 8px;
    padding: 8px;
    background: var(--secondary-bg, rgba(0, 0, 0, 0.05));
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

/* Parameters Section */
.function-execute-parameters {
    margin-bottom: 25px;
}

.function-execute-parameters h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 16px;
}

.function-execute-parameters-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.function-parameter-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.function-parameter-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.function-parameter-type {
    font-size: 12px;
    color: var(--text-color-secondary);
    font-style: italic;
}

.function-parameter-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg, var(--background));
    color: var(--text-color);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    transition: border-color 0.2s;
}

.function-parameter-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.function-parameter-field::placeholder {
    color: var(--text-color-muted, #999);
    font-style: italic;
}

/* No parameters message */
.function-execute-no-params {
    color: var(--text-color-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 6px;
}

/* Execute Actions */
.function-execute-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px;
    background: var(--secondary-bg);
    border-radius: 8px;
}

.btn.execute-btn {
    background: var(--success-color, #28a745);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
}

.btn.execute-btn:hover {
    background: var(--success-color-hover, #218838);
}

.btn.execute-btn:disabled {
    background: var(--text-color-muted, #999);
    cursor: not-allowed;
}

.btn.execute-btn.executing {
    background: var(--danger-color, #dc3545);
}

.btn.execute-btn.executing:hover {
    background: var(--danger-color-hover, #c82333);
}

.function-execute-timing {
    color: var(--text-color-secondary);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    flex-grow: 1;
    text-align: right;
}

/* Output Section */
.function-execute-output {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.function-execute-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
}

.function-execute-output-header h4 {
    margin: 0;
    color: var(--text-color);
    font-size: 14px;
}

.function-execute-output-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn.small-btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.function-execute-output-value {
    position: relative;
    background: var(--background);
}

.function-execute-output-value pre {
    margin: 0;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Error Section */
.function-execute-error {
    border: 1px solid var(--danger-color, #dc3545);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.function-execute-error h4 {
    margin: 0;
    padding: 12px 15px;
    background: var(--danger-color, #dc3545);
    color: white;
    font-size: 14px;
}

.function-execute-error-content {
    position: relative;
    background: var(--background);
}

.function-execute-error-content pre {
    margin: 0;
    padding: 15px;
    background: transparent;
    border: none;
    color: var(--danger-color, #dc3545);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

/* Copy buttons in output/error sections */
.function-execute-output-value .copy-btn,
.function-execute-error-content .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 13.8px; /* 15% larger than 12px */
    cursor: pointer;
    color: var(--text-color-secondary);
    transition: all 0.2s;
}

.function-execute-output-value .copy-btn:hover,
.function-execute-error-content .copy-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Animation for executing state */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.function-execute-run-btn.executing #function-execute-run-icon {
    animation: spin 1s linear infinite;
}

/* Center the play icon vertically with the text */
#function-execute-run-icon {
    vertical-align: -0.1em; /* Slightly lower than baseline to center with text */
}

/* Adjust Execute text vertical alignment */
#function-execute-run-text {
    vertical-align: 0.05em; /* Slightly higher to better center with icon */
}

/* Responsive design */
@media (max-width: 768px) {
    .function-execute-container {
        padding: 15px;
    }
    
    .function-execute-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .function-execute-timing {
        text-align: center;
    }
    
    .function-execute-output-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .function-execute-output-controls {
        justify-content: center;
    }
}