/* ===== Ephemeris 3D Simulator — locally scoped styles (eph- prefix) ===== */
#content_sim .eph-wrap {
    width: 800px;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    color: #d8d8d8;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    border: 1px solid #222;
    box-sizing: border-box;
    padding: 0;
}

#content_sim .eph-wrap * {
    font-family: 'Courier New', Courier, monospace;
    box-sizing: border-box;
}

/* ---- 3D stage ---- */
#content_sim .eph-stage {
    position: relative;
    width: 800px;
    height: 600px;
    background: #000;
    overflow: hidden;
}

#content_sim .eph-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* ---- Title label directly on top of the 3D view ---- */
#content_sim .eph-title {
    position: absolute;
    top: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #7fd1ff;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
    text-shadow: 0 0 6px #000, 0 0 6px #000;
    pointer-events: none;
    z-index: 6;
}
#content_sim .eph-subtitle {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #9fae9f;
    font-size: 11px;
    text-shadow: 0 0 5px #000, 0 0 5px #000;
    pointer-events: none;
    z-index: 6;
}

/* ---- Camera control buttons, top-left of the plot ---- */
#content_sim .eph-cam {
    position: absolute;
    top: 8px;
    left: 8px;
    display: grid;
    grid-template-columns: repeat(2, 26px);
    gap: 3px;
    z-index: 8;
}
#content_sim .eph-cam button {
    width: 26px;
    height: 26px;
    background: rgba(20, 28, 38, 0.85);
    color: #cfe6ff;
    border: 1px solid #3a4a5e;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
#content_sim .eph-cam button:hover {
    background: rgba(40, 60, 86, 0.95);
    border-color: #6aa6e6;
}

/* ---- Live readout overlay, top-right ---- */
#content_sim .eph-readout {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(8, 12, 18, 0.78);
    border: 1px solid #2a3645;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.45;
    color: #d8e2ec;
    z-index: 7;
    min-width: 150px;
}
#content_sim .eph-readout b { color: #7fd1ff; }
#content_sim .eph-readout .eph-rv { color: #ffd479; }

/* ---- Legend overlay, bottom-left ---- */
#content_sim .eph-legend {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(8, 12, 18, 0.72);
    border: 1px solid #2a3645;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 10.5px;
    line-height: 1.5;
    z-index: 7;
}
#content_sim .eph-legend .eph-sw {
    display: inline-block;
    width: 11px;
    height: 11px;
    margin-right: 5px;
    vertical-align: -1px;
    border-radius: 2px;
}

/* ---- Control panel below the stage ---- */
#content_sim .eph-controls {
    background: #06090d;
    border-top: 1px solid #222;
    padding: 8px 10px 10px;
}

#content_sim .eph-section {
    color: #7fd1ff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 4px;
    border-bottom: 1px solid #1c2730;
    padding-bottom: 2px;
}
#content_sim .eph-section:first-child { margin-top: 0; }

/* each parameter: label, slider, value all on one line */
#content_sim .eph-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
}
#content_sim .eph-row label {
    flex: 0 0 188px;
    color: #cfd8e0;
    font-size: 11.5px;
    white-space: nowrap;
}
#content_sim .eph-row label .eph-sym { color: #ffd479; }
#content_sim .eph-row input[type="range"] {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #4f9fe0;
    height: 4px;
}
#content_sim .eph-row .eph-val {
    flex: 0 0 116px;
    text-align: right;
    color: #ffd479;
    font-size: 11.5px;
    white-space: nowrap;
}

#content_sim .eph-row select,
#content_sim .eph-row input[type="text"],
#content_sim .eph-row input[type="datetime-local"] {
    background: #0e151d;
    color: #d8e2ec;
    border: 1px solid #2a3645;
    border-radius: 3px;
    padding: 3px 5px;
    font-size: 11.5px;
}
#content_sim .eph-row input[type="text"] { flex: 1 1 auto; min-width: 0; }
#content_sim .eph-row select { flex: 1 1 auto; }

/* animation + action buttons */
#content_sim .eph-btnrow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin: 6px 0 2px;
}
#content_sim .eph-btn {
    background: #15212e;
    color: #cfe6ff;
    border: 1px solid #3a4a5e;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11.5px;
    cursor: pointer;
}
#content_sim .eph-btn:hover { background: #20344a; border-color: #6aa6e6; }
#content_sim .eph-btn.eph-run { background: #1d3a26; border-color: #3f7a52; color: #b8f0c8; }
#content_sim .eph-btn.eph-run.eph-on { background: #5a1d1d; border-color: #a14b4b; color: #ffc9c9; }

#content_sim .eph-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #cfd8e0;
    cursor: pointer;
}
/* single-column layout: one parameter per line, full width */
#content_sim .eph-cols { display: block; }
#content_sim .eph-col { width: 100%; }
#content_sim .eph-row label { flex: 0 0 200px; }
#content_sim .eph-row .eph-val { flex: 0 0 150px; }

