/* File: tadaysWeb/src/tasks/features/tasks/tasks.css */
/* TASKS -- the task list: New task, search and filters, and the cards.
   Look: New task and Search are capsules; a card is tinted with its color
   (--task-color, set inline by render.js) and carries a small solid dot
   with the color's icon. No left stripe. The grip and delete show on hover. */

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }

.tasks-scroll { overflow-y: auto; flex: 1; padding-right: 2px; border-radius: 12px; min-height: 60px; }
.tasks-scroll.drop-active { background: rgba(55,138,221,.08); outline: 1px dashed var(--accent-border); }
.tasks-scroll .task.drop-before { box-shadow: 0 -2px 0 0 var(--accent); }
.tasks-scroll .task.drop-after  { box-shadow: 0  2px 0 0 var(--accent); }

/* ---- a card ---- */

.task {
  display: flex; align-items: flex-start; gap: 7px;
  padding: 7px 8px; margin-bottom: 5px;
  font-size: 13px; cursor: pointer;
  border: none; border-radius: var(--radius-item);
  background: var(--surface-alt);
  background: color-mix(in srgb, var(--task-color) 11%, var(--surface));
}
.task:hover { background: color-mix(in srgb, var(--task-color) 18%, var(--surface)); }
.task .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .grip { margin-top: 3px; }
.task .del { margin-top: 2px; }

/* the color, as a small solid dot with its icon */
.tdot {
  width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px;
  border-radius: 50%; background: var(--task-color, var(--text-muted)); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.tdot i { font-size: 10px; line-height: 1; }

.grip {
  color: var(--text-muted); cursor: grab; font-size: 11px; line-height: 1; flex: 0 0 auto;
  opacity: .35; transition: opacity .12s;
}
.task:hover .grip { opacity: 1; }
.badge { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.del {
  visibility: hidden; border: none; background: none; cursor: pointer;
  color: var(--text-muted); font-size: 12px; padding: 0 2px; line-height: 1;
}
.task:hover .del { visibility: visible; }
.del:hover { color: #c0392b; }

/* ---- New task: a capsule with the color button inside ---- */

.new-task {
  display: flex; align-items: center; gap: 6px;
  padding: 4px; margin-bottom: 10px;
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px;
}
.new-task:focus-within { border-color: var(--text-muted); background: var(--surface); }
.new-task input {
  flex: 1; min-width: 0; font: inherit; font-size: 12.5px;
  padding: 5px 6px; border: none; background: transparent; color: var(--text);
}
.new-task input:focus { outline: none; }
#newTaskColor {
  width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%;
  color: #fff; border: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
}
#newTaskColor i { font-size: 13px; line-height: 1; }

/* ---- search, filter, Far Out ---- */

.tools-row {
  display: none;
  align-items: center; gap: 4px;
  width: 100%; margin-bottom: 10px;
}
.search-wrap { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search-icon { position: absolute; left: 10px; font-size: 12px; color: var(--text-muted); pointer-events: none; }
#searchInput {
  width: 100%; font: inherit; font-size: 12px;
  padding: 6px 24px 6px 28px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-alt);
  color: var(--text);
}
#searchInput:focus { outline: none; border-color: var(--text-muted); background: var(--surface); }
.search-clear {
  position: absolute; right: 7px; visibility: hidden;
  appearance: none; border: none; background: none; cursor: pointer;
  font-size: 9px; color: var(--text-muted); padding: 2px; line-height: 1;
}
.search-clear:hover { color: var(--text); }

.sub-hit { font-size: 11px; color: var(--text-muted); flex: 0 0 auto; }
.hint-line {
  width: 100%; margin-top: 6px; padding: 6px 8px;
  font: inherit; font-size: 10.5px; text-align: left; cursor: pointer;
  color: var(--text-muted); background: var(--surface-alt);
  border: none; border-radius: 999px;
}
.hint-line:hover { color: var(--text); }
.hint-line::after { content: " \2192"; }

/* ---- card with description ---- */

.task-body { flex: 1; min-width: 0; }
.task-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-top .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-note {
  font-size: 10.5px; color: var(--text-muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-run { font-size: 11px; color: #c0392b; flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  .grip { transition: none; }
}
