/* Herzensprojekte WIRK-Wunder - App — WUNDERbare MÖGLICHkeiten n.e.V. */

:root {
  --bg:           #0b1e0f;
  --bg-card:      #152a19;
  --bg-card2:     #1e3d24;
  --border:       #1e3d24;
  --border-strong:#2a5532;
  --ink:          #f2f9ee;
  --ink-dim:      #b5d4ab;
  --ink-muted:    #6a9870;
  --accent:       #7cc520;
  --accent-bright:#98e028;
  --accent-deep:  #4a7a12;
  --accent-light: #1e3d24;
  --amber:        #f5d000;
  --amber-light:  #3a3000;
  --coral:        #e07060;
  --coral-light:  #3a1a14;
  --danger:       #e07060;
  --sans:  'Inter', -apple-system, system-ui, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sidebar-w: 320px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────────────────── */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

/* ─── Sidebar ────────────────────────────────────────────────────────── */

.sidebar-head {
  padding: 20px 16px 14px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.brand-mark {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
}

.sync-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--ink-muted);
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}
.sync-btn:hover { color: var(--accent); border-color: var(--accent); }
.sync-btn:disabled { opacity: 0.4; cursor: wait; }

.new-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.new-btn:hover { background: var(--accent-bright); }

.search-wrap {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.search-wrap input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
}
.search-wrap input:focus { outline: none; border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--ink-muted); }

.library-section {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
}

.library-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 0 16px 8px;
}

.library-list { list-style: none; }

.library-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 2px solid transparent;
}
.library-item:hover { background: var(--bg-card2); }
.library-item.active { background: var(--bg-card2); border-left-color: var(--accent); }

.li-row { display: flex; gap: 10px; }
.li-main { flex: 1; min-width: 0; }

.li-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.li-fav-inline { color: var(--accent); font-size: 12px; flex-shrink: 0; }

