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

:root {
  --sidebar-w: 260px;
  --content-max: 1040px;

  /* Vlieland: green & white (island flag colours). Variable names kept as
     --sea* for continuity; the values are greens. */
  --sea:       #2e8b57;
  --sea-dark:  #1f6b41;
  --sea-light: #52a877;
  --sidebar-bg-top: #3a9e64;
  --sidebar-bg-bot: #185233;
  --nav-active: rgba(0,0,0,0.28);
  --nav-hover:  rgba(255,255,255,0.12);

  --body-bg:    #f3f7f3;
  --card-bg:    #ffffff;
  --topbar-bg:  rgba(255,255,255,0.85);
  --input-bg:   #ffffff;
  --text:       #1f2a24;
  --text-muted: #78857d;
  --author-color: #1f6b41;
  --border:     #e2ebe4;
  --border-strong: #cfdcd3;

  --vote-bg:    #f1f6f2;
  --vote-border:#dde8e0;
  --vote-hover: #e6f4ea;
  --vote-hover-border: var(--sea);

  --error-bg:   #fdf0f0;
  --error-border: #e5bcbc;
  --error-text: #c0392b;

  --accent-soft: rgba(46,139,87,0.12);
  --radius:    14px;
  --radius-sm: 9px;
  --shadow:       0 1px 2px rgba(20,45,30,0.04), 0 2px 8px rgba(20,45,30,0.06);
  --shadow-hover: 0 6px 14px rgba(20,45,30,0.08), 0 14px 32px rgba(20,45,30,0.10);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --body-bg:    #0d120f;
    --card-bg:    #161d18;
    --topbar-bg:  rgba(19,26,21,0.82);
    --input-bg:   #1f2822;
    --text:       #e2e8e3;
    --text-muted: #869089;
    --author-color: #6cc79a;
    --border:     #263129;
    --border-strong: #323f36;
    --vote-bg:    #1f2822;
    --vote-border:#2f3b34;
    --vote-hover: #21362a;
    --vote-hover-border: var(--sea);
    --error-bg:   #2a1515;
    --error-border: #5a2020;
    --error-text: #e07070;
    --accent-soft: rgba(82,168,119,0.18);
    --shadow:       0 1px 2px rgba(0,0,0,0.4), 0 2px 10px rgba(0,0,0,0.35);
    --shadow-hover: 0 8px 20px rgba(0,0,0,0.5), 0 18px 40px rgba(0,0,0,0.55);
  }
}

:root[data-theme="dark"] {
  --body-bg:    #0d120f;
  --card-bg:    #161d18;
  --topbar-bg:  rgba(19,26,21,0.82);
  --input-bg:   #1f2822;
  --text:       #e2e8e3;
  --text-muted: #869089;
  --author-color: #6cc79a;
  --border:     #263129;
  --border-strong: #323f36;
  --vote-bg:    #1f2822;
  --vote-border:#2f3b34;
  --vote-hover: #21362a;
  --vote-hover-border: var(--sea);
  --error-bg:   #2a1515;
  --error-border: #5a2020;
  --error-text: #e07070;
  --accent-soft: rgba(82,168,119,0.18);
  --shadow:       0 1px 2px rgba(0,0,0,0.4), 0 2px 10px rgba(0,0,0,0.35);
  --shadow-hover: 0 8px 20px rgba(0,0,0,0.5), 0 18px 40px rgba(0,0,0,0.55);
}

html, body {
  height: 100%;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { scroll-behavior: smooth; }
::selection { background: var(--accent-soft); }

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

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(165deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bot) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
  box-shadow: 2px 0 20px rgba(0,0,0,0.10);
}

.sidebar-logo { padding: 2rem 1.5rem 1.5rem; }

.logo {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.05;
  color: #fff;
}

