/* styles.css */

/* Container Layout */
.simulation-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-family: sans-serif;
}

canvas {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

.controls {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

/* Base Matrix Grid (Default 2x2) */
.matrix-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 200px;
    margin: 0 auto 20px auto;
}

/* 3x3 Modifier */
.matrix-input-grid.grid-3x3 {
    grid-template-columns: repeat(3, 1fr);
    /* Forces 3 columns */
    max-width: 280px;
    /* Slightly wider to accommodate 3 inputs */
}

.matrix-input-grid input {
    width: 100%;
    padding: 8px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
}

/* Buttons */
.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

button {
    background-color: #4a148c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    font-size: 0.9em;
}

button:hover {
    background-color: #6a1b9a;
}

.btn-row-op {
    background-color: #00695c;
    /* Teal */
}

.btn-row-op:hover {
    background-color: #00897b;
}

/* Math & History Display */
.math-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.9em;
}

.math-display-box {
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    text-align: center;
    overflow-x: auto;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.85em;
    display: block;
    text-align: left;
    padding: 10px;
}

.history-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}