/* ══════════════════════════════════════════════
   QOSE ECHO — style.css
   Same Qontra brand palette as Reborn/Brutal:
   Deep Navy #000000 | Cyan #00C2FF | Near Black #000000 | Soft White #FFFFFF
   v1.0 — first build
   ══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Rajdhani:wght@500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #000000;
  --graph:  #2A2F36;
  --cyan:   #00C2FF;
  --black:  #000000;
  --white:  #FFFFFF;
  --green:  #00FF88;
  --amber:  #FF8C00;
  --red:    #FF4444;
  --border: rgba(0,194,255,0.18);
  --panel-bg: rgba(0,0,0,0.94);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
  background: var(--black);
  color: var(--white);
  font-size: 13px;
}

/* ---------- Auth gate (identical pattern to CAD Inspector) ---------- */
#auth-gate {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: var(--black);
}
.gate-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(0,194,255,0.2); border-top-color: var(--cyan);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gate-card {
  text-align: center; padding: 32px; max-width: 340px;
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: 8px;
}
.gate-mark {
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 28px;
  color: var(--cyan); margin-bottom: 12px;
}
.gate-title { font-size: 16px; margin-bottom: 8px; color: var(--white); }
.gate-sub { font-size: 12px; color: #8fa8bf; margin-bottom: 20px; line-height: 1.5; }
.gate-btn {
  display: inline-block; padding: 8px 20px; border: 1px solid var(--cyan);
  color: var(--cyan); text-decoration: none; border-radius: 4px; font-size: 12px;
}
.gate-btn:hover { background: rgba(0,194,255,0.1); }

/* ---------- App root ---------- */
#app-root { display: none; width: 100%; height: 100%; flex-direction: column; }

#topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.6);
}
#brand { display: flex; align-items: center; gap: 10px; }
.brand-logo{ height:38px; width:auto; max-width:270px; object-fit:contain; }
#topbar-right { display: flex; align-items: center; gap: 16px; font-size: 12px; }
#topbar-right a { color: var(--white); text-decoration: none; opacity: 0.75; }
#topbar-right a:hover { opacity: 1; color: var(--cyan); }

/* ---------- File drop zone ---------- */
#file-drop-zone {
  flex: 1; display: none; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; cursor: pointer; margin: 24px;
}
/* .drop-box carries the dashed border and drop-target visuals — kept
   separate from #file-drop-zone itself so the Pulse download link (a
   direct child of #file-drop-zone, below) renders outside the box
   instead of looking like part of the drop target. */
.drop-box {
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px; padding: 32px 40px;
  border: 2px dashed rgba(0,194,255,0.25); border-radius: 10px;
  transition: border-color 0.2s, background 0.2s;
}
#file-drop-zone.drag-over .drop-box { border-color: var(--cyan); background: rgba(0,194,255,0.05); }
.drop-box .drop-icon { font-size: 40px; opacity: 0.6; }
.drop-box .drop-title { font-size: 15px; color: var(--white); }
.drop-box .drop-sub { font-size: 12px; color: #8fa8bf; }
.pulse-download-link {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11px; color: var(--cyan); text-decoration: none;
  border: 1px solid var(--border); border-radius: 4px; padding: 6px 12px;
}
.pulse-download-link:hover { background: rgba(0,194,255,0.08); }
.pulse-download-link.outside { margin-top: 0; }

#load-error {
  display: none; color: var(--red); font-size: 12px; margin-top: 8px;
  max-width: 400px; text-align: center;
}

.echo-cloud-status {
  font-size: 11px; color: #8fa8bf; margin-top: 6px; max-width: 400px; text-align: center;
}
.echo-cloud-status.ok { color: #7fffb0; }
.echo-cloud-status.fail { color: var(--red); }
#btn-push-cloud { color: #7fffb0; border-color: rgba(127,255,176,0.3); }
#btn-push-cloud:hover { background: rgba(127,255,176,0.08); }

/* ---------- Viewer layout ---------- */
#viewer-root { display: none; flex: 1; overflow: hidden; }

#sidebar {
  width: 220px; border-right: 1px solid var(--border);
  padding: 14px; overflow-y: auto; flex-shrink: 0;
}
#sidebar h3 {
  font-size: 11px; letter-spacing: 0.08em; color: #8fa8bf;
  margin: 16px 0 8px; text-transform: uppercase;
}
#sidebar h3:first-child { margin-top: 0; }
#run-filename { font-size: 12px; color: var(--cyan); word-break: break-all; }
#run-summary { font-size: 11px; color: #8fa8bf; margin-top: 4px; }

