/* system_web.css — aligned with styles.css */

/* ─── Inherit CSS variables from parent page ────────────── */
/* When loaded inside an iframe these fall back to their     */
/* own values; when inlined they inherit from :root          */
:root {
    --color-bg:         #0a0a0a;
    --color-surface:    #141414;
    --color-card:       #1e1e1e;
    --color-border:     #2e2e2e;
    --color-text:       #e0e0e0;
    --color-text-muted: #888888;
    --color-heading:    #ffffff;
    --color-hover:      #2a2a2a;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Base ──────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, sans-serif;  /* ← matches styles.css */
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--color-bg);
    color: var(--color-text);
    overflow: hidden;
}

/* ─── Layout ────────────────────────────────────────────── */
.container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
}

.simulation-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: var(--color-bg);
}

.content-container {
    width: 30%;
    min-width: 300px;
    padding: 20px 24px;
    background-color: var(--color-surface);
    border-left: 1px solid var(--color-border);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) var(--color-surface);
}

.content-container::-webkit-scrollbar {
    width: 6px;
}

.content-container::-webkit-scrollbar-track {
    background: var(--color-surface);
}

.content-container::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.content-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* ─── Canvas ────────────────────────────────────────────── */
canvas {
    display: block;
    outline: none;
}

/* ─── Overlaid info panel ───────────────────────────────── */
.info-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(20, 20, 20, 0.85);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(6px);
    padding: 14px 16px;
    border-radius: 6px;
    max-width: 280px;
    pointer-events: none;
    z-index: 10;
}

.info-panel h2 {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--color-heading);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.info-panel p {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ─── Controls panel ────────────────────────────────────── */
.controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: rgba(20, 20, 20, 0.9);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(6px);
    padding: 14px 16px;
    border-radius: 6px;
    max-width: 460px;
    font-size: 0.8rem;
    z-index: 10;
}

.date-control-group {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
}

.time-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.step-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.step-btn-group {
    display: flex;
    gap: 2px;
}

/* ─── Buttons ───────────────────────────────────────────── */
button {
    background-color: #4CAF50;
    border: none;
    color: #ffffff;
    padding: 5px 11px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    transition: background-color 0.15s;
}

button:hover {
    background-color: #45a049;
}

button.secondary {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

button.secondary:hover {
    background-color: var(--color-hover);
}

button.accent {
    background-color: #2196F3;
}

button.accent:hover {
    background-color: #0b7dda;
}

/* ─── Labels ────────────────────────────────────────────── */
label {
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-right: 5px;
    white-space: nowrap;
}

/* ─── Inputs ────────────────────────────────────────────── */
input[type="datetime-local"] {
    padding: 4px 8px;
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.78rem;
    color-scheme: dark;
    transition: border-color 0.15s;
}

input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--color-text-muted);
}

select {
    padding: 4px 8px;
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 0.78rem;
    transition: border-color 0.15s;
}

select:focus {
    outline: none;
    border-color: var(--color-text-muted);
}

/* ─── Sim time display ──────────────────────────────────── */
.sim-time-display {
    font-family: 'Courier New', monospace;  /* ← matches #utcTimer in styles.css */
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 6px;
    text-align: right;
}

/* ─── Phase display ─────────────────────────────────────── */
.phase-display {
    font-weight: 600;
    color: var(--color-heading);   /* ← white, not green */
}

/* ─── Content panel headings ────────────────────────────── */
h1 {
    color: var(--color-heading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

h2 {
    color: var(--color-heading);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

h3 {
    color: var(--color-heading);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ─── Table ─────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin: 16px 0;
}

thead tr {
    background-color: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 1;
}

thead th {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.15s;
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: var(--color-hover);
}

tbody td {
    color: var(--color-text);
    padding: 10px 12px;
    vertical-align: middle;
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .simulation-container {
        height: 60vh;
    }

    .content-container {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid var(--color-border);
    }

    .controls {
        max-height: 40vh;
        overflow-y: auto;
    }

    thead th,
    tbody td {
        padding: 8px;
        font-size: 0.82rem;
    }
}

/* Fallback / override styles if external CSS is absent */
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
        body { background: #000; color: #ccc; font-family: 'Segoe UI', sans-serif; overflow: hidden; }
        .container { width: 100vw; height: 100vh; display: flex; flex-direction: column; }
        .simulation-container { position: relative; flex: 1; overflow: hidden; }

        .info-panel {
            position: absolute; top: 12px; left: 12px; z-index: 10;
            background: rgba(0,0,0,.65); border: 1px solid #333;
            border-radius: 8px; padding: 10px 14px; pointer-events: none;
        }
        .info-panel h2 { font-size: 14px; color: #ddd; margin-bottom: 4px; }
        .info-panel p  { font-size: 11px; color: #888; line-height: 1.6; }

        /* Zoom indicator bar */
        #zoom-bar-wrap {
            position: absolute; bottom: 16px; left: 50%;
            transform: translateX(-50%);
            z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 4px;
            pointer-events: none;
        }
        #zoom-label { font-size: 10px; color: #888; }
        #zoom-bar-bg {
            width: 160px; height: 6px; background: #222;
            border-radius: 3px; border: 1px solid #444;
        }
        #zoom-bar-fill {
            height: 100%; border-radius: 3px;
            background: linear-gradient(90deg, #2a6, #8f4);
            transition: width .1s;
        }
        #zoom-alt { font-size: 11px; color: #9c9; font-weight: 600; }

        .controls {
            position: absolute; bottom: 12px; left: 12px; z-index: 10;
            background: rgba(0,0,0,.72); border: 1px solid #333;
            border-radius: 8px; padding: 12px 14px;
            display: flex; flex-direction: column; gap: 8px;
            min-width: 240px; font-size: 12px;
        }
        .controls button {
            background: #1e3a5a; color: #cde; border: 1px solid #2a5080;
            border-radius: 5px; padding: 5px 12px; cursor: pointer; font-size: 12px;
        }
        .controls button:hover { background: #2a5a8a; }
        .controls button.secondary { background: #1a2a1a; border-color: #2a5a2a; color: #9d9; }
        .controls button.secondary:hover { background: #253525; }
        .controls select {
            background: #111; color: #ccc; border: 1px solid #333;
            border-radius: 4px; padding: 4px 6px; font-size: 12px;
        }
        .controls label { color: #888; font-size: 11px; }
        .controls input[type="datetime-local"] {
            background: #111; color: #ccc; border: 1px solid #333;
            border-radius: 4px; padding: 4px 6px; font-size: 11px; width: 100%;
        }

        .date-control-group { display: flex; flex-direction: column; gap: 5px; }
        .time-input-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
        .step-controls-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
        .step-btn-group { display: flex; align-items: center; gap: 4px; }
        .sim-time-display { font-size: 11px; color: #9ab; margin-top: 2px; }
        .phase-display { color: #ffd; }