/* =============================================================================
   ZOTH STUDIO — WEBGEN MASTER POSTER & WORKSTATION (v5.5)
   Clean unified navbar, full-viewport split stage, zero broken logos/artifacts.
   ============================================================================= */

@import url("/assets/zoth-theme.css");

:root {
  --webgen-bg: var(--bg, #050508);
  --webgen-surface: var(--surface, rgba(8, 12, 24, 0.94));
  --webgen-line: var(--line, rgba(232, 200, 114, 0.2));
  --webgen-gold: var(--gold, #fbbf24);
  --webgen-cyan: var(--cyan, #00f0ff);
  --webgen-text: var(--text-primary, #ffffff);
  --webgen-mute: var(--text-subhead, #94a3b8);
  
  --font-display: "Syne", system-ui, sans-serif;
  --font-sans: "Figtree", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, monospace;
}

body {
  background: var(--webgen-bg);
  color: var(--webgen-text);
  font-family: var(--font-sans);
  margin: 0;
  padding-top: calc(var(--zoth-header-h, 54px) + var(--zoth-ribbon, 0px));
  min-height: 100vh;
  overflow-x: hidden;
}

/* Master Alchemical Workstation Stage */
.webgen-hero-stage {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  min-height: calc(100svh - var(--zoth-header-h, 54px));
  display: grid;
  grid-template-columns: minmax(24rem, 38rem) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

@media (max-width: 1050px) {
  .webgen-hero-stage {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* Left Console & Ducky Keystroke Foundry */
.webgen-console-card {
  background: var(--webgen-surface);
  border: 1px solid var(--webgen-line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.webgen-console-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--webgen-cyan), var(--webgen-gold), transparent);
}

.webgen-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--webgen-gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.webgen-kicker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--webgen-cyan);
  box-shadow: 0 0 10px var(--webgen-cyan);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.webgen-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--webgen-text);
  margin: 0;
}

.webgen-lede {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--webgen-mute);
  margin: 0;
}

.webgen-field-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.webgen-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--webgen-gold);
}

.webgen-input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--webgen-line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--webgen-text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.webgen-input:focus {
  border-color: var(--webgen-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.webgen-textarea {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--webgen-line);
  border-radius: 10px;
  padding: 14px;
  color: var(--webgen-text);
  font-size: 0.92rem;
  line-height: 1.55;
  outline: none;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.webgen-textarea:focus {
  border-color: var(--webgen-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.webgen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.webgen-chip {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--webgen-line);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  color: var(--webgen-mute);
  transition: all 0.2s ease;
}

.webgen-chip:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--webgen-cyan);
  color: #ffffff;
}

.webgen-btn-launch {
  background: linear-gradient(135deg, var(--webgen-gold) 0%, #f59e0b 60%, var(--webgen-cyan) 100%);
  color: #050508;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  padding: 15px 22px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.35);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.webgen-btn-launch:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 8px 28px rgba(251, 191, 36, 0.55);
}

/* Tracked Active Terminals Tray & Quick Switcher */
.webgen-sessions-tray {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 4px;
}

.webgen-sessions-tray::-webkit-scrollbar {
  width: 5px;
}
.webgen-sessions-tray::-webkit-scrollbar-thumb {
  background: var(--webgen-line);
  border-radius: 4px;
}

.webgen-session-item {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--webgen-line);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.webgen-session-item:hover,
.webgen-session-item.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--webgen-cyan);
}

.webgen-session-item.active {
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}

.webgen-session-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
}

.webgen-session-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--webgen-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.webgen-session-prompt {
  font-size: 0.68rem;
  color: var(--webgen-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 270px;
}

.webgen-live-badge {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.webgen-live-badge.live {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.webgen-live-badge.saved {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Terminal Screen HUD & Cyberpunk Neon Scanline FX */
.webgen-hud-box {
  background: #01040a;
  border: 1px solid var(--webgen-line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 240, 255, 0.05);
  position: relative;
}

.webgen-hud-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 6px 100%;
  opacity: 0.6;
}

.webgen-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--webgen-cyan);
  border-bottom: 1px solid var(--webgen-line);
  padding-bottom: 8px;
}

/* Xterm Viewport Frame */
#zothXtermContainer {
  width: 100%;
  height: 240px;
  background: #000000 !important;
  border-radius: 8px;
  overflow: hidden;
  padding: 8px 10px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.08);
}

.xterm .xterm-viewport {
  background-color: transparent !important;
}

.xterm .xterm-screen canvas {
  filter: drop-shadow(0 0 2px rgba(0, 240, 255, 0.35));
}

/* Right Stage Preview Viewport */
.webgen-preview-viewport {
  background: var(--webgen-surface);
  border: 1px solid var(--webgen-line);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  height: calc(100svh - var(--zoth-header-h, 54px) - 40px);
  position: relative;
}

.webgen-preview-header {
  background: rgba(6, 9, 18, 0.95);
  border-bottom: 1px solid var(--webgen-line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.webgen-url-pill {
  flex: 1;
  background: #010409;
  border: 1px solid var(--webgen-line);
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--webgen-cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.webgen-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}


/* Three.js Kinetic Synthesis Overlay & Real-Time Log Feeder */
.webgen-loading-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(10, 15, 30, 0.96) 0%, rgba(2, 4, 10, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
  box-sizing: border-box;
}

.webgen-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.webgen-three-canvas-wrap {
  width: 220px;
  height: 220px;
  position: relative;
  margin-bottom: 12px;
}

.webgen-three-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50%;
  filter: drop-shadow(0 0 24px rgba(0, 240, 255, 0.4));
}

.webgen-progress-card {
  width: 100%;
  max-width: 480px;
  background: rgba(4, 7, 16, 0.85);
  border: 1px solid var(--webgen-line);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.1);
  position: relative;
}

.webgen-progress-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--webgen-cyan), var(--webgen-gold), transparent);
}

.webgen-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.webgen-progress-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}

.webgen-progress-pct {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--webgen-gold);
}

.webgen-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.webgen-progress-fill {
  height: 100%;
  width: 12%;
  background: linear-gradient(90deg, var(--webgen-cyan) 0%, var(--webgen-gold) 100%);
  border-radius: 999px;
  box-shadow: 0 0 12px var(--webgen-cyan);
  transition: width 0.4s ease;
}

.webgen-log-ticker {
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--webgen-cyan);
  line-height: 1.4;
  height: 38px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Theme Patches */
html[data-theme="light"] {
  --webgen-bg: #f7f4ee;
  --webgen-surface: #ffffff;
  --webgen-line: rgba(0, 0, 0, 0.12);
  --webgen-text: #050508;
  --webgen-mute: #64748b;
  --webgen-gold: #b45309;
  --webgen-cyan: #0284c7;
}

html[data-theme="light"] .webgen-input,
html[data-theme="light"] .webgen-textarea {
  background: #f8fafc;
  color: #050508;
}

html[data-theme="light"] .webgen-preview-header {
  background: #f1f5f9;
}

html[data-theme="matrix"] {
  --webgen-cyan: #00ff66;
  --webgen-gold: #00ff66;
  --webgen-surface: #021206;
  --webgen-bg: #000802;
}

html[data-theme="gold"] {
  --webgen-cyan: #fbbf24;
  --webgen-gold: #f59e0b;
  --webgen-surface: #100c06;
  --webgen-bg: #060402;
}
