/* ══════════════════════════════════════════════════════════════
   TODO — app-specifieke styling
   Thema werd hier oorspronkelijk gestuurd via een [data-theme]
   attribuut op <html>, nu omgezet naar de class-based aanpak
   (body.day) consistent met de andere apps. Het volledige eigen
   variabelenstelsel (--bg-page, --text-primary, --prio-high-bg,
   etc.) is genormaliseerd naar de centrale namen waar een
   equivalent bestaat. Alle kleurtokens met een ibiza-theme.css
   equivalent (--bg, --surface, --border, --accent, --accent-dim,
   --accent-text, --text, --muted, --red-*, --overlay, --radius,
   --modal-*) zijn hier verwijderd — die komen nu UITSLUITEND uit
   ibiza-theme.css, single source of truth, geen dubbele definitie
   meer. Variabelen zonder centraal equivalent (--surface-2,
   --accent-light, --prio-*, --shadow-*) blijven todo-specifiek.
   ══════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════════
   ToDo — Ibiza dag/nacht thema
   Dag:   zonnig wit/zand palet
   Nacht: diep oceaanblauw palet
   Gestuurd via body.day (class-based, consistent met de andere apps)
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── nacht tokens (standaard) ───────────────────────────────────────────── */
/* --bg, --surface, --border, --accent, --accent-dim, --accent-text,
   --text, --muted, --red-bg/text/border, --overlay en alle --modal-*
   tokens komen nu uitsluitend uit ibiza-theme.css (single source of
   truth). Hier alleen wat ibiza-theme.css niet kent: --surface-2,
   --accent-light, de prioriteit-badges, schaduwen en radius. */
:root {
  --surface-2: #1a1a1f;
  --accent-light: #1a1a00;

  /* Prioriteit badges (todo-specifiek, geen centraal equivalent) */
  --prio-high-bg: #2e1018;
  --prio-high-text: #f09098;
  --prio-mid-bg: #251a00;
  --prio-mid-text: #e0c060;
  --prio-low-bg: #0a2018;
  --prio-low-text: #50d090;

  /* Schaduw (todo-specifiek) */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.40), 0 4px 16px rgba(0, 0, 0, 0.30);
  --shadow-modal: 0 8px 40px rgba(0, 0, 0, 0.60);
}

/* ─── dag tokens (override) ──────────────────────────────────────────────── */
body.day {
  --surface-2: #f4f1ea;
  --accent-light: #e4e1d8;

  /* Prioriteit badges */
  --prio-high-bg: #fde8ec;
  --prio-high-text: #a8263a;
  --prio-mid-bg: #fff4d6;
  --prio-mid-text: #7a5800;
  --prio-low-bg: #e4f6ef;
  --prio-low-text: #1a6b4a;

  /* Schaduw */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-modal: 0 8px 40px rgba(0, 0, 0, 0.14);
}


/* ─── overgang bij wisselen ──────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition:
    background-color 0.4s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

/* ─── reset / base ───────────────────────────────────────────────────────── */
/* basis achtergrond/kleur/visibility:hidden komt uit ibiza-theme.css.
   Hier alleen het app-eigen font en layout. */
html {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 81px 1rem 4rem;
  overflow-x: hidden;
}

/* Oude floating toggle — vervangen door topbar knop */
.theme-toggle {
  display: none;
}

p {
  padding: 0;
  margin: 0;
}

/* ─── scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 14px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 20px;
  border: 4px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
  background-clip: content-box;
}

/* ─── icon font ──────────────────────────────────────────────────────────── */
@font-face {
  font-family: "tulz-icon";
  src:
    url("../fonts/tulz-icon.ttf?doujrm") format("truetype"),
    url("../fonts/tulz-icon.woff?doujrm") format("woff"),
    url("../fonts/tulz-icon.svg?doujrm#tulz-icon") format("svg");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

[class^="icon-"],
[class*=" icon-"] {
  font-family: "tulz-icon" !important;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Geen transition op icon font — glitcht */
  transition: color 0.2s ease;
}

.icon-remove::before {
  content: "\e900";
  color: inherit;
}

.icon-plus::before {
  content: "\e901";
  color: inherit;
}

/* visibility:hidden komt uit ibiza-theme.css (centraal) */

/* ─── globale topbar ─────────────────────────────────────────────────────── */
.global-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, border-color 0.3s ease;
}