.score-pill {
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.score-pill.green  { background: #2a4a0a; color: var(--accent-bright); }
.score-pill.amber  { background: #3a3000; color: #f5d000; }
.score-pill.coral  { background: #3a1a14; color: #e07060; }

.li-meta { margin-top: 3px; }
.li-date { font-size: 11px; color: var(--ink-muted); display: block; }
.li-sub  { font-size: 11px; color: var(--ink-muted); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.library-empty {
  display: none;
  padding: 20px 16px;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
}

/* ─── Hero / Formular ────────────────────────────────────────────────── */

.view-new {
  padding: 48px 48px 80px;
  max-width: 760px;
}

.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 14px;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent-bright);
}

.lede {
  font-size: 16px;
  color: var(--ink-dim);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 600px;
}

.projekt-form { display: flex; flex-direction: column; gap: 20px; }

.form-field { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-dim);
}
.form-label .req   { color: var(--accent); }
.form-label .optional { font-weight: 400; color: var(--ink-muted); font-size: 12px; }

.projekt-form input[type="text"],
.projekt-form textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s;
}
.projekt-form input[type="text"]:focus,
.projekt-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.projekt-form input[type="text"]::placeholder,
.projekt-form textarea::placeholder { color: var(--ink-muted); }

/* Upload */
.upload-area {
  background: var(--bg-card);
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  padding: 24px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: default;
}
.upload-area.drag-active { border-color: var(--accent); background: var(--accent-deep); }
.upload-icon  { font-size: 24px; margin-bottom: 6px; }
.upload-text  { font-size: 13px; color: var(--ink-dim); margin-bottom: 4px; }
.upload-hint  { font-size: 12px; color: var(--ink-muted); margin-bottom: 10px; }
.upload-select-btn {
  background: var(--border-strong);
  color: var(--ink-dim);
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.upload-select-btn:hover { background: var(--accent); color: #fff; }
.file-input { display: none; }

.upload-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 12px 14px;
}
.upload-selected.hidden { display: none; }
.upload-file-icon { font-size: 18px; }
.upload-filename { flex: 1; font-size: 13px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-remove-btn {
  background: none; border: none; color: var(--ink-muted);
  cursor: pointer; font-size: 14px; padding: 2px 4px;
}
.upload-remove-btn:hover { color: var(--danger); }

.upload-info {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.5;
  margin-top: 6px;
}

.contributor-wrap { margin-top: 4px; }
.contributor-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-size: 13px;
}
.contributor-wrap input:focus { outline: none; border-color: var(--accent); }
.contributor-wrap input::placeholder { color: var(--ink-muted); }

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 16px 28px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.submit-btn:hover:not(:disabled) { background: var(--accent-bright); transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.5; cursor: wait; }
.btn-arrow { font-size: 18px; }

.status { font-size: 14px; min-height: 22px; margin-top: 4px; }
.status.error   { color: var(--danger); }
.status.success { color: var(--accent-bright); }
.status.loading { color: var(--ink-muted); }

/* ─── Lade-Ansicht ───────────────────────────────────────────────────── */

.view-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.loading-center { text-align: center; }

.gauge-wrap {
  display: inline-block;
  margin-bottom: 16px;
}

.gauge-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 6px;
}

.loading-msg {
  font-size: 16px;
  color: var(--ink-dim);
  margin-bottom: 16px;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.loading-dots span {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-pulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40%            { opacity: 1;    transform: scale(1); }
}

/* ─── Detail-Ansicht ─────────────────────────────────────────────────── */

.view-detail {
  padding: 0 0 80px;
  max-width: 860px;
}

.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.back-btn {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.back-btn:hover { color: var(--ink); }

.toolbar-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--ink-dim);
  border-radius: 6px;
  padding: 7px 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover  { background: var(--bg-card2); color: var(--ink); }
.icon-btn.active { color: var(--accent); border-color: var(--accent); }
.icon-btn.danger { color: var(--danger); border-color: var(--danger); }
.icon-btn.danger:hover { background: rgba(224,112,96,0.12); }

/* ─── Cards ──────────────────────────────────────────────────────────── */

#detail-body {
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.card .kicker { margin-bottom: 8px; display: block; }

.project-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.2;
}

.project-info {
  font-size: 13px;
  color: var(--ink-muted);
}

/* Gauge Result */
.gauge-result-card { padding: 24px; }
.gauge-result-wrap { display: flex; align-items: center; gap: 28px; }
.gauge-result-visual { flex-shrink: 0; }

.gauge-result-info { flex: 1; }
.score-number {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.score-number.score-green { color: var(--accent-bright); }
.score-number.score-amber { color: #f5d000; }
.score-number.score-coral { color: #e07060; }

.score-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.score-begruendung {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.6;
  margin-bottom: 10px;
}
.score-tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.score-tag {
  font-size: 12px;
  font-weight: 600;
  border-radius: 99px;
  padding: 4px 12px;
}
.score-tag.tag-green { background: var(--accent-deep); color: var(--accent-bright); }
.score-tag.tag-amber { background: #3a3000; color: #f5d000; }
.score-tag.tag-coral { background: #3a1a14; color: #e07060; }

/* Kern */
.kernbotschaft {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.zielgruppe {
  font-size: 15px;
  color: var(--ink-dim);
  line-height: 1.7;
}

/* Zwei Spalten */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.staerken-kicker      { color: var(--accent); }
.herausforderungen-kicker { color: #EF9F27; }

.staerken-list,
.herausforderungen-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.staerken-list li,
.herausforderungen-list li {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
}
.staerken-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 12px;
}
.herausforderungen-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #f5d000;
  font-size: 12px;
}

/* Schritte */
.section-h {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
  padding-left: 2px;
}

.schritte-section { padding: 0; }

.schritte-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

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

.schritt-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  opacity: 0.4;
  line-height: 1;
  margin-bottom: 8px;
}

.schritt-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.4;
}

.schritt-warum,
.schritt-wie {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-top: 6px;
}

.schritt-warum strong,
.schritt-wie strong { color: var(--ink-dim); }

/* Fragen */
.fragen-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
  margin-bottom: 12px;
}
.fragen-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fragen-list li {
  font-size: 14px;
  color: var(--ink-dim);
  line-height: 1.6;
}

/* Impuls */
.impuls-card {
  border-color: var(--accent-deep);
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--bg-card) 100%);
}
.herzens-impuls {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-bright);
  line-height: 1.5;
  text-align: center;
  padding: 4px 0;
}

/* ─── Hidden ─────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
