/* enterprise.css — Digital Twin Center · Enterprise Edition */

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

:root {
  --ent-bg:           #060b18;
  --ent-panel:        #0b1223;
  --ent-panel-2:      #101929;
  --ent-panel-3:      #152035;
  --ent-border:       rgba(148,163,184,0.08);
  --ent-border-2:     rgba(148,163,184,0.14);
  --ent-accent:       #3b82f6;
  --ent-accent-2:     #6366f1;
  --ent-accent-glow:  rgba(59,130,246,0.18);
  --ent-success:      #10b981;
  --ent-warning:      #f59e0b;
  --ent-error:        #ef4444;
  --ent-text-1:       #f1f5f9;
  --ent-text-2:       #94a3b8;
  --ent-text-3:       #475569;
  --ent-header-h:     54px;
  --ent-sidebar-w:    348px;
  --ent-toolbar-h:    38px;
}

/* ── Reset app layout ─────────────────────────────────────── */
* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Noto Sans KR', 'Segoe UI', sans-serif !important;
  background: var(--ent-bg) !important;
  color: var(--ent-text-1) !important;
  overflow: hidden;
  height: 100vh;
}

.app { display: flex; flex-direction: column; height: 100vh; }

/* Hide old layout elements */
.header,
.ent-header,
.panel-left,
.panel-right,
.chat-panel,
.footer,
.exec-progress,
.main-layout {
  display: none !important;
}

/* ── Enterprise Header ──────────────────────────────────────── */
.ent-header {
  height: var(--ent-header-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: linear-gradient(90deg, #080e1f 0%, #0c1428 60%, #0f1833 100%);
  border-bottom: 1px solid var(--ent-border);
  gap: 20px;
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}
.ent-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ent-accent), transparent);
  opacity: 0.4;
}

.ent-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.ent-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1d4ed8, #4f46e5);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 0 20px rgba(59,130,246,0.35);
  position: relative;
  overflow: hidden;
}
.ent-brand-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  border-radius: 10px;
}

.ent-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ent-text-1);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.ent-brand-sub {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--ent-text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.ent-header-divider {
  width: 1px; height: 28px;
  background: var(--ent-border-2);
  flex-shrink: 0;
}

.ent-header-center { flex: 1; display: flex; align-items: center; gap: 8px; }

.ent-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 20px;
  font-size: 10px; font-weight: 600;
  color: #93c5fd;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ent-badge-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #3b82f6;
  animation: entBlink 2s infinite;
}
@keyframes entBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.ent-header-right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.ent-status-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px;
  background: rgba(15,25,45,0.8);
  border: 1px solid var(--ent-border-2);
  border-radius: 20px;
  font-size: 10px; font-weight: 600;
  color: var(--ent-text-3);
  letter-spacing: 0.05em;
  transition: all 0.3s;
}
.ent-status-pill .status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ent-text-3);
  transition: background 0.3s, box-shadow 0.3s;
}
.ent-status-pill.connected {
  border-color: rgba(16,185,129,0.3);
  color: #6ee7b7;
}
.ent-status-pill.connected .status-dot {
  background: var(--ent-success);
  box-shadow: 0 0 8px var(--ent-success);
  animation: entPulse 2.5s infinite;
}
@keyframes entPulse { 0%,100%{box-shadow:0 0 6px var(--ent-success)} 50%{box-shadow:0 0 14px var(--ent-success)} }

.ent-reconnect-btn {
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid var(--ent-border-2);
  border-radius: 9px;
  color: var(--ent-text-3);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.ent-reconnect-btn:hover {
  background: var(--ent-accent-glow);
  border-color: var(--ent-accent);
  color: var(--ent-text-1);
}

/* ── Main Layout ────────────────────────────────────────────── */
.ent-main {
  display: flex;
  flex: 1;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* ── Scene Viewer ────────────────────────────────────────────── */
.ent-scene {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: #04080f;
}

.ent-scene-bar {
  height: var(--ent-toolbar-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(6,11,24,0.95);
  border-bottom: 1px solid var(--ent-border);
  gap: 12px;
  flex-shrink: 0;
}

.ent-scene-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--ent-text-3);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ent-scene-sep { flex: 1; }

.ent-scene-canvas {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Override scene-viewer.js container */
.ent-scene-canvas .scene-3d-container,
#scene3dContainer {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Minimap in scene */
.ent-scene-canvas .minimap-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 50;
  background: rgba(6,11,24,0.85);
  border: 1px solid var(--ent-border-2);
  border-radius: 10px;
  padding: 6px;
  backdrop-filter: blur(8px);
}

/* Exec progress pill (inline in scene bar) */
.ent-exec-pill {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 20px;
  font-size: 11px;
  color: #93c5fd;
}
.ent-exec-pill.active { display: flex; }
.ent-exec-spinner { animation: entSpin 1s linear infinite; display: inline-block; }
@keyframes entSpin { to { transform: rotate(360deg); } }

/* ── Right Sidebar ───────────────────────────────────────────── */
.ent-sidebar {
  width: var(--ent-sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--ent-panel);
  border-left: 1px solid var(--ent-border);
  overflow: hidden;
  position: relative;
}

.ent-sidebar-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--ent-border);
  background: var(--ent-panel);
}

.ent-stab {
  flex: 1;
  padding: 0 8px;
  height: 46px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ent-text-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  text-transform: uppercase;
}
.ent-stab:hover {
  color: var(--ent-text-2);
  background: rgba(255,255,255,0.02);
}
.ent-stab.active {
  color: var(--ent-accent);
  border-bottom-color: var(--ent-accent);
  background: rgba(59,130,246,0.06);
}
.ent-stab-icon { font-size: 15px; }

.ent-sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}
.ent-sidebar-body::-webkit-scrollbar { width: 4px; }
.ent-sidebar-body::-webkit-scrollbar-track { background: transparent; }
.ent-sidebar-body::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 2px; }

/* ── Override dc-sim & dtc-tour panel background/fonts ───────── */
.dcsim-panel,
.dtctour-panel {
  background: transparent !important;
  font-family: 'Inter', 'Noto Sans KR', sans-serif !important;
}

/* Override injected panel colors to match enterprise theme */
.dcsim-panel *,
.dtctour-panel * {
  --bg-0: var(--ent-panel) !important;
  --bg-1: var(--ent-panel-2) !important;
  --bg-2: var(--ent-panel-3) !important;
  --border: var(--ent-border) !important;
  --text-1: var(--ent-text-1) !important;
  --text-2: var(--ent-text-2) !important;
  --text-3: var(--ent-text-3) !important;
}

/* ── Scene view modes (keep from existing CSS) ───────────────── */
.screenshot-container { position: absolute; inset: 0; }
.scene-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--ent-text-3); gap: 12px;
}
.placeholder-icon { font-size: 48px; opacity: 0.4; }

/* ── Modals override ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed !important;
  z-index: 2000 !important;
}
