:root {
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    --bs-body-color: #212529;
    --bs-body-bg: #f8f9fa;
    --bs-border-color: #dee2e6;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--bs-font-sans-serif);
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar / Config Panel */
.config-panel {
    width: 350px;
    background: #fff;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--bs-border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.config-panel h1 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bs-primary);
    color: var(--bs-primary);
}

/* Config Sections */
.config-section {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1rem;
}

.config-section:last-child {
    border-bottom: none;
}

.config-section h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Form Elements */
.form-group {
    margin-bottom: 0.75rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
    color: var(--bs-body-color);
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

/* Checkboxes */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-top: 0;
    margin-right: 0.5rem;
    cursor: pointer;
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-weight: 400;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    font-size: 1rem;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
    width: 100%;
}

.btn-primary {
    color: #fff;
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.btn-primary:hover {
    background-color: #0b5ed7;
}

.btn-success {
    color: #fff;
    background-color: var(--bs-success);
    border-color: var(--bs-success);
}

.btn-outline-secondary {
    color: var(--bs-secondary);
    border-color: var(--bs-secondary);
    background: transparent;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: var(--bs-secondary);
}

/* Main Result Area */
.result-area {
    flex-grow: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.stats-badge {
    background: #e9ecef;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    color: #495057;
}

#output_container {
    flex-grow: 1;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-y: auto;
    font-family: monospace;
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: break-all;
}

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

.toolbar button {
    width: auto;
}

/* Strength Meter */
.strength-meter {
    height: 4px;
    background: #e9ecef;
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.3s, background-color 0.3s;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        overflow: auto;
    }

    .config-panel {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .result-area {
        height: 600px;
    }
}