/* ========================================
   LUNETH OS — Official Color Scheme & Clean Layout
   Deep dark + cyan/purple accents (Nocturne aesthetic)
   ======================================== */

:root {
  --bg-deep: #000000;          /* Pure black base */
  --bg-panel: #0a0c14;         /* Very dark lifted panels */
  --bg-card: #11151f;          /* Slightly elevated cards */
  --accent-cyan: #5ab0ff;
  --accent-purple: #a070ff;
  --text-primary: #e7ecff;
  --text-secondary: #9fb3d4;
  --border: rgba(255,255,255,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Inter, system-ui, sans-serif;
}

html, body {
  height: 100%;
  background: #000000 !important;   /* Pure black */
  color: var(--text-primary);
  overflow: hidden;
}

/* === SHELL STRUCTURE === */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top Bar - Clean & Prominent */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  height: 60px;
  flex-shrink: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logo {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(90, 176, 255, 0.3), 
              0 0 20px rgba(90, 176, 255, 0.25);
  border: 1px solid rgba(90, 176, 255, 0.2);
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.topbar-center {
  font-size: 1rem;
  opacity: 0.7;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
}

/* Status elements */
.status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

/* Rook inside Luneth */
.rook-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(25, 32, 55, 0.8);
  border: 1px solid rgba(90, 176, 255, 0.3);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.8rem;
  color: #a8c4ff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rook-status:hover {
  border-color: var(--accent-cyan);
  background: rgba(30, 38, 65, 0.9);
}

.rook-logo-small {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
}

.rook-online {
  color: #5ee6b8;
  font-size: 9px;
}

/* === MAIN CONTAINER === */
.main-container {
  display: flex;
  flex: 1;
  min-height: 0; /* Critical for flex children */
}

/* Sidebar - Clean Navigation */
.sidebar {
  width: 230px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar nav button {
  text-align: left;
  padding: 11px 16px;
  border-radius: 8px;
  background: transparent;
  color: #c5d1f0;
  border: none;
  font-size: 0.93rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar nav button:hover {
  background: rgba(255,255,255,0.035);
}

.sidebar nav button.active {
  background: rgba(90, 176, 255, 0.15);
  color: #fff;
  font-weight: 500;
}

/* Sidebar icon for modules like Nocturne */
.sidebar-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 3px;
  object-fit: cover;
}

/* Coming soon styling for Nocturne */
.sidebar nav button[data-view="nocturne-audio"] {
  opacity: 0.75;
  font-style: italic;
}

/* Workspace */
.workspace {
  flex: 1;
  padding: 20px;
  overflow: auto;
  background: #000000 !important;   /* Pure black */
  display: flex;
  flex-direction: column;
}

/* OS Content Views */
.os-view {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.os-view h2 {
  margin-bottom: 16px;
  font-size: 1.3rem;
  color: var(--text-primary);
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.dash-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  color: var(--accent-cyan);
}

/* Visual Logic Canvas Area */
.visual-logic-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vl-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.vl-toolbar button {
  background: #0a0c14;
  color: #c5d1f0;
  border: 1px solid rgba(90, 176, 255, 0.25);
  padding: 7px 13px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
}

.vl-hint {
  opacity: 0.5;
  font-size: 0.8rem;
  margin-left: auto;
}

.node-canvas {
  flex: 1;
  min-height: 400px;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  background-image: 
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

.logic-node {
  position: absolute;
  min-width: 150px;
  background: #0f121b;
  border: 1px solid #3a4a6e;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  cursor: grab;
  user-select: none;
  z-index: 10;
}

.logic-node.selected {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(90, 176, 255, 0.4);
}

.logic-node .node-header {
  padding: 6px 12px;
  background: #24314f;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 9px 9px 0 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logic-node .node-body {
  padding: 10px 12px;
  font-size: 0.9rem;
}

.connection-line {
  position: absolute;
  height: 2px;
  background: var(--accent-cyan);
  opacity: 0.6;
  transform-origin: left center;
  pointer-events: none;
  z-index: 5;
}

.node-inspector {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 260px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  font-size: 0.88rem;
  z-index: 20;
}

/* Utility */
button {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:hover {
  background: rgba(90, 176, 255, 0.15);
  border-color: var(--accent-cyan);
}

.hint {
  opacity: 0.5;
  font-size: 0.82rem;
  margin-top: 20px;
}

/* Clean navigation feel */
.asset-folder, .scene-item {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}