/* ============================================================
   layout.css — 1:1 from original LiveScatter3D/wwwroot/index.html
   ============================================================ */

/* Fixed 720p layout — scales down for smaller monitors */
#app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 720px;
  min-height: 720px;
  overflow: hidden;
}

html, body {
  height: 100%;
  min-height: 720px;
  overflow: hidden;
}

/* ── Header ── */
#header {
  display: flex; align-items: center; gap: 12px;
  height: 40px; padding: 0 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0; z-index: 10;
}
#header-title {
  font-size: 13px; font-weight: 700; color: var(--txt-main);
  letter-spacing: 0.01em; display: flex; align-items: center; gap: 8px;
}
#header-sep { flex: 1; }
#header-device-bar { display: flex; align-items: center; gap: 8px; }

#device-select-wrap { position: relative; }
#device-select-btn {
  display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px; color: var(--txt-main);
  cursor: pointer; white-space: nowrap; min-width: 200px;
  transition: background .12s, border-color .12s;
}
#device-select-btn:hover { background: #f0f4f8; border-color: #b8c8da; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--txt-muted); flex-shrink: 0; }
.conn-dot.ok  { background: var(--ok); }
.conn-dot.err { background: var(--error); }
#device-select-btn .device-name { flex: 1; text-align: left; }
#device-select-btn .chevron { font-size: 9px; color: var(--txt-muted); font-family: 'Segoe MDL2 Assets', sans-serif; }

#device-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  min-width: 240px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.10); z-index: 100; overflow: hidden;
}
#device-dropdown.open { display: block; }
.device-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 12px; color: var(--txt-main);
  cursor: pointer; transition: background .1s;
}
.device-dropdown-item:hover { background: #f5f7fa; }
.device-dropdown-sep { height: 1px; background: var(--line); margin: 4px 0; }
.device-dropdown-add {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 12px; color: var(--brand);
  font-weight: 600; cursor: pointer; transition: background .1s;
}
.device-dropdown-add:hover { background: #e7f1fb; }
.device-dropdown-forget {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; font-size: 11px; color: #888;
  cursor: pointer; transition: background .1s;
}
.device-dropdown-forget:hover { background: #fde8e8; color: #d13438; }

/* ── Body ── */
#body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

/* ── Sidebar ── */
#sidebar {
  width: 170px; flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.nav-group { display: flex; flex-direction: column; padding: 4px 0; }
.nav-sep { height: 1px; background: var(--line); margin: 2px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px 0 12px;
  font-size: 12px; color: var(--txt-soft);
  cursor: pointer; border-left: 3px solid transparent;
  transition: background .1s, color .1s;
  user-select: none; text-decoration: none;
}
.nav-item:hover { background: #f5f7fa; color: var(--txt-main); }
.nav-item.active {
  background: var(--brand-light); color: var(--brand);
  border-left-color: var(--brand); font-weight: 600;
}
.nav-item .nav-icon {
  font-family: 'Segoe MDL2 Assets', sans-serif;
  font-size: 14px; width: 18px; text-align: center; flex-shrink: 0;
}
.nav-item .nav-label { flex: 1; }
.nav-sub { display: none; flex-direction: column; }
.nav-sub.open { display: flex; }
.nav-sub .nav-item { height: 28px; padding-left: 32px; font-size: 11px; }

/* ── Content ── */
#content {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg-main);
}

/* ── Page ── */
.page { display: none; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }
.page.active { display: flex; }

/* ── Toolbar ── */
.toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.toolbar-sep { flex: 1; }
.toolbar-title {
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-soft);
}

/* ── Empty state ── */
#empty-state { display: flex; flex: 1; align-items: center; justify-content: center; }
.empty-card {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 32px 48px; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06); text-align: center;
}
.empty-card-icon { font-family: 'Segoe MDL2 Assets', sans-serif; font-size: 36px; color: var(--txt-muted); }
.empty-card-title { font-size: 13px; font-weight: 600; color: var(--txt-main); }
.empty-card-sub { font-size: 12px; color: var(--txt-muted); max-width: 280px; line-height: 1.5; }

/* ── Status bar ── */
#statusbar {
  height: 20px; display: flex; align-items: center; padding: 0 12px;
  background: var(--bg-card); border-top: 1px solid var(--line); flex-shrink: 0;
}
#statusbar-text { font-size: 11px; color: var(--txt-muted); }
