:root {
    --bg-color: #f4f1ea;
    --text-color: #000000;
    --border-color: #000000;
    --accent-color: #0000ff;
    /* Bleu "link" old school */
    --grid-gap: 1px;

    --font-mono: 'Courier New', Courier, monospace;
    --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

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

body {
    background-color: var(--border-color);
    /* Grid lines color */
    color: var(--text-color);
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--grid-gap);
    background-color: var(--border-color);
    height: 100%;
}

.panel {
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header Styles */
.panel-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h1 {
    font-family: var(--font-mono);
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: normal;
    letter-spacing: 1px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    background-color: #00ff00;
    /* Active green */
    border: 1px solid black;
}

/* Visualization Panel */
.canvas-wrapper {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

#overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.5rem;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* Control Panel */
.content-wrapper {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.control-group {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.control-group:last-child {
    border-bottom: none;
}

label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* Brutalist Inputs */
.brutalist-input,
.brutalist-range {
    width: 100%;
    display: block;
    border: 1px solid var(--border-color);
    background: white;
    padding: 0.5rem;
    border-radius: 0;
    /* Strict square corners */
    font-family: var(--font-mono);
    font-size: 1rem;
    outline: none;
    -webkit-appearance: none;
}

.brutalist-input:focus,
.brutalist-range:focus {
    background-color: #ffffcc;
    /* Highlight focus */
}

/* Range Input Styling */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border: 1px solid black;
    background: white;
    cursor: pointer;
    margin-top: -8px;
    /* Offset for track */
    box-shadow: 2px 2px 0px black;
    /* Hard shadow */
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: black;
    border: none;
}

.value-display {
    display: block;
    text-align: right;
    font-family: var(--font-mono);
    margin-top: 0.5rem;
}

/* Dashboard */
.dashboard {
    background-color: white;
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 4px 4px 0px black;
    /* Hard shadow pop */
}

.dashboard h2 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-bottom: 1px solid black;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.data-row .value {
    font-weight: bold;
}

/* Theory Section */
details {
    border: 1px solid var(--border-color);
    background-color: white;
}

summary {
    padding: 1rem;
    font-family: var(--font-mono);
    cursor: pointer;
    list-style: none;
    /* Hide default triangle */
    font-weight: bold;
    background-color: #e0e0e0;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: "+";
    float: right;
    font-weight: bold;
}

details[open] summary::after {
    content: "-";
}

.theory-content {
    padding: 1rem;
    border-top: 1px solid black;
    font-size: 0.9rem;
    line-height: 1.4;
}

.theory-block {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 2px solid black;
}

.theory-block h3 {
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.theory-note {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #555;
    margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh 1fr;
        /* Stacked layout */
        overflow-y: auto;
        /* Allow body scroll on mobile */
        height: auto;
        display: block;
        /* Break grid for simpler flow control */
    }

    body {
        height: auto;
        overflow-y: auto;
    }

    #viz-panel {
        height: 60vh;
        border-bottom: 1px solid black;
    }

    #control-panel {
        min-height: 50vh;
    }
}