/* Global layout utilities for the Lit SPA */

/* Material Symbols — matches shared.js iconStyles for light DOM */
.icon, .material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  user-select: none;
}
.icon.light {
  font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
  color: #bbb;
}

/* Prevent body-level scrollbar — only content areas should scroll */
html, body {
  height: 100%;
  overflow: hidden;
}

/* Body layout: topbar (full width) above main area (content + panels) */
body {
  display: flex;
  flex-direction: column;
  background: var(--cx-bg-deep, #18181b);
}

/* ── Three-column shell: left-pane | content | right-pane ── */
#main {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

#left-pane {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--cx-bg, #1e1e22);
}

/* Hide left-pane + its resize-handle when empty (login, etc.) */
#left-pane:empty { display: none; }
#left-pane:empty + #left-resize { display: none; }

#main > #app {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--cx-bg-deep, #18181b);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: hsl(var(--app-border));
  border-radius: var(--app-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--app-foreground-muted));
}

/* ── Settings nav in #left-pane (light DOM) ── */
.settings-nav-shell {
  padding: 1rem 0;
  font-family: var(--cx-font-body, sans-serif);
}
.settings-nav-shell .nav-back {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 20px; font-size: 0.78rem; font-weight: 500;
  color: var(--cx-text-muted, #6b6b78); cursor: pointer;
  border: none; background: none; font-family: inherit;
  width: 100%; text-align: left; transition: color 0.15s; margin-bottom: 4px;
}
.settings-nav-shell .nav-back:hover { color: var(--cx-text, #e8e8ec); }
.settings-nav-shell .settings-nav-section {
  padding: 8px 20px 6px; font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--cx-text-muted, #6b6b78); font-weight: 700;
}
.settings-nav-shell .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 20px; font-size: 0.82rem; font-weight: 500;
  color: var(--cx-text-secondary, #9d9da8); cursor: pointer;
  border: none; background: none; font-family: inherit;
  width: 100%; text-align: left; transition: all 0.15s;
}
.settings-nav-shell .nav-item:hover {
  color: var(--cx-text, #e8e8ec); background: var(--cx-bg-elevated, #26262c);
}
.settings-nav-shell .nav-item.active {
  color: var(--cx-accent, #f6c944); background: var(--cx-accent-bg, rgba(246,201,68,0.08));
}

/* Utility: visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