.global-topbar-inner {
  max-width: 540px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}

.topbar-logo-link {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.3s ease;
}

.topbar-logo-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-app-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-family: "Montserrat", sans-serif;
  transition: color 0.3s ease;
}

.topbar-mode-toggle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--accent-text);
  font-size: 15px;
  transition: background 0.3s ease;
}

.topbar-qr-btn {
  width: 30px;
  height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex-shrink: 0;
}

.topbar-qr-btn svg {
  width: 16px;
  height: 16px;
}

/* ─── QR overlay ─────────────────────────────────────────────────────────── */
#qrOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#qrOverlay.active {
  opacity: 1;
  pointer-events: all;
}

.qr-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 300px;
  width: 90%;
}

.qr-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.qr-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-modal-url {
  font-family: "DM Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  word-break: break-all;
  line-height: 1.5;
}

.btn-close-overlay {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 20px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
}

/* ─── theme toggle knop (oud — vervangen door topbar) ────────────────────── */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0.5px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
  padding: 7px;
}

.theme-toggle:hover {
  transform: scale(1.08);
}

.theme-toggle svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: var(--text);
  transition: stroke 0.3s ease;
}

/* ─── buitenste wrapper ──────────────────────────────────────────────────── */
.todo-outer-container {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.todo-outer-container>.todo-uuid-container,
.todo-outer-container>.todo-list {
  width: 100%;
}

/* ─── uuid / naam balk ───────────────────────────────────────────────────── */
.todo-uuid-container {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.todo-uuid {
  flex: 1;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-family: monospace;
  padding: 0 10px;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.todo-uuid:first-child {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: text;
}

.todo-uuid:hover {
  border-color: var(--accent);
}

.todo-uuid:focus {
  border-color: var(--accent);
  outline: none;
}

.todo-uuid:active {
  outline: none;
}

/* ─── hoofdkaart ─────────────────────────────────────────────────────────── */
.todo-list {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  font-size: 15px;
}

.todo-list.inactive {
  pointer-events: none;
}

/* ─── sticky header ──────────────────────────────────────────────────────── */
.todo-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  padding: 0.85rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* ─── add-form ───────────────────────────────────────────────────────────── */
.todo-form {
  display: flex;
  gap: 6px;
}

.todo-input {
  flex: 1;
  height: 34px;
  border: 0.5px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 0 10px;
  outline: none;
}

.todo-input::placeholder {
  color: var(--muted);
}

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

/* ─── filterbar ──────────────────────────────────────────────────────────── */
.todo-filters {
  display: flex;
  gap: 5px;
  padding: 0.5rem 1rem;
  border-bottom: 0.5px solid var(--border);
  flex-wrap: wrap;
}

.filter-btn {
  height: 24px;
  padding: 0 10px;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

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

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

/* ─── item list container ────────────────────────────────────────────────── */
.todo-item-container {
  transition: height 0.4s ease;
}

.todo-item-container.minimize {
  transition: min-height 0.4s ease;
}

/* ─── enkel item ─────────────────────────────────────────────────────────── */
.todo-container {
  position: relative;
  border-bottom: 0.5px solid var(--border);
}

.todo-container:last-child {
  border-bottom: none;
}

.todo-container:hover {
  background: var(--surface-2);
}

.todo-container.highlight {
  background: var(--accent-light);
}

.todo-container.fadeOut {
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease !important;
}

.todo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 1rem;
  cursor: pointer;
  user-select: none;
  position: relative;
}

/* ─── custom checkbox SVG ────────────────────────────────────────────────── */
.todo__state {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  display: none;
}

.todo__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.todo__line,
.todo__box,
.todo__check {
  transition: stroke-dashoffset 0.6s cubic-bezier(0.9, 0, 0.5, 1);
}

.todo__box {
  stroke-dasharray: 56.1053, 56.1053;
  stroke-dashoffset: 0;
  transition-delay: 0.3s;
}

.todo__check {
  stroke: var(--accent);
  stroke-dasharray: 9.8995, 9.8995;
  stroke-dashoffset: 9.8995;
  transition-duration: 0.6s;
}

.todo__line {
  stroke-dasharray: 168, 1684;
  stroke-dashoffset: 168;
}

.todo__circle {
  stroke: var(--accent);
  stroke-dasharray: 1 6;
  stroke-width: 0;
  transform-origin: 13.5px 12.5px;
  transform: scale(0.4) rotate(0deg);
  animation: none 0.8s linear;
  animation-delay: 1.2s;
  animation-duration: 1.2s;
}

.todo__state:checked~.todo__text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--muted);
  transition-delay: 0s;
}

.todo__state:checked~.todo__icon .todo__box {
  stroke-dashoffset: 56.1053;
  transition-delay: 0s;
}

.todo__state:checked~.todo__icon .todo__line {
  stroke-dashoffset: -8;
}

.todo__state:checked~.todo__icon .todo__check {
  stroke-dashoffset: 0;
  transition-delay: 1s;
}

.todo__state:checked~.todo__icon .todo__circle {
  animation-name: explode;
}

@keyframes explode {
  30% {
    stroke-width: 3;
    stroke-opacity: 1;
    transform: scale(0.8) rotate(40deg);
  }

  100% {
    stroke-width: 0;
    stroke-opacity: 0;
    transform: scale(1.1) rotate(60deg);
  }
}

/* ─── item tekst ─────────────────────────────────────────────────────────── */
.todo__text {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  min-width: 0;
}

/* ─── meta badges ────────────────────────────────────────────────────────── */
.todo__meta {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

.todo__badge {
  height: 18px;
  padding: 0 7px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  white-space: nowrap;
  transition: none;
}

.todo__badge--high {
  background: var(--prio-high-bg);
  color: var(--prio-high-text);
}

.todo__badge--mid {
  background: var(--prio-mid-bg);
  color: var(--prio-mid-text);
}

.todo__badge--low {
  background: var(--prio-low-bg);
  color: var(--prio-low-text);
}

.todo__badge--due {
  background: var(--surface-2);
  color: var(--muted);
  border: 0.5px solid var(--border);
}

.todo__badge--overdue {
  background: var(--prio-high-bg);
  color: var(--prio-high-text);
}

/* ─── rij wrapper: label + actions naast elkaar ──────────────────────────── */
.todo-row {
  display: flex;
  align-items: center;
}

.todo-row .todo {
  flex: 1;
  min-width: 0;
}

.todo__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.todo-container:hover .todo__actions {
  opacity: 1;
}

/* verwijderknop ──────────────────────────────────────────────────────────── */
.todo-remove,
.todo-edit {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  touch-action: none;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.todo-container:hover .todo-remove,
.todo-container:hover .todo-edit {
  opacity: 1;
}

.todo-remove:hover {
  color: var(--red-text);
  background: var(--red-bg);
}

.todo-edit:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.todo-edit.active {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-light);
}

.todo-edit svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* ─── icon knoppen (title bar) ───────────────────────────────────────────── */
.icon-plus,
.icon-lists {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
}

.icon-plus:hover,
.icon-lists:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ─── expand rij (prio / deadline / notitie) ─────────────────────────────── */
.todo__expand {
  display: none;
  padding: 6px 1rem 10px 3rem;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 0.5px solid var(--border);
  background: var(--surface-2);
}

.todo__expand.open {
  display: flex;
}

.todo__expand-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 3px;
}

.todo__expand-input,
.todo__expand-select {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  border: 0.5px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.todo__expand-input:focus,
.todo__expand-select:focus {
  border-color: var(--accent);
}

.todo__expand-note {
  flex: 1;
  min-width: 140px;
}

.todo__expand-note input {
  width: 100%;
}

/* ─── stats balk ─────────────────────────────────────────────────────────── */
.todo-stats {
  display: flex;
  border-top: 0.5px solid var(--border);
}

.todo-stat {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-right: 0.5px solid var(--border);
}

.todo-stat:last-child {
  border-right: none;
}

.todo-stat__val {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.todo-stat__lbl {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fadeOut {
  opacity: 0;
  transition: opacity 0.35s ease-in-out !important;
}

/* #toast komt nu uit /css/toast.css (centraal, kleurt mee met day/night).
   Font-override hieronder: deze app gebruikt DM Mono voor de toast,
   consistent met de andere monospace-elementen (bv. .qr-modal-url). */
#toast {
  font-family: "DM Mono", monospace;
}