:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #6200ea;
    --accent-hover: #7c4dff;
    --border-color: #333;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
}

h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.nav-btn.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

main {
    display: grid;
    /* Reduced left column width */
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
}

.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    /* Spacing between stacked cards */
}

/* Make visualization cards stack nicely */
.visualization {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.visualization .card {
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 16px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-container input[type="range"] {
    flex-grow: 1;
    cursor: pointer;
    padding: 0;
    /* Fixes track filling issue */
    margin: 0;
}

.slider-container input[type="number"] {
    width: 60px;
    text-align: center;
}

.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.radio-group label {
    margin-bottom: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
    accent-color: var(--accent);
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input,
select {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

.hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.btn-primary {
    width: 100%;
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.stats-grid {
    display: grid;
    /* Horizontal layout for stats */
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-item {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item .value {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.slider {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    background-color: #333;
    border-radius: 20px;
    transition: .4s;
    margin-right: 10px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: .4s;
}

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

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

/* Action Button */
.action-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: var(--accent-hover);
}

#prob-chart {
    max-height: 400px;
}