body {
    font-family: Consolas, "Courier New", monospace;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* === LAYOUT GRID === */
.layout-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    /* Sidebar width and main content */
    height: 100%;
    overflow: hidden;
}

/* === OPTIONS PANEL === */
.options-panel {
    background-color: #ddd;
    padding: 20px;
    border-right: 1px solid #bbb;
    overflow-y: auto;
}

/* === CODE SECTION === */
.code-section {
    overflow-y: auto;
    overflow-x: auto;
    padding: 20px;
}

/* === OTHER STYLES UNCHANGED === */

footer {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: red;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: bold;
}

.i1 {
    margin-left: 2ch;
}

.i2 {
    margin-left: 4ch;
}

.i3 {
    margin-left: 6ch;
}

.i4 {
    margin-left: 8ch;
}

/* Removed old .container { display: flex; } definition */

/* Indentation for radio buttons */
.radio-group {
    margin-left: 25px;
}

.code-container {
    background-color: #eee;
    border: 1px solid #ccc;
    padding: 15px;
    line-height: 1.5;
    margin-top: 20px;
}

.arithmetic,
.conditionals,
.let,
.functions,
.first-class-functions-opacity {
    opacity: 0;
}

.eager,
.substitutionNaive,
.substitutionNaive-inline,
.substitutionSimple,
.substitutionSimple-inline,
.substitutionCaptureAvoiding,
.substitutionCaptureAvoiding-inline,
.call-by-value,
.eager-functions-inline,
.eager-not-first-class-functions-inline,
.environment,
.environment-inline,
.environment-recursion-inline,
.not-first-class-static-scope,
.not-first-class-dynamic-scope,
.higher-order-functions,
.first-class-functions,
.first-class-functions-inline,
.first-class-env,
.first-class-sub,
.not-first-class-functions-inline,
.first-class-recursion,
.recursion-inline {
    display: none;
}

body:has(#toggleArithmetic:checked) .arithmetic {
    opacity: 1;
    animation: highlight 10s forwards;
}

body:has(#toggleConditionals:checked) .conditionals {
    opacity: 1;
    animation: highlight 10s forwards;
}

body:has(#toggleLet:checked) .let {
    opacity: 1;
    animation: highlight 10s forwards;
}

body:has(#toggleLetEager:checked) .eager {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleEnv:checked) .environment {
    display: block;
    animation: highlight 10s forwards;
}

body:has(#toggleEnv:checked) .environment-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleSubstNaive:checked):has(#toggleLet:checked) .substitutionNaive,
body:has(#toggleSubstSimple:checked):has(#toggleLet:checked) .substitutionNaive,
body:has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .substitutionNaive {
    display: block;
    animation: highlight 10s forwards;
}

body:has(#toggleSubstNaive:checked):has(#toggleLet:checked) .substitutionNaive-inline,
body:has(#toggleSubstSimple:checked):has(#toggleLet:checked) .substitutionNaive-inline,
body:has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .substitutionNaive-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleSubstSimple:checked):has(#toggleLet:checked) .substitutionSimple,
body:has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .substitutionSimple {
    display: block;
    animation: highlight 10s forwards;
}

body:has(#toggleSubstSimple:checked):has(#toggleLet:checked) .substitutionSimple-inline,
body:has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .substitutionSimple-inline {
    display: inline;
}

body:has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .substitutionCaptureAvoiding {
    display: block;
    animation: highlight 10s forwards;
}

body:has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .substitutionCaptureAvoiding-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleFunctions:checked) .functions {
    opacity: 1;
    animation: highlight 10s forwards;
}

body:has(#toggleLetEager:checked):has(#toggleFunctions:checked):has(#toggleFirstOrder:checked) .eager-not-first-class-functions-inline,
body:has(#toggleLetEager:checked):has(#toggleFunctions:checked):has(#toggleHigherOrder:checked) .eager-not-first-class-functions-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleCallByValue:checked):has(#toggleFunctions:checked) .call-by-value {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleScopeDynamic:checked):has(#toggleFirstOrder:checked):has(#toggleLet:checked) .not-first-class-dynamic-scope,
body:has(#toggleScopeDynamic:checked):has(#toggleHigherOrder:checked):has(#toggleLet:checked) .not-first-class-dynamic-scope {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleScopeStatic:checked):has(#toggleFirstOrder:checked):has(#toggleLet:checked) .not-first-class-static-scope,
body:has(#toggleScopeStatic:checked):has(#toggleHigherOrder:checked):has(#toggleLet:checked) .not-first-class-static-scope {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleHigherOrder:checked):has(#toggleFunctions:checked) .higher-order-functions {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleHigherOrder:checked):has(#toggleFunctions:checked) .not-first-class-functions-inline,
body:has(#toggleFirstOrder:checked):has(#toggleFunctions:checked) .not-first-class-functions-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleFirstClass:checked):has(#toggleFunctions:checked) .first-class-functions {
    display: block;
    animation: highlight 10s forwards;
}

body:has(#toggleFirstClass:checked):has(#toggleFunctions:checked) .first-class-functions-opacity {
    opacity: 1;
    animation: highlight 10s forwards;
}

body:has(#toggleFirstClass:checked):has(#toggleFunctions:checked) .first-class-functions-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleFirstClass:checked):has(#toggleSubstNaive:checked):has(#toggleLet:checked) .first-class-sub,
body:has(#toggleFirstClass:checked):has(#toggleSubstSimple:checked):has(#toggleLet:checked) .first-class-sub,
body:has(#toggleFirstClass:checked):has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .first-class-sub {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleFirstClass:checked):has(#toggleEnv:checked):has(#toggleLet:checked) .first-class-env {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleEnv:checked):has(#toggleRecursion:checked) .environment-recursion-inline {
    display: inline;
    animation: highlight 10s forwards;
}

body:has(#toggleRecursion:checked):has(#toggleFirstClass:checked):has(#toggleLet:checked) .first-class-recursion {
    display: block;
    animation: highlight 10s forwards;
}

body:has(#toggleRecursion:checked) .recursion-inline {
    display: inline;
    animation: highlight 10s forwards;
}

/* Display the footer when a combination is not implemented (yet) */
body:has(#toggleScopeDynamic:checked):has(#toggleSubstNaive:checked):has(#toggleLet:checked) .not-implemented,
body:has(#toggleScopeDynamic:checked):has(#toggleSubstSimple:checked):has(#toggleLet:checked) .not-implemented,
body:has(#toggleScopeDynamic:checked):has(#toggleSubstCaptureAvoiding:checked):has(#toggleLet:checked) .not-implemented,
body:has(#toggleHigherOrder:checked):has(#toggleFunctions:checked) .not-implemented,
body:has(#toggleScopeDynamic:checked):has(#toggleFirstClass:checked):has(#toggleLet:checked) .not-implemented {
    display: block;
}

/* Keyframes animation: start green and transition to black */
@keyframes highlight {
    0% {
        background-color: yellow;
    }

    100% {
        background-color: transparent;
    }
}

@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .options-panel {
        border-right: none;
        border-bottom: 1px solid #bbb;
    }
}