/* ─────────────────────────────────────────────────────────────────────────────
   PyViz3D Layout — Grid, Flex utilities, App shell
   ───────────────────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════════
   Flex utilities
   ═══════════════════════════════════════════════════════════════════════════════ */

.flex           { display: flex; }
.flex-col       { display: flex; flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.flex-1         { flex: 1; }
.flex-none      { flex: none; }

.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.items-stretch  { align-items: stretch; }

.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }

.gap-1  { gap: var(--space-1); }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ═══════════════════════════════════════════════════════════════════════════════
   Grid utilities
   ═══════════════════════════════════════════════════════════════════════════════ */

.grid           { display: grid; }
.grid-2         { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3         { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4         { display: grid; grid-template-columns: repeat(4, 1fr); }
.grid-auto      { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ═══════════════════════════════════════════════════════════════════════════════
   App Shell Layout (viewer + showcase pages)
   ═══════════════════════════════════════════════════════════════════════════════ */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-primary);
}

/* ── Toolbar ────────────────────────────────────────────────────────────── */

.toolbar {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-3);
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-toolbar);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-logo {
  font-size: 15px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  margin-right: var(--space-2);
  white-space: nowrap;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 var(--space-2);
  flex-shrink: 0;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── Main Content Area ─────────────────────────────────────────────────── */

.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Canvas Area ──────────────────────────────────────────────────────── */

.canvas-area {
  flex: 1;
  position: relative;
  background: var(--bg-secondary);
  overflow: hidden;
  min-width: 0;
}

.canvas-area canvas {
  position: absolute;
  inset: 0;
}

.canvas-hint {
  position: absolute;
  bottom: var(--space-3);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

/* ── Side Panel ────────────────────────────────────────────────────────── */

.side-panel {
  width: var(--panel-width);
  flex-shrink: 0;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.side-panel-left {
  border-left: none;
  border-right: 1px solid var(--border);
}

.side-panel::-webkit-scrollbar { width: 3px; }
.side-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

/* ── Panel Section ────────────────────────────────────────────────────── */

.panel-section {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-section:last-child {
  border-bottom: none;
}

.panel-section-title {
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ── Status Bar ────────────────────────────────────────────────────────── */

.status-bar {
  height: 28px;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-3);
  background: rgba(8, 8, 16, 0.95);
  border-top: 1px solid var(--border);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
  flex-wrap: wrap;
  overflow: hidden;
}

.status-bar .status-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  white-space: nowrap;
}

.status-bar .status-item .val {
  color: var(--text-secondary);
}

.status-sep {
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
}

/* ── Param Slider Row ──────────────────────────────────────────────────── */

.param-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.param-row:last-child {
  border-bottom: none;
}
.param-row label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
}
.param-row input[type="range"] {
  width: 80px;
  flex-shrink: 0;
}
.param-row .val {
  font-size: var(--font-size-xs);
  color: var(--accent);
  font-family: var(--font-mono);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Feature Toggle Row ─────────────────────────────────────────────────── */

.feature-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.feature-row:last-child {
  border-bottom: none;
}
.feature-row label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Landing Page Layout
   ═══════════════════════════════════════════════════════════════════════════════ */

.page-landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.nav-bar {
  height: var(--toolbar-height);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
  background: rgba(8, 8, 16, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: var(--z-toolbar);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.nav-link {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-sans);
}
.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.hero-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 640px;
  padding: var(--space-8);
}

.hero-cta {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--space-6);
}
