:root {
    --bg-color: #000000;
    --panel-bg: #2c3e50;
    --text-color: #e0e6ed;
    --accent-color: #505196;
    --danger-color: #f72525;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: grid;
    height: 900px; /* Ensure full height for layout */
    justify-content: center; /* Center the simulation horizontally */
    align-items: center; /* Center the simulation vertically */
    display: flex; /* Keep this! */
    height: 100%; /* Keep this! */
    min-width: 100%; /* Example: 300px sidebar + 600px canvas */
    display: flex;
    flex-direction: auto;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

#controls {
    border-radius: 0px;
    width: 100%;
    background-color: var(--panel-bg);
    padding: 20px;
    box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.031);
    display: flex;
    flex-direction: auto;
    gap: 15px;
    z-index: 10;
    overflow-y: auto;
}
/* Responsive Stacking */
@media (max-width: 900px) {
    #controls {
        grid-template-columns: 1fr;
    }
    #simulation-container {
        grid-row: auto; 
    }
}

h1 { font-size: 1.2rem; margin-top: 0; color: var(--accent-color); }
h2 { font-size: 1rem; margin-bottom: 5px; border-bottom: 0px solid #333; padding-bottom: 5px; }

.control-group { margin-bottom: 10px; max-width: 1200px; flex-basis: auto;flex-grow: 1 ;}

label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 5px;
    color: #ffffff;
}

input[type="range"] { width: 100%; cursor: pointer; }

.value-display {
    float: right;
    font-weight: bold;
    color: var(-text-color);
}

.helper-text { color: #ffffff; font-size: 0.7em; }

/* --- NEW TABLE STYLES --- */
#telemetry-table {
    min-width: 200px;
    width: 100%;
    display: table;
    flex-basis: auto;
    flex-grow: 1;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: #000000;
    background: rgb(255, 255, 255);
    border-radius: 4px;
}

#telemetry-table td {
    padding: 8px;
    border-bottom: 1px solid rgb(0, 0, 0);
}

/* Style the values column (right side) */
#telemetry-table td:last-child {
    text-align: right;
    color: var(--accent-color);
    font-family: 'Courier New', Courier, monospace; /* Monospace prevents text jumping */
    font-weight: bold;
}
/* ------------------------ */

.instructions { margin-top: auto; font-size: 0.75rem; color: #555; }

button {
    background-color: var(--accent-color);
    border: none;
    padding: 5px;
    color: var(--text-color);
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.2s;
    width: 100%;
    margin-top: 35px;
    margin-left: 5px;
}

button:hover { opacity: 0.7; }
button.reset { background-color: var(--danger-color); color: white; }

#simulation-container {
    flex-grow: 1;
    position: relative;
    cursor: grab;
    width: 100%; 
    height: 600px;
}

#simCanvas { display: block; width: 100%; height: 100%; }

#zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#crash-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 29, 46, 0.95);
    border: 2px solid var(--danger-color);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    display: none;
    box-shadow: 0 0 30px rgba(247, 37, 133, 0.4);
}
/* Assume this is the element wrapping your controls and canvas */
#my-sim-wrapper { 
    /* Use percentage of the available horizontal space */
    width: 100%; 
    /* Use viewport height to ensure it fills the vertical space */
    height: 100vh; 
    display: flex;
    /* ... other styles */
}

#crash-modal h2 { color: var(--danger-color); border: none; font-size: 2rem; }
.bg-dark-indigo {
    background-color: #2c3e50; /* Deep Slate Blue/Dark Indigo */
}