/* styles.css */

/* Full-screen layout & base font */
html, body {
  height: 100%;
  margin: 0;
  font-family: sans-serif;
}

/* App container: sidebar + main */
#app {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* ── Left Sidebar (was #toolbar) ───────────────────────── */
#sidebar {
  width: 80px;
  background: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0;
  box-sizing: border-box;
}
#sidebar button {
  margin: 8px 0;
  padding: 8px;
  width: 60px;
  color: #fff;
  background: #555;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#sidebar button:hover {
  background: #666;
}

/* ── Main content area ─────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Page header for “Task Title” */
#page-header {
  height: auto;
  background: #f1f1f1;
  display: flex;
  flex-direction: column;     /* stack title over bar */
  align-items: flex-start;    /* left‐align both */
  padding: 8px 16px;          /* give room top & bottom */
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  gap: 4px;                   /* space between title and bar */
}
#page-header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: #333;
}

/* Canvas wrapper */
#canvas {
  flex: 1;
  position: relative;
  background: #f7f7f7;
  overflow: hidden;
}

/* Your existing SVG layer */
#edge-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
}
#edge-layer line {
  stroke: #333;
  stroke-width: 2;
  pointer-events: all;
  cursor: pointer;
}
#edge-layer line:hover {
  stroke-width: 6;
}

/* ── Nodes ────────────────────────────────────────────── */
.node {
  position: absolute;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-radius: 4px;
  user-select: none;
  width: 140px;
  box-sizing: border-box;
  cursor: move;
}

/* Task nodes */
.node.task {
  background: #333;
  color: #f7f7f7;
}

/* Distraction nodes */
.node.dist {
  background: #fff;
  color: #000;
  /* ensure a bit of bottom padding so bar doesn’t overlap text */
  padding-bottom: 6px;
  position: absolute; /* for bar positioning */
}

/* Distraction color-bar pinned at bottom */
.node.dist .dist-bar {
  position: absolute;
  bottom: 0;
  left:   0;
  right:  0;
  height: 6px;
  cursor: pointer;
}

/* Status pill (tasks) */
.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  align-self: flex-end;
  margin-top: 4px;
  cursor: pointer;
  transition: transform .1s;
}
.status-indicator:hover {
  transform: scale(1.2);
}

/* Editable title */
.node-title {
  outline: none;
  white-space: normal;
  word-wrap: break-word;
}
.node-title:focus {
  outline: none;
}

/* Highlight when selected */
.node.selected {
  outline: 2px dashed #007bff;
}

#sidebar button#add-task {
  color: #2ecc71 !important;   /* green */
}
#sidebar button#add-dist {
  color: #f1c40f !important;   /* yellow */
}
#sidebar button#clear-all {
  color: #e74c3c !important;   /* red */
}

.node-details {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 4px;
  white-space: nowrap;
}

#xp-bar-container {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
#xp-bar {
  flex: 1;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  overflow: hidden;
}
#xp-bar-fill {
  width: 0%;
  height: 100%;
  background: #666;
  transition: width 0.3s ease;
}
#xp-bar-fill.complete {
  background: #2ecc71;
}
#xp-percent {
  font-size: 0.75rem;
  color: #333;
}