/* ============================================================
   Cléa — Dark Theme Stylesheet
   ============================================================ */

/* CSS Variables */
:root {
  --bg: #080808;
  --surface: #111111;
  --text: #EDEAE4;
  --border: #222222;
  --accent: #4A9EDE;
}

/* CSS Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base */
body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   Header
   ============================================================ */

#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

#header-left,
#header-right {
  flex: 1;
}

#header-center {
  flex: 1;
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.5px;
}

#project-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

#project-select:hover,
#project-select:focus {
  border-color: var(--accent);
}

/* ============================================================
   Layout
   ============================================================ */

#layout {
  display: flex;
  margin-top: 56px;
  height: calc(100vh - 56px);
}

/* Sidebar */
#sidebar {
  width: 180px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text);
  opacity: 0.5;
  padding: 12px 24px;
  text-align: left;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease, background 0.2s ease;
  width: 100%;
}

.nav-btn.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover {
  opacity: 0.8;
}

/* Main content */
#main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   Views
   ============================================================ */

.view {
  display: none;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 24px;
}

.view.active {
  display: block;
}

/* Mindmap view — canvas fills entirely */
#view-mindmap {
  padding: 0;
  overflow: hidden;
  position: relative;
}

#view-mindmap canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* ============================================================
   Notes View
   ============================================================ */

.notes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.note-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.note-card:hover {
  border-color: rgba(74, 158, 222, 0.3);
}

.note-card h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  outline: none;
}

.note-card .note-body {
  font-size: 14px;
  opacity: 0.7;
  outline: none;
  min-height: 40px;
  line-height: 1.6;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  opacity: 0.4;
}

.note-delete {
  background: none;
  border: none;
  color: #E07A5F;
  cursor: pointer;
  font-size: 12px;
  opacity: 0.6;
  font-family: 'Outfit', sans-serif;
  transition: opacity 0.2s ease;
}

.note-delete:hover {
  opacity: 1;
}

/* ============================================================
   Decisions View
   ============================================================ */

.decisions-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.decisions-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'Outfit', sans-serif;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.filter-btn:hover:not(.active) {
  border-color: var(--accent);
}

.decision-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.decision-card:hover {
  border-color: rgba(74, 158, 222, 0.3);
}

.decision-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Status badges */
.badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.badge.modifier {
  background: rgba(224, 122, 95, 0.15);
  color: #E07A5F;
}

.badge.storage {
  background: rgba(136, 136, 136, 0.15);
  color: #888;
}

.badge.valide {
  background: rgba(74, 189, 168, 0.15);
  color: #4ABDA8;
}

.decision-title {
  font-size: 18px;
  font-weight: 500;
  outline: none;
  flex: 1;
  margin-right: 12px;
}

.decision-description {
  font-size: 14px;
  opacity: 0.7;
  outline: none;
  min-height: 30px;
  line-height: 1.6;
}

.decision-date {
  font-size: 12px;
  opacity: 0.4;
  margin-top: 8px;
}

.decision-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.status-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'Outfit', sans-serif;
  transition: all 0.2s ease;
}

.status-btn:hover {
  border-color: var(--accent);
}

/* ============================================================
   Shared Buttons
   ============================================================ */

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* ============================================================
   Claude Panel
   ============================================================ */

#claude-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 24px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

#claude-toggle:hover {
  opacity: 0.9;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#claude-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

#claude-panel.hidden {
  transform: translateX(100%);
}

#claude-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
  flex-shrink: 0;
}

#claude-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

#claude-close:hover {
  opacity: 1;
}

#claude-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.claude-msg {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
}

.claude-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.claude-msg.assistant {
  background: var(--bg);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

#claude-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

#claude-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}

#claude-input:focus {
  border-color: var(--accent);
}

#claude-send {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

#claude-send:hover {
  opacity: 0.9;
}

/* ============================================================
   Mindmap Node Panel
   ============================================================ */

.node-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.node-panel.hidden {
  display: none;
}

.node-panel label {
  font-size: 12px;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 6px;
}

.node-panel input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  width: 100%;
  outline: none;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.node-panel input:focus {
  border-color: var(--accent);
}

.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  border-color: var(--text);
}

/* ============================================================
   Scrollbar
   ============================================================ */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #333;
}
