/* 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;
    }
}

.label { color: #ffffff; font-family: monospace; font-size: 11px; padding: 2px; background: rgba(0,0,0,0.6); border-radius: 3px; pointer-events: none; }
        #sim-container { position: relative; width: 100%; height: 100vh; overflow: hidden; background: #000; }
        .label-renderer { position: absolute; top: 0; pointer-events: none; z-index: 10; }
        .distance-display { color: #00ff00; font-weight: bold; }

        /* Zoom indicator bar - Updated to match Image */
        #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;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        #zoom-label { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; }
        #zoom-bar-bg {
            width: 160px; height: 6px; background: #222;
            border-radius: 3px; border: 1px solid #444;
            overflow: hidden;
        }
        #zoom-bar-fill {
            height: 100%; border-radius: 3px;
            background: linear-gradient(90deg, #2a6, #8f4);
            transition: width .1s;
            width: 0%;
        }
        #zoom-alt { 
            font-size: 14px; color: #9c9; font-weight: 600; 
            text-shadow: 0 0 10px rgba(153, 204, 153, 0.3);
        }

        /* Lagrange Control - Top Right */
        #lagrange-ctrl-panel {
            position: absolute; top: 20px; right: 20px;
            background: rgba(0,0,0,0.8); padding: 10px 15px;
            border-radius: 6px; border: 1px solid #444;
            color: white; font-family: monospace; z-index: 20;
            display: flex; align-items: center; gap: 10px; font-size: 11px;
        }
		
        .label { color: #ffffff; font-family: monospace; font-size: 11px; padding: 2px; background: rgba(0,0,0,0.6); border-radius: 3px; pointer-events: none; }
        #sim-container { position: relative; width: 100%; height: 100vh; overflow: hidden; background: #000; }
        .label-renderer { position: absolute; top: 0; pointer-events: none; z-index: 10; }
        .distance-display { color: #00ff00; font-weight: bold; }

        /* Zoom indicator bar — matching proposed CSS */
        #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; text-transform: uppercase; letter-spacing: 0.5px; }
        #zoom-bar-bg {
            width: 160px; height: 6px; background: #222;
            border-radius: 3px; border: 1px solid #444;
            overflow: hidden;
        }
        #zoom-bar-fill {
            height: 100%; border-radius: 3px;
            background: linear-gradient(90deg, #2a6, #8f4);
            transition: width .1s;
            width: 0%;
        }
        #zoom-alt { 
            font-size: 11px; color: #9c9; font-weight: 600; 
            display: flex; align-items: baseline; gap: 2px;
        }
        .exponent { font-size: 0.85em; vertical-align: super; }

        /* Lagrange Control - Top Right */
        #lagrange-ctrl-panel {
            position: absolute; top: 20px; right: 20px;
            background: rgba(0,0,0,0.8); padding: 10px 15px;
            border-radius: 6px; border: 1px solid #444;
            color: white; font-family: monospace; z-index: 20;
            display: flex; align-items: center; gap: 10px; font-size: 11px;
        }
        #lagrange-ctrl-panel input { cursor: pointer; accent-color: #00ff00; }

        .label { color: #ffffff; font-family: monospace; font-size: 11px; padding: 2px; background: rgba(0,0,0,0.6); border-radius: 3px; pointer-events: none; }
        #sim-container { position: relative; width: 100%; height: 100vh; overflow: hidden; background: #000; cursor: grab; }
        #sim-container:active { cursor: grabbing; }
        .label-renderer { position: absolute; top: 0; pointer-events: none; z-index: 10; }
        .distance-display { color: #00ff00; font-weight: bold; }

        /* Altitude Indicator styling */
        #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; text-transform: uppercase; letter-spacing: 0.5px; }
        #zoom-bar-bg {
            width: 160px; height: 6px; background: #222;
            border-radius: 3px; border: 1px solid #444;
            overflow: hidden;
        }
        #zoom-bar-fill {
            height: 100%; border-radius: 3px;
            background: linear-gradient(90deg, #2a6, #8f4);
            transition: width .1s;
            width: 0%;
        }
        #zoom-alt { font-size: 11px; color: #9c9; font-weight: 600; display: flex; align-items: baseline; gap: 2px; }
        .exponent { font-size: 0.85em; vertical-align: super; }

        /* Controls styling */
        #lagrange-ctrl-panel {
            position: absolute; top: 20px; right: 20px;
            background: rgba(0,0,0,0.8); padding: 10px 15px;
            border-radius: 6px; border: 1px solid #444;
            color: white; font-family: monospace; z-index: 20;
            display: flex; align-items: center; gap: 10px; font-size: 11px;
        }
        #lagrange-ctrl-panel input { cursor: pointer; accent-color: #00ff00; }