/* Terminal Window Styles */
body {
    --terminal-bg: #1a1a1a;
    --terminal-header-bg: #333;
    --terminal-text: #00ff41;
    --prompt-user: #4d94ff;
    /* Changed to a more distinct blue */
    --prompt-dir: #ff87d7;
    --prompt-dollar: #ffd787;
    --comment-text: #888;
    --border-color: #444;
}

.terminal-window {
    font-family: 'Fira Code', monospace;
    background-color: var(--terminal-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 800px;
    margin: auto;
}

.terminal-header {
    background-color: var(--terminal-header-bg);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.terminal-button {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.terminal-button.red {
    background-color: #ff5f56;
}

.terminal-button.yellow {
    background-color: #ffbd2e;
}

.terminal-button.green {
    background-color: #27c93f;
}

.terminal-title {
    color: #ccc;
    font-size: 0.9em;
    flex-grow: 1;
    text-align: center;
}

.terminal-body {
    padding: 15px;
    max-height: 75vh;
    overflow-y: auto;
    color: var(--terminal-text);
}

.terminal-line {
    margin-bottom: 5px;
}

.prompt {
    margin-right: 8px;
}

.prompt.user {
    color: var(--prompt-user);
}

.prompt.dir {
    color: var(--prompt-dir);
}

.prompt.dollar {
    color: var(--prompt-dollar);
}

.output {
    color: #ccc;
}

.output.comment {
    color: var(--comment-text);
    font-style: italic;
}

.form-group-terminal {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
}

.form-group-terminal .prompt {
    white-space: nowrap;
}

.terminal-input,
.terminal-textarea {
    background: transparent;
    border: none;
    color: var(--prompt-user);
    font-family: 'Fira Code', monospace;
    width: 100%;
    padding: 0;
    margin: 0;
    caret-color: var(--terminal-text);
    line-height: 1.5;
}

.terminal-input:focus,
.terminal-textarea:focus {
    outline: none;
}

.terminal-input::after,
.terminal-textarea::after {
    content: '_';
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.terminal-button-submit {
    background: transparent;
    border: 1px solid var(--terminal-text);
    color: var(--terminal-text);
    padding: 5px 10px;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.terminal-button-submit:hover {
    background-color: var(--terminal-text);
    color: var(--terminal-bg);
}

/* Custom Checkbox */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.terminal-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.terminal-checkbox input[type="checkbox"] {
    display: none;
    /* Hide original checkbox */
}

.terminal-checkbox label {
    cursor: pointer;
    position: relative;
    padding-left: 30px;
    /* Space for custom checkbox */
}

/* Box */
.terminal-checkbox label::before {
    content: '[ ]';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--terminal-text);
    font-family: 'Fira Code', monospace;
}

/* Checkmark */
.terminal-checkbox input[type="checkbox"]:checked+label::before {
    content: '[x]';
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .form-group-terminal {
        flex-direction: column;
        align-items: stretch;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .terminal-body {
        max-height: 65vh;
    }
}

/* Form View Toggle Switch */
.form-view-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-right: 10px;
}

.form-view-toggle .toggle-label {
    color: #ccc;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
    margin: 0 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border: 1px solid #444;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: #ccc;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--prompt-user);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}


/* Standard Form View Styles */
.terminal-window.standard-view {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #212529;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.terminal-window.standard-view .terminal-header,
.terminal-window.standard-view .terminal-line,
.terminal-window.standard-view .form-group-terminal .prompt.user,
.terminal-window.standard-view .form-group-terminal .prompt.dir,
.terminal-window.standard-view .form-group-terminal .prompt.dollar {
    display: none;
}

.terminal-window.standard-view .terminal-body {
    color: #212529;
    max-height: none;
    overflow-y: visible;
}

.terminal-window.standard-view .form-group-terminal {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.terminal-window.standard-view .prompt,
.terminal-window.standard-view .terminal-checkbox label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #495057;
    margin-bottom: .5rem;
    font-weight: 600;
}

.terminal-window.standard-view .terminal-input,
.terminal-window.standard-view .terminal-textarea {
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
    color: #495057;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    padding: .5rem .75rem;
    line-height: 1.5;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.terminal-window.standard-view .terminal-input:focus,
.terminal-window.standard-view .terminal-textarea:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25);
}

.terminal-window.standard-view .checkbox-group {
    flex-direction: column;
    gap: 0.5rem;
}

.terminal-window.standard-view .terminal-checkbox {
    margin-bottom: 0;
}

.terminal-window.standard-view .terminal-checkbox input[type="checkbox"] {
    display: inline-block;
    height: 1em;
    width: 1em;
    margin-right: .5rem;
    vertical-align: middle;
}

.terminal-window.standard-view .terminal-checkbox label {
    padding-left: 0;
    font-weight: normal;
    display: inline-block;
}

.terminal-window.standard-view .terminal-checkbox label::before {
    display: none;
}

.terminal-window.standard-view .terminal-button-submit {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #007bff;
    border-color: #007bff;
    border: 1px solid transparent;
    color: #fff;
    padding: .5rem 1rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out;
}

.terminal-window.standard-view .terminal-button-submit:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.terminal-window.standard-view .output.comment {
    display: block;
    color: #6c757d;
    font-style: normal;
    font-size: 0.9em;
    margin-bottom: 1rem;
}

.terminal-window.standard-view .form-group-terminal:last-of-type {
    margin-top: 2rem;
}