/* File: tadaysWeb/src/tasks/features/tasks/taskbox/taskbox.css */
/* TASKBOX -- the task box: color circle + title, status chip, note, time
   row, checklist, and the button bar:
     Delete (on its own)  ·  ( Duplicate · Complete · C&R )  ·  ( Cancel · Save )
   The box takes on the task's color through --task-color (set by
   taskbox.js): a wash that fades down from behind the title, a soft
   shadow and a thin top highlight instead of a border.
   color-mix() needs Chrome 111 / Safari 16.2 / Firefox 113; older browsers
   get the plain surface. Reduced transparency gets a solid box.
   Shared panel and backdrop styles stay in css/dialogs.css; the estimate
   and timer live in clock/clock.css; the picker in datepicker.css. */

#panel:focus { outline: none; }        /* focused on open so keys work; not a control */

/* ---- the box ---- */

#panel.tb-tinted {
  width: 340px; padding: 16px; border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  background:
    linear-gradient(to bottom,
      color-mix(in srgb, color-mix(in srgb, var(--task-color) 18%, var(--surface)) 94%, transparent) 0,
      color-mix(in srgb, var(--surface) 94%, transparent) 76px);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .35);
}

@media (prefers-reduced-transparency: reduce) {
  #panel.tb-tinted {
    background: var(--surface);
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--task-color) 18%, var(--surface)) 0, var(--surface) 76px);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---- color circle + title ---- */

.tb-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.tb-color {
  width: 32px; height: 32px; flex: 0 0 auto; padding: 0; cursor: pointer;
  border: none; border-radius: 50%; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14);
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.tb-color i { font-size: 16px; line-height: 1; pointer-events: none; }
.tb-color:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.tb-color.pressing { transform: scale(.9); transition: transform .15s; }

.tb-title {
  flex: 1; min-width: 0; margin: 0; padding: 3px 2px;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--text);
  background: transparent; border: none; border-bottom: 1px solid transparent; border-radius: 0;
  text-overflow: ellipsis;
}
.tb-title:hover { border-bottom-color: var(--border); }
.tb-title:focus { outline: none; border-bottom-color: var(--text-muted); }

.tb-pencil {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.tb-pencil:hover { background: var(--surface-alt); color: var(--text); }
.tb-pencil i { font-size: 15px; line-height: 1; }

/* ---- status chip ---- */

.tb-status { margin: 0 0 12px; }
.tb-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border: none; border-radius: 999px;
  font: inherit; font-size: 11px; color: var(--text-muted);
  background: var(--surface-alt);
  background: color-mix(in srgb, var(--task-color) 12%, transparent);
}
.tb-chip i { font-size: 13px; line-height: 1; }
.tb-chip .tb-chev { font-size: 11px; }
button.tb-chip { cursor: pointer; }
button.tb-chip:hover { color: var(--text); background: color-mix(in srgb, var(--task-color) 20%, transparent); }
button.tb-chip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.tb-chip[aria-expanded="true"] {
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--task-color) 45%, transparent);
}

/* ---- note ---- */

#dNote {
  width: 100%; min-height: 72px; font: inherit; font-size: 12px; line-height: 1.5;
  padding: 9px 11px 18px; resize: vertical;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-alt); color: var(--text);
}
#dNote:focus { outline: none; border-color: var(--text-muted); }
.note-count {
  position: absolute; right: 10px; bottom: 7px;
  font-size: 9px; color: var(--text-muted); pointer-events: none;
}

/* ---- time row ---- */

.tb-row { display: flex; align-items: flex-start; margin-bottom: 14px; }

/* ---- checklist: round ticks in the task's color ---- */

.sub { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13px; }
.sub .stext { flex: 1; }
.sub.done .stext { text-decoration: line-through; color: var(--text-muted); }
.sub input[type=checkbox] {
  -webkit-appearance: none; appearance: none; margin: 0; flex: 0 0 auto;
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--text-muted); background: transparent;
}
.sub input[type=checkbox]:checked {
  border-color: var(--task-color, var(--text));
  background-color: var(--task-color, var(--text));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
.sub input[type=checkbox]:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sub-add { display: flex; gap: 5px; margin-top: 8px; }
.sub-add input {
  flex: 1; font: inherit; font-size: 12px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 12px; background: transparent;
}

/* ---- button bar ---- */

.tb-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 6px; margin-top: 16px;
}

/* a capsule groups related round buttons (also used by the picker) */
.tb-cap {
  display: inline-flex; gap: 2px; padding: 3px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-alt);
}

.tb-btn {
  width: 36px; height: 36px; flex: 0 0 auto; padding: 0; cursor: pointer;
  border: none; border-radius: 50%;
  background: transparent; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  -webkit-touch-callout: none; touch-action: manipulation;
}
.tb-btn i { font-size: 18px; line-height: 1; pointer-events: none; }
.tb-btn:hover { background: var(--surface); color: var(--text); }
.tb-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }

/* Delete stands apart: its own circle, always red, never next to Save */
.tb-btn.solo {
  width: 44px; height: 44px;
  border: 1px solid var(--border); background: var(--surface-alt);
}
.tb-btn.danger { color: #c0392b; }
.tb-btn.danger:hover { background: rgba(192, 57, 43, .12); color: #c0392b; }

/* Save: a green check on a faint green tint */
.tb-btn.save { color: #2f9e44; background: rgba(47, 158, 68, .14); }
.tb-btn.save:hover { color: #2f9e44; background: rgba(47, 158, 68, .22); }

/* fingers need the full 44px */
@media (pointer: coarse) {
  .tb-btn { width: 40px; height: 40px; }
  .tb-btn.solo { width: 48px; height: 48px; }
  .tb-color { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .tb-color.pressing { transition: none; }
}
