/* styles/widgets/tasks.css
 *
 * Extracted from styles/main.css during T4#20 (the May-2026
 * CSS-split refactor). Originally lived at lines 1662-1953
 * of main.css. Cascade order is preserved: main.css loads first
 * (themes + base + modal/tab/layout infra), then per-widget
 * files in alphabetical order via <link> tags in index.html.
 */

/* ── RECURRING TASK INDICATOR ─────────────────── */
.recur-badge {
    font-size: 9px; color: var(--muted); flex-shrink: 0;
    margin-top: 3px; opacity: 0.7;
}
.recur-check {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; margin-top: 2px; color: var(--muted);
}
/* Recurring view: just the rotating-arrows emoji, no check-circle since
   templates aren't directly checkable. */
.recur-icon-only {
    width: 16px; height: 16px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; margin-top: 2px; line-height: 1;
}

/* ── Recurring SCHEDULE controls (inside the edit modal) ─────── */
.modal-sched-detail {
    margin-top: 8px;
}
.modal-weekday-row {
    display: flex; gap: 4px;
}
.modal-weekday {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-family: inherit;
    font-size: 11px; font-weight: 700;
    padding: 6px 0;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.modal-weekday:hover { color: var(--text); border-color: var(--text); }
.modal-weekday.active {
    background: rgba(108,99,255,0.18);
    border-color: var(--accent);
    color: var(--accent);
}

/* ── VIEW TABS ────────────────────────────────── */
.view-tabs {
    display: flex; gap: 3px;
    background: var(--surface2);
    border-radius: 8px; padding: 3px;
    margin-bottom: 10px;
}
.view-tab {
    flex: 1; padding: 5px 0;
    font-size: 12px; font-weight: 600;
    border: none; border-radius: 6px;
    background: transparent; color: var(--muted);
    cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.view-tab.active { background: var(--surface); color: var(--text); }

/* ── TASK INPUT ───────────────────────────────── */
.input-row { display: flex; gap: 6px; margin-bottom: 10px; }
.task-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 11px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}
.task-input:focus { border-color: var(--accent); }
.task-input::placeholder { color: var(--muted); }
.time-input {
    width: 58px; flex-shrink: 0;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 6px;
    color: var(--text);
    font-size: 12px; font-family: inherit;
    outline: none; text-align: center;
}
.time-input:focus { border-color: var(--accent); }
.time-input::placeholder { color: var(--muted); font-size: 11px; }

.btn-add {
    width: 34px; height: 34px;
    background: var(--accent);
    border: none; border-radius: 8px;
    color: #fff; font-size: 22px;
    cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.15s;
}
.btn-add:hover { opacity: 0.8; }

/* ── CATEGORY TABS ────────────────────────────── */
.cat-tabs { display: flex; gap: 5px; margin-bottom: 10px; flex-wrap: wrap; }
.cat-tab {
    font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px;
    border: 1.5px solid var(--border);
    background: transparent; color: var(--muted);
    cursor: pointer; font-family: inherit;
    transition: all 0.15s; white-space: nowrap;
}
.cat-tab:hover { color: var(--text); border-color: var(--text); }
.cat-tab.active { color: #0f1117 !important; border-color: transparent !important; }

/* ── TASK LIST ────────────────────────────────── */
.task-list { flex: 1; overflow-y: auto; max-height: 520px; }
.win-list  { overflow-y: auto; }

.task-item {
    display: flex; align-items: flex-start;
    gap: 6px; padding: 6px 8px;
    border-radius: 8px; margin-bottom: 2px;
    transition: background 0.12s;
}
.task-item:hover { background: var(--surface2); }

/* depth indentation */
.task-item[data-depth="1"] { padding-left: 22px; }
.task-item[data-depth="2"] { padding-left: 36px; }
.task-item[data-depth="1"] .t-text { font-size: 12px; color: var(--muted); }
.task-item[data-depth="2"] .t-text { font-size: 11px; color: var(--muted); }
.task-item[data-depth="1"].done .t-text,
.task-item[data-depth="2"].done .t-text { color: #555; }

/* expand toggle */
.expand-btn {
    width: 13px; height: 13px; flex-shrink: 0;
    background: none; border: none; color: var(--muted);
    font-size: 8px; cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, color 0.15s;
    margin-top: 3px;
}
.expand-btn:hover { color: var(--text); }
.expand-btn.open { transform: rotate(90deg); }
.expand-ph { width: 13px; flex-shrink: 0; }

/* check circle color set inline via category color */

.t-check {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0; cursor: pointer; margin-top: 2px;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.t-check:hover { border-color: var(--green); }
/* Done check fills with the category color (passed in via the
   --cat-color custom property on the .t-check element). Falls
   back to --green if --cat-color isn't set (e.g., on subtask
   rows that don't carry a category). Ava's 0.9 - completed
   tasks now keep their actual category color instead of all
   wearing Personal green. The .task-item.done opacity below
   reads them as "done" without losing the color signal. */
.task-item.done .t-check {
    background:    var(--cat-color, var(--green));
    border-color:  var(--cat-color, var(--green));
}
.task-item.done .t-check::after { content: '✓'; font-size: 9px; color: #0f1117; font-weight: 800; }

.t-text { flex: 1; font-size: 13px; line-height: 1.4; min-width: 0; word-break: break-word; }
.task-item.done .t-text { text-decoration: line-through; color: var(--muted); }
.task-item.done { opacity: 0.65; }

/* hover tooltip */
#task-tooltip {
    position: fixed; z-index: 400;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 9px; padding: 8px 11px;
    font-size: 11px; color: var(--text);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    max-width: 260px; pointer-events: none;
    display: none;
}
#task-tooltip .tt-header { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
#task-tooltip .tt-cat  { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
#task-tooltip .tt-pri  { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
#task-tooltip .tt-desc { color: var(--muted); font-size: 11px; line-height: 1.4; }
#task-tooltip .tt-due  { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* badges */
.time-badge {
    font-size: 10px; font-weight: 600; color: var(--muted);
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 20px; padding: 1px 7px;
    flex-shrink: 0; white-space: nowrap; margin-top: 2px;
}
.progress-badge {
    font-size: 10px; font-weight: 700; color: var(--muted);
    padding: 1px 5px; flex-shrink: 0; white-space: nowrap; margin-top: 2px;
}
/* Assignee badge on a task card (Chad's request, polish round).
   Same chip shape as .time-badge but accent-tinted so the owner
   can spot delegated tasks at a glance. Only renders when the
   task is assigned to someone OTHER than the current user. */
.assignee-badge {
    font-size: 10px; font-weight: 600;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: 20px; padding: 1px 7px;
    flex-shrink: 0; white-space: nowrap; margin-top: 2px;
}

/* add subtask & delete */
.add-sub-btn {
    opacity: 0; width: 17px; height: 17px; flex-shrink: 0;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 50%; color: var(--muted); font-size: 12px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; transition: opacity 0.12s, color 0.12s, border-color 0.12s;
    margin-top: 1px;
}
.task-item:hover .add-sub-btn { opacity: 1; }
.add-sub-btn:hover { color: var(--accent); border-color: var(--accent); }

.move-today-btn {
    opacity: 0; background: none; border: none;
    color: var(--muted); font-size: 12px; cursor: pointer;
    flex-shrink: 0; padding: 0 1px;
    transition: opacity 0.12s, color 0.12s;
    margin-top: 2px;
}
.task-item:hover .move-today-btn { opacity: 1; }
.move-today-btn:hover { color: var(--accent); }

.t-del {
    opacity: 0; background: none; border: none;
    color: var(--muted); cursor: pointer;
    font-size: 15px; padding: 0 2px; flex-shrink: 0;
    transition: opacity 0.12s, color 0.12s; margin-top: 1px;
}
.task-item:hover .t-del { opacity: 1; }
.t-del:hover { color: var(--red); }

/* inline subtask add row */
.inline-add {
    display: flex; gap: 5px; align-items: center;
    padding: 4px 8px 4px; margin-bottom: 2px;
}
.inline-input {
    flex: 1; background: var(--surface2);
    border: 1px solid var(--accent); border-radius: 6px;
    padding: 5px 9px; color: var(--text);
    font-size: 12px; font-family: inherit; outline: none;
}
.inline-time {
    width: 50px; background: var(--surface2);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 5px 6px; color: var(--text);
    font-size: 12px; font-family: inherit; outline: none; text-align: center;
}
.inline-ok {
    background: var(--accent); border: none; border-radius: 6px;
    color: #fff; font-size: 13px; width: 26px; height: 26px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.inline-cancel {
    background: none; border: none; color: var(--muted);
    font-size: 16px; cursor: pointer; padding: 0 2px; flex-shrink: 0;
}
.inline-cancel:hover { color: var(--red); }

/* ── DRAG TO REORDER ─────────────────────────── */
.drag-handle {
    width: 12px; flex-shrink: 0;
    color: var(--muted); font-size: 13px; line-height: 1;
    cursor: grab; display: none;
    align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.12s;
    margin-top: 1px; user-select: none;
}
.task-item:hover .drag-handle { opacity: 0.5; }
.drag-handle:hover { opacity: 1 !important; color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.task-list.drag-mode .task-item[data-depth="0"]:not(.done) .drag-handle { display: flex; }
.task-item.drag-over-top    { box-shadow: inset 0 2px 0 var(--accent); }
.task-item.drag-over-bottom { box-shadow: inset 0 -2px 0 var(--accent); }
.task-item.dragging { opacity: 0.35; background: var(--surface2); }