/* ---- TLE panel (bottom) ---- */
#content_sim .eph-tle {
    background: #04070a;
    border-top: 1px solid #222;
    padding: 8px 10px 10px;
}
#content_sim .eph-tle-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#content_sim .eph-tle-head .eph-section { margin: 0; }
#content_sim .eph-tle-text {
    margin: 6px 0;
    padding: 8px 10px;
    background: #000;
    border: 1px solid #2a3a4a;
    border-radius: 4px;
    color: #cfd8e0;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre;
    overflow-x: auto;
}
#content_sim .eph-tle-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; }
#content_sim .eph-tle-note { font-size: 10.5px; color: #8a96a3; margin-top: 4px; }
#content_sim .tf-name { color: #ffffff; font-weight: bold; }
#content_sim .tf-cat  { color: #9aa6b2; }
#content_sim .tf-epo  { color: #7fd1ff; }
#content_sim .tf-drag { color: #6f7b86; }
#content_sim .tf-inc  { color: #66ccff; }
#content_sim .tf-raan { color: #ff5fc8; }
#content_sim .tf-ecc  { color: #2fe0e0; }
#content_sim .tf-argp { color: #ff9a3c; }
#content_sim .tf-ma   { color: #ffe14d; }
#content_sim .tf-mm   { color: #9be15a; }
#content_sim .tf-ck   { color: #ff6b6b; font-weight: bold; }

/* ---- epoch: text + date picker + Now on one line ---- */
#content_sim .eph-row input[type="text"].eph-bad { border-color: #e05555; background: #2a0f0f; color: #ffb3b3; }
#content_sim .eph-btn.eph-now { padding: 3px 8px; }

/* ---- custom epoch date picker popup ---- */
#content_sim .eph-epoch-row { position: relative; }
#content_sim .eph-dp {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 30;
    width: 262px;
    margin-top: 4px;
    padding: 8px;
    background: #0b121a;
    border: 1px solid #3a5a7a;
    border-radius: 5px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
}
#content_sim .eph-dp.eph-open { display: block; }
#content_sim .eph-dp-head { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
#content_sim .eph-dp-head .eph-btn { padding: 2px 7px; font-size: 10px; }
#content_sim .eph-dp-head .eph-btn:disabled { opacity: 0.35; cursor: default; }
#content_sim .eph-dp select,
#content_sim .eph-dp input[type="number"] {
    background: #0e151d;
    color: #d8e2ec;
    border: 1px solid #2a3645;
    border-radius: 3px;
    padding: 2px 3px;
    font-size: 11.5px;
}
#content_sim .eph-dp-head select { flex: 1 1 auto; }
#content_sim .eph-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
#content_sim .eph-dp-dow { text-align: center; font-size: 10px; color: #7fd1ff; padding: 2px 0; }
#content_sim .eph-dp-day {
    background: #121c27;
    color: #cfd8e0;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 3px 0;
    font-size: 11px;
    cursor: pointer;
}
#content_sim .eph-dp-day:hover { border-color: #6aa6e6; }
#content_sim .eph-dp-day.eph-dp-sel { background: #ffd479; color: #000; font-weight: bold; }
#content_sim .eph-dp-time { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 11.5px; color: #cfd8e0; }
#content_sim .eph-dp-time span { color: #7fd1ff; margin-right: 4px; }
#content_sim .eph-dp-time input { width: 44px; }
#content_sim .eph-dp-foot { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }

/* ---- 2D ground-track map panel ---- */
#content_sim .eph-map {
    background: #04070a;
    border-top: 1px solid #222;
    padding: 8px 10px 10px;
}
#content_sim .eph-map-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#content_sim .eph-map-head .eph-section { margin: 0; }
#content_sim .eph-map-opts { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #cfd8e0; }
#content_sim .eph-map-opts select {
    background: #0e151d;
    color: #d8e2ec;
    border: 1px solid #2a3645;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 11px;
}
#content_sim .eph-map-box {
    position: relative;
    width: 780px;
    height: 390px;
    overflow: hidden;
    border: 1px solid #2a3a4a;
    background: #000;
}
#content_sim .eph-map-box canvas { display: block; }
#content_sim .eph-map-sat {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    overflow: visible;
    filter: drop-shadow(0 0 2px #000);
}
#content_sim .eph-map-read { margin-top: 5px; font-size: 11.5px; color: #ffd479; white-space: pre; }
#content_sim .eph-map-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 11px; color: #cfd8e0; }
#content_sim .eph-map-legend i { display: inline-block; width: 14px; height: 3px; margin-right: 5px; vertical-align: middle; }

/* ---- TLE import ---- */
#content_sim .eph-tle-btns { display: flex; align-items: center; gap: 6px; }
#content_sim #ephTleFile { display: none; }
#content_sim #ephTleSel {
    display: none;
    max-width: 260px;
    background: #0e151d;
    color: #d8e2ec;
    border: 1px solid #2a3645;
    border-radius: 3px;
    padding: 3px 4px;
    font-size: 11px;
}
#content_sim #ephTleSel.eph-show { display: inline-block; }
#content_sim .eph-tle-msg { font-size: 11px; color: #9be15a; min-height: 0; margin-top: 4px; }
#content_sim .eph-tle-msg:empty { display: none; }
#content_sim .eph-tle-msg.eph-bad { color: #ff8a8a; }