.tagline {
  font-size: 11px;
  font-style: italic;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.sidebar-search { padding: 0 1.25rem 1.5rem; }

.sidebar-search input {
  width: 100%;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.sidebar-search input::placeholder { color: rgba(255,255,255,0.6); }
.sidebar-search input:focus {
  border-color: rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.30);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 0.75rem;
}

.sidebar-nav a {
  position: relative;
  display: block;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}

.sidebar-nav a::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 60%;
  border-radius: 3px;
  background: #fff;
  transition: transform 0.18s ease;
}

.sidebar-nav a:hover  { background: var(--nav-hover); }
.sidebar-nav a.active { background: var(--nav-active); }
.sidebar-nav a.active::before { transform: translateY(-50%) scaleY(1); }

.sidebar-theme { margin-top: auto; padding: 1.5rem 1.5rem 0; }

.sidebar-theme label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.65;
  margin-bottom: 0.45rem;
}

.sidebar-theme select {
  width: 100%;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  padding: 0.5rem 0.6rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s;
}

.sidebar-theme select:focus { border-color: rgba(255,255,255,0.7); }
.sidebar-theme select option { color: #333; background: #fff; }

.sidebar-stats {
  padding: 1.5rem;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.16);
}

.sidebar-credit {
  padding: 0 1.5rem 1.5rem;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.3px;
}

.sidebar-credit .heart {
  color: #ff6b81;
  display: inline-block;
  animation: heartbeat 1.6s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15%      { transform: scale(1.3); }
  30%      { transform: scale(1); }
}

.stats-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.65;
  margin-bottom: 0.75rem;
}

.stats-row { display: flex; gap: 0.6rem; }

.stat-box {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  flex: 1;
  transition: background 0.18s, transform 0.18s;
}

.stat-box:hover { background: rgba(255,255,255,0.20); transform: translateY(-1px); }

.stat-num {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 9.5px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ── Content area ────────────────────────────── */

.content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2.5rem;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sort-control { display: flex; align-items: center; gap: 0.5rem; color: var(--text-muted); }

.sort-control select {
  font-family: inherit;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  color: var(--text);
  background: var(--input-bg);
  cursor: pointer;
  transition: border-color 0.18s;
}

.sort-control select:hover { border-color: var(--border-strong); }
.sort-control select:focus { border-color: var(--sea); outline: none; }

#main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 2.5rem 4rem;
}

/* ── Idea cards ──────────────────────────────── */

.idea-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.15rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: cardIn 0.32s ease both;
}

.idea-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.idea-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.idea-category {
  display: inline-block;
  color: var(--sea-dark);
  background: var(--accent-soft);
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  transition: background 0.16s, color 0.16s;
}

