/* ═══════════════════════════════════════════════════════════
   ORGANISER — Project Map + Hub
   GeniusHub v21 — Redesign
   Ruhig, kein Glassmorphism, keine Gradients.
   ═══════════════════════════════════════════════════════════ */

/* ── Overview Bar ── */
.org-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-0);
  padding: 4px 0 10px;
}

/* ── Canvas ── */
.org-canvas-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 170px);
  height: calc(100dvh - 170px);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  touch-action: none;
}
.org-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.org-canvas.panning { cursor: grabbing; }

/* ═══════════════════════════════════════════════════════════
   PROJECT HUB
   ═══════════════════════════════════════════════════════════ */
.org-hub-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-0);
}
.org-hub-title {
  font-family: var(--f-sans);
  font-size: clamp(16px, 3.5vw, 20px);
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
}
.org-hub-status {
  font-size: 10px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: .08em;
  flex-shrink: 0;
  border: 1px solid var(--line);
  color: var(--fg-dim);
}


/* ── Hub Tabs ── */
.org-hub-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 48px;
  z-index: 9;
  background: var(--bg-0);
}
.org-hub-tabs::-webkit-scrollbar { display: none; }
.org-htab {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  border: 1px solid transparent;
  background: none;
  border-radius: var(--r-md);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
  font-family: var(--f-sans);
}
.org-htab:hover { color: var(--fg); background: var(--bg-2); }
.org-htab.on {
  color: var(--accent);
  background: var(--accent-weak);
  border-color: var(--accent-ring);
}


/* ── Hub Content ── */
.org-hub-content { min-height: 300px; }


/* ── Vertical Timeline Roadmap ── */
.org-timeline { display: flex; flex-direction: column; }
.org-tl-item {
  display: flex;
  gap: 14px;
  cursor: pointer;
}
.org-tl-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 20px;
  padding-top: 4px;
}
.org-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  z-index: 1;
  background: var(--accent);
  border: 2px solid var(--bg-0);
  box-shadow: 0 0 0 1px var(--line);
}
.org-tl-line {
  width: 2px;
  flex: 1;
  background: var(--line);
  margin: 4px 0;
  min-height: 20px;
}
.org-tl-card {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color var(--dur-1) var(--ease);
}
.org-tl-item:hover .org-tl-card { border-color: var(--line-2); }
.org-tl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.org-tl-title { font-size: 13px; font-weight: 600; color: var(--fg); }
.org-tl-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--r-sm);
  text-transform: uppercase;
  letter-spacing: .08em;
  flex-shrink: 0;
  border: 1px solid var(--line);
  color: var(--fg-dim);
}
.org-tl-desc { font-size: 12px; color: var(--fg-muted); line-height: 1.6; }
.org-tl-hint {
  font-size: 10px;
  color: var(--fg-dim);
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease);
  margin-top: 4px;
}
.org-tl-item:hover .org-tl-hint { opacity: 1; }
.org-rm-add {
  border: 1px dashed var(--line-2);
  background: none;
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--fg-dim);
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  font-family: var(--f-sans);
}
.org-rm-add:hover { border-color: var(--accent); color: var(--accent); }


/* ── Touch Action Bar ── */
.org-action-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  z-index: 6;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .3);
}
html.white-mode .org-action-bar { box-shadow: 0 12px 24px rgba(15, 23, 42, .12); }

.org-act-btn {
  padding: 7px 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  color: var(--fg);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  font-family: var(--f-sans);
}
.org-act-btn:hover { background: var(--bg-2); border-color: var(--line); }
.org-act-open {
  background: var(--accent-weak);
  border-color: var(--accent-ring);
  color: var(--accent);
}
.org-act-open:hover { background: var(--accent-weak); border-color: var(--accent); }
.org-act-danger { color: var(--err); }
.org-act-danger:hover {
  background: color-mix(in oklab, var(--err) 10%, transparent);
  border-color: color-mix(in oklab, var(--err) 30%, var(--line));
}
.org-act-dim { color: var(--fg-dim); }


/* ── Floating Action Buttons ── */
.org-fab {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 5;
}
.org-fab-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
html.white-mode .org-fab-btn { box-shadow: 0 8px 20px rgba(15, 23, 42, .1); }
.org-fab-btn:hover {
  border-color: var(--line-2);
  background: var(--bg-2);
}
.org-fab-primary {
  background: var(--accent);
  color: #0b0c0e;
  border-color: var(--accent);
  font-size: 22px;
  font-weight: 300;
}
.org-fab-primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
  border-color: var(--accent);
}


/* ── Todos ── */
.org-todo-add {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.org-todo-add input { flex: 1; font-size: 13px; }
.org-todo-list { display: flex; flex-direction: column; gap: 4px; }
.org-todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--fg);
  transition: border-color var(--dur-1) var(--ease);
}
.org-todo-item:hover { border-color: var(--line-2); }
.org-todo-item.done { opacity: .55; }
.org-todo-item.done span { text-decoration: line-through; }
.org-todo-check {
  width: 18px;
  height: 18px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-2);
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: all var(--dur-1) var(--ease);
}
.org-todo-item.done .org-todo-check {
  border-color: var(--ok);
  background: color-mix(in oklab, var(--ok) 18%, transparent);
  color: var(--ok);
}
.org-todo-del {
  margin-left: auto;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 11px;
  opacity: 0;
  transition: opacity var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.org-todo-item:hover .org-todo-del { opacity: 1; }
.org-todo-del:hover { color: var(--err); border-color: color-mix(in oklab, var(--err) 40%, var(--line)); }


/* ── Notes ── */
.org-notes-area {
  width: 100%;
  min-height: 200px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  color: var(--fg);
  font-size: 13px;
  font-family: var(--f-sans);
  line-height: 1.7;
  resize: vertical;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.org-notes-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.org-notes-saved {
  font-size: 10px;
  color: var(--fg-dim);
  margin-top: 6px;
  text-align: right;
  font-family: var(--f-mono);
}


/* ── Mini Tree ── */
.org-mini-tree-wrap {
  width: 100%;
  height: 400px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  touch-action: none;
}


/* ── Node Edit Modal ── */
.org-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emFade .18s var(--ease) both;
}
.org-modal {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  width: 380px;
  max-width: 92vw;
  box-shadow: 0 24px 48px rgba(0, 0, 0, .35);
  color: var(--fg);
  font-family: var(--f-sans);
  animation: emSlideUp .22s var(--ease) both;
}
html.white-mode .org-modal { box-shadow: 0 24px 48px rgba(15, 23, 42, .12); }


/* ── Empty ── */
.org-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--fg-dim);
  font-size: 13px;
}


/* ── Responsive ── */
@media (max-width: 480px) {
  .org-canvas-wrap {
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    border-radius: var(--r-md);
  }
  .org-bar h2 { font-size: 16px; }
  .org-hub-bar { gap: 6px; flex-wrap: wrap; }
  .org-htab { padding: 6px 11px; font-size: 11px; }
  .org-mini-tree-wrap { height: 260px; }
  .org-fab { bottom: 12px; right: 12px; }
  .org-action-bar { bottom: 12px; flex-wrap: wrap; justify-content: center; max-width: 95vw; }
  .org-act-btn { padding: 6px 11px; font-size: 11px; }
  .org-fab-btn { width: 40px; height: 40px; font-size: 16px; }
  .org-tl-card { padding: 10px 12px; }
  .org-tl-title { font-size: 12px; }
}

@media (min-width: 481px) and (max-width: 1024px) {
  .org-canvas-wrap {
    height: calc(100vh - 160px);
    height: calc(100dvh - 160px);
  }
}
