body {
  font-family: Arial, sans-serif;
  background: #111;
  color: white;
  margin: 0;
  padding: 0;
  /* Reserve space for fixed footer so content is not hidden */
  padding-bottom: 56px;
}

h1 {
  color: #e6f6ff;
  font-weight: 800;
  letter-spacing: -0.5px;
}

/* App layout */
#app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

#sidebar {
  border-right: 1px solid #222;
  padding: 16px;
  background: #0f0f0f;
  overflow-y: auto;
}

#main {
  padding: 20px 24px;
  overflow-y: auto;
}

.site-footer {
  text-align: center;
  padding: 14px 12px;
  color: #9aa3ad;
  font-size: 12px;
  border-top: 1px solid #1c1c1c;
  background: #0f0f0f;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: none;
}

/* Sidebar styles */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-header h2 {
  font-size: 18px;
  margin: 0;
  color: #e6f6ff;
}

#createRoadmapBtn {
  padding: 6px 10px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

#createRoadmapBtn:hover {
  background: #1d4ed8;
}

#roadmapList {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

#roadmapList li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.2s ease;
}

#roadmapList li:hover {
  background: #1f2937;
}

#roadmapList li.active {
  background: #3b5bfd;
  color: #fff;
}

.sidebar-actions {
  border-top: 1px solid #222;
  padding-top: 12px;
}

.sidebar-actions button {
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #1f2937;
  color: #eaeaea;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-actions button:hover {
  background: #273244;
}

#deleteRoadmapBtn {
  width: 100%;
  padding: 8px 12px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

#deleteRoadmapBtn:hover {
  background: #dc2626;
}

/* Center the tree area */
#tree {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10px;
}

/* UL/LI based tree with connectors */
.tree,
.tree ul {
  padding-top: 20px;
  position: relative;
  transition: all 0.5s;
  padding-left: 0;
  list-style: none;
  text-align: center;
}

.tree li {
  display: inline-block;
  vertical-align: top;
  text-align: center;
  position: relative;
  padding: 20px 12px 0 12px;
}

/* Draw the horizontal connectors to siblings */
.tree li::before,
.tree li::after {
  content: "";
  position: absolute;
  top: 0;
  border-top: 2px solid #3a3a3a;
  width: 50%;
  height: 20px;
}

.tree li::before {
  right: 50%;
}
.tree li::after {
  left: 50%;
  border-left: 0;
}

/* Remove connectors from single child */
.tree li:only-child::before,
.tree li:only-child::after {
  display: none;
}

/* Remove left connector from first child and right from last */
.tree li:first-child::before {
  border: 0 none;
}
.tree li:last-child::after {
  border: 0 none;
}

/* Draw the vertical connector down to children */
.tree li ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-left: 2px solid #3a3a3a;
  width: 0;
  height: 20px;
}

/* Node pill */
.node-box {
  display: inline-flex;
  align-items: center;
  background: #3b5bfd;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(59, 91, 253, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  min-width: 160px;
}

/* Layout inside node: title + action buttons */
.node-title {
  pointer-events: none;
  flex: 1;
}

.node-actions {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}

.action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #ffffff;
  font-size: 12px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.edit-btn:hover {
  background: rgba(59, 130, 246, 0.3);
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.note-btn:hover {
  background: rgba(245, 158, 11, 0.3);
}

.node-box.has-note {
  box-shadow: 0 6px 22px rgba(255, 215, 0, 0.25),
    0 6px 20px rgba(59, 91, 253, 0.35);
}

/* Tooltip for notes */
.note-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% + 10px);
  background: #1b1b1b;
  color: #eaeaea;
  border: 1px solid #2b2b2b;
  padding: 8px 10px;
  border-radius: 8px;
  white-space: pre-wrap;
  min-width: 220px;
  max-width: 320px;
  text-align: left;
  z-index: 5;
}

.node-box:hover .note-tooltip {
  display: block;
}

.node-box:hover {
  background: #2f49d8;
  transform: translateY(-1px);
}

/* Form styles */
input[type="text"],
select,
button {
  background: #1a1a1a;
  color: #eaeaea;
  border: 1px solid #2b2b2b;
  border-radius: 8px;
  padding: 10px 12px;
}

button {
  background: #0bbf72;
  border: none;
  color: #03150d;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(11, 191, 114, 0.35);
}

button:hover {
  filter: brightness(1.05);
}