.load-new-btn {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  width: 100%; padding: 6px 8px; font-size: 11px; font-family: inherit;
  background: transparent; color: var(--cyan); border: 1px solid var(--border);
  border-radius: 4px; cursor: pointer; text-align: left;
}
.load-new-btn:hover { background: rgba(0,194,255,0.08); }

#btn-play svg { color: var(--cyan); display: block; }

.field-check {
  display: block; font-size: 12px; padding: 3px 0; cursor: pointer;
  color: var(--white);
}
.field-check input { margin-right: 6px; }

#viewer3d-toggle-wrap { display: none; margin-top: 8px; font-size: 12px; }

#readout-table { width: 100%; border-collapse: collapse; font-size: 11px; }
#readout-table td { padding: 3px 0; border-bottom: 1px solid rgba(0,194,255,0.08); }
.readout-key { color: #8fa8bf; }
.readout-value { color: var(--green); text-align: right; }

#main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

#graphs-container {
  flex: 1; overflow-y: auto; padding: 14px; display: flex;
  flex-direction: column; gap: 10px;
}
.graph-wrap {
  height: 110px; background: rgba(0,0,0,0.35);
  border: 1px solid var(--border); border-radius: 4px;
}
.graph-wrap canvas { width: 100%; height: 100%; display: block; }

#viewer3d-container {
  display: none; height: 260px; border-top: 1px solid var(--border);
}

/* ---------- Transport controls ---------- */
#transport {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.6);
}
#btn-play {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--cyan); background: transparent; color: var(--cyan);
  font-size: 14px; cursor: pointer;
}
#btn-play:hover { background: rgba(0,194,255,0.1); }
#scrubber { flex: 1; accent-color: var(--cyan); }
#time-readout { font-size: 12px; color: var(--white); white-space: nowrap; min-width: 150px; }
#speed-select {
  background: var(--black); color: var(--white); border: 1px solid var(--border);
  border-radius: 4px; padding: 4px 8px; font-family: inherit; font-size: 12px;
}

.ui-icon{width:13px;height:13px;object-fit:contain;vertical-align:-2px;margin-right:3px;}
.ui-icon.close{width:11px;height:11px;margin-right:0;opacity:0.7;cursor:pointer;}
.ui-icon.close:hover{opacity:1;}

/* ══════════════════════════════════════════════
   RELAY — host panel, join overlay, live banner
   ══════════════════════════════════════════════ */
.echo-relay-backdrop{
  position:fixed; inset:0; background:rgba(0,0,0,0.75); z-index:900;
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.echo-relay-card{
  width:100%; max-width:360px; background:#0a0e14; border:1px solid var(--border);
  border-radius:6px; padding:16px; font-family:'JetBrains Mono',monospace; font-size:11px;
}
.echo-relay-head{
  display:flex; justify-content:space-between; align-items:center;
  font-size:13px; color:var(--cyan); margin-bottom:12px; font-weight:600;
}
.echo-relay-label{ display:block; font-size:9px; opacity:0.5; margin-bottom:4px; }
.echo-relay-input{
  width:100%; background:transparent; border:1px solid var(--border); border-radius:4px;
  color:#fff; padding:6px 8px; font-family:inherit; font-size:11px; margin-bottom:4px;
}
.echo-relay-pill{
  flex:1; text-align:center; padding:5px 0; border:1px solid var(--border); border-radius:4px;
  cursor:pointer; opacity:0.6; font-size:10px;
}
.echo-relay-pill.sel{ border-color:var(--cyan); color:var(--cyan); opacity:1; }
.echo-relay-btn{
  background:transparent; border:1px solid var(--cyan); color:var(--cyan); border-radius:4px;
  padding:7px 10px; font-family:inherit; font-size:11px; cursor:pointer;
}
.echo-relay-btn:hover{ background:rgba(0,194,255,0.08); }
.echo-relay-btn.small{ padding:2px 8px; font-size:11px; }
.echo-relay-btn:disabled{ opacity:0.5; cursor:default; }
.echo-relay-row{
  display:flex; justify-content:space-between; align-items:center;
  padding:5px 0; border-bottom:1px solid rgba(255,255,255,0.06); font-size:10px;
}
.echo-relay-empty{ opacity:0.4; font-size:10px; padding:6px 0; }
#echo-relay-live-banner{
  position:fixed; top:0; left:0; right:0; z-index:950;
  background:rgba(255,68,68,0.12); border-bottom:1px solid var(--red);
  color:var(--red); font-family:'JetBrains Mono',monospace; font-size:11px;
  text-align:center; padding:6px 0; letter-spacing:0.5px;
}
body.relay-live-watching #sidebar,
body.relay-live-watching #transport{ pointer-events:none; opacity:0.55; }

