/* --- CSS Variables and Reset --- */
:root {
    --ui-scale: 1rem;     
    --font-scale: 1rem;    
    --border-radius: 0.5rem; 
    --text-color: #333;
    --primary-color: #1a6887;
    --light-gray: #f0f2f5;
    --border-color: #d9d9d9;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-gray);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-scale);
}

.container {
    display: flex;
    width: 95vw;
    height: 95vh;
    background-color: #ffffff;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: calc(0.1 * var(--ui-scale)) solid var(--border-color);
    border-radius: var(--border-radius);
}

.panel {
    display: flex;
    flex-direction: column;
    padding: calc(2 * var(--ui-scale));
    overflow-y: auto;
}

.left-panel {
    flex: 1 1 50%;
    border-right: calc(0.1 * var(--ui-scale)) solid var(--border-color);
    background-color: #fafafa;
    padding-right: calc(3 * var(--ui-scale));
}

.right-panel {
    flex: 1 1 50%;
    background-color: #2b2b2b;
    color: #f0f0f0;
    padding: calc(2 * var(--ui-scale));
    padding-left: calc(3 * var(--ui-scale));
}

.control-group {
    margin-bottom: calc(1.5 * var(--ui-scale));
}

.control-group h2 {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: calc(1 * var(--ui-scale));
    color: #1a1a1a;
}

hr {
    border: none;
    border-top: calc(0.1 * var(--ui-scale)) solid #e0e0e0;
    margin: calc(2 * var(--ui-scale)) 0;
}

label {
    font-size: 1em;
    font-weight: 500;
    color: var(--text-color);
}

.file-input-group {
    display: flex;
    align-items: center;
    gap: var(--ui-scale);
}

input[type="text"], select {
    width: 100%;
    padding: calc(0.8 * var(--ui-scale)) calc(1.2 * var(--ui-scale));
    border: calc(0.1 * var(--ui-scale)) solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1em; /* Inherits from body */
    background-color: #fff;
    height: calc(4.5 * var(--ui-scale));
}

.browse-btn, .help-btn {
    flex-shrink: 0;
    padding: 0 calc(2 * var(--ui-scale));
    border: calc(0.1 * var(--ui-scale)) solid #ccc;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease;
    background-color: #f5f5f5;
    color: var(--text-color);
    height: calc(4.5 * var(--ui-scale));
}

.browse-btn:hover, .help-btn:hover {
    background-color: #e9e9e9;
}

.radio-group {
    margin-top: calc(1.5 * var(--ui-scale));
    display: flex;
    flex-direction: column;
    gap: var(--ui-scale);
}

.radio-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

input[type="radio"], input[type="checkbox"] {
    margin-right: var(--ui-scale);
    width: calc(1.4 * var(--font-scale));
    height: calc(1.4 * var(--font-scale));
    accent-color: var(--primary-color);
}

.horizontal-group {
    display: flex;
    flex-wrap: wrap;
    gap: calc(2.5 * var(--ui-scale));
    align-items: flex-end;
}

.sub-group {
    flex: 1;
    min-width: calc(15 * var(--ui-scale));
}

.sub-group label {
    display: block;
    margin-bottom: var(--ui-scale);
    font-size: 1.2em;
    font-weight: 600;
    color: #1a1a1a;
}

.options-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: calc(2.5 * var(--ui-scale));
    margin-bottom: calc(1.5 * var(--ui-scale));
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: var(--ui-scale);
}

.help-btn {
    flex-shrink: 0;
    width: 100%; 
}

.help-button-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ui-scale);
    flex-shrink: 0; 
    width: 35%;
}

/* --- Run Button --- */
.run-btn {
    margin-top: auto;
    margin-bottom: calc(1.5 * var(--ui-scale));
    width: 100%;
    height: calc(7 * var(--ui-scale));
    padding: 0 calc(1.5 * var(--ui-scale));
    font-size: 1.2em;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.run-btn:hover {
    background-color: #0979a1;
}

.run-btn:disabled {
    background-color: #1388b3;
    cursor: not-allowed;
}

/* --- Console --- */
.console-output {
    flex-grow: 1;
    background-color: #2b2b2b;
    color: #dcdcdc;
    border-radius: calc(0.4 * var(--ui-scale));
    overflow-y: auto;
    font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    height: 100%;
}

.console-output pre {
    padding: var(--ui-scale);
    white-space: pre-wrap;
    word-wrap: break-word;
}