.idea-category:hover { background: var(--sea); color: #fff; }

.idea-status {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Green monochrome ramp: pale (nieuw) → solid filled (afgerond),
   afgewezen a muted grey-green. Keeps statuses on-brand yet distinct. */
.status-nieuw          { background: #eef5f0; color: #5c7365; }
.status-in_behandeling { background: #dff0e6; color: #2f8055; }
.status-gepland        { background: #cfe8d8; color: #21734a; }
.status-afgerond       { background: #2e8b57; color: #ffffff; }
.status-afgewezen      { background: #e8ece9; color: #808a82; }

:root[data-theme="dark"] .status-nieuw          { background: #23302a; color: #9fb0a5; }
:root[data-theme="dark"] .status-in_behandeling { background: #1f3a2b; color: #74c295; }
:root[data-theme="dark"] .status-gepland        { background: #234636; color: #8fd8ab; }
:root[data-theme="dark"] .status-afgerond       { background: #2e8b57; color: #ffffff; }
:root[data-theme="dark"] .status-afgewezen      { background: #262d29; color: #7e887f; }

.idea-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.idea-title-link { text-decoration: none; }
.idea-title-link:hover .idea-title { color: var(--sea); }

.idea-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.idea-body {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1.25rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.idea-card:not(.idea-card--full) .idea-body {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.idea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.vote-area { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--vote-bg);
  border: 1px solid var(--vote-border);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.1s;
}

.vote-btn:hover  { background: var(--vote-hover); border-color: var(--vote-hover-border); }
.vote-btn:active { transform: scale(0.94); }
.vote-btn:disabled { opacity: 0.6; cursor: default; }

.vote-btn.up:hover   { border-color: #15803d; color: #15803d; }
.vote-btn.down:hover { border-color: var(--error-text); color: var(--error-text); }

.vote-msg { font-size: 12px; color: var(--sea-dark); font-weight: 600; }

.comment-link {
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.16s;
}
.comment-link:hover { color: var(--sea); }

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--sea-dark);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
}
.back-link:hover { color: var(--sea); text-decoration: underline; }

/* ── Topics grid ─────────────────────────────── */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  animation: cardIn 0.32s ease both;
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--sea);
}

.topic-name { font-size: 1rem; font-weight: 800; }
.topic-count { font-size: 12px; color: var(--text-muted); }

/* ── Comments ────────────────────────────────── */

.comments-section { margin-top: 2rem; }

.comments-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin: 1.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.comment-list { display: flex; flex-direction: column; gap: 0.85rem; }

.comment {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  animation: cardIn 0.28s ease both;
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.comment-author { font-weight: 700; color: var(--author-color); font-size: 13px; }
.comment-date { font-size: 11px; color: var(--text-muted); }
.comment-body { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

.comment-form {
  margin-top: 1.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem;
}

/* ── Forms ───────────────────────────────────── */

.submit-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 720px;
  animation: cardIn 0.32s ease both;
}

.submit-card h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.submit-intro { color: var(--text-muted); font-size: 13px; margin-bottom: 1.5rem; line-height: 1.6; }

.form-group { margin-bottom: 1.15rem; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-group textarea,
.form-group input[type=text],
.form-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 0.7rem 0.9rem;
  background: var(--input-bg);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.form-group textarea { min-height: 150px; resize: vertical; line-height: 1.6; }

.form-group textarea:focus,
.form-group input[type=text]:focus,
.form-group select:focus {
  border-color: var(--sea);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.submit-btn {
  background: var(--sea);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.75rem;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s, transform 0.1s, box-shadow 0.16s;
  box-shadow: 0 2px 8px rgba(46,139,87,0.28);
}

.submit-btn:hover    { background: var(--sea-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(46,139,87,0.36); }
.submit-btn:active   { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }

.success-msg {
  display: none;
  margin-top: 1rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--sea-dark);
}

.success-msg.visible { display: block; animation: cardIn 0.3s ease both; }
.form-msg { margin-top: 0.75rem; font-size: 12.5px; font-weight: 600; color: var(--sea-dark); }

.teal-link { color: var(--sea); font-weight: 700; }

.field-hint {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* ── Subscribe (e-mail updates) ──────────────── */

.hidden { display: none !important; }

.subscribe-box { margin: 1.25rem 0; }

.subscribe-toggle {
  background: var(--accent-soft);
  color: var(--sea-dark);
  border: 1px solid var(--vote-border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.subscribe-toggle:hover { background: var(--sea); color: #fff; border-color: var(--sea); }

.subscribe-form {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.subscribe-form input {
  flex: 1;
  min-width: 200px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  padding: 0.6rem 0.85rem;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.subscribe-form input:focus { border-color: var(--sea); box-shadow: 0 0 0 3px var(--accent-soft); }
.subscribe-form .form-msg { flex-basis: 100%; margin-top: 0; }

.submit-btn.small { padding: 0.55rem 1.1rem; font-size: 13px; }

/* ── Utility ─────────────────────────────────── */

.loading, .empty-state {
  padding: 4rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state.small { padding: 1.5rem 0; }

.error-state {
  padding: 1.1rem 1.25rem;
  color: var(--error-text);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  background: var(--error-bg);
  font-size: 13px;
  margin-top: 1rem;
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 860px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: column;
  }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav a { flex: 1 1 auto; text-align: center; }
  .sidebar-theme { margin-top: 1rem; }
  .content { margin-left: 0; }
  .topbar { padding: 0.8rem 1.25rem; }
  #main { padding: 1.5rem 1.25rem 3rem; }
  .idea-card { padding: 1.25rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
