/* ════════════════════════════════════════════════════════════════════════════
   todo.css  —  To-Do page specific styles
   ════════════════════════════════════════════════════════════════════════════ */

.btn-icon { padding: 0.3rem 0.5rem !important; }

/* ── Tab bar ── */
.tab-bar {
  display: flex; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.28rem; margin-bottom: 0.85rem;
  width: fit-content; position: relative;
}
.tab-bar::after {
  content: ''; position: absolute;
  top: 0.28rem; bottom: 0.28rem; border-radius: 6px;
  background: rgba(88,101,242,0.18); border: 1px solid rgba(88,101,242,0.3);
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), width 0.22s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none; left: 0.28rem;
  width: var(--tab-indicator-w, 80px);
  transform: translateX(var(--tab-indicator-x, 0px));
}
.tab-btn {
  padding: 0.38rem 1rem; border-radius: 7px; border: none;
  background: transparent; color: var(--text-muted);
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: color 0.18s;
  position: relative; z-index: 1; white-space: nowrap;
}
.tab-btn.active            { color: #c4b5fd; font-weight: 700; }
.tab-btn:not(.active):hover{ color: var(--text-dim); }

/* ── Tab viewport + panels ── */
#tab-viewport { position: relative; overflow: hidden; }
.tab-panel {
  width: 100%;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1), opacity 0.22s ease;
  will-change: transform;
}
.tab-panel--right  { position: absolute; top: 0; left: 0; right: 0; transform: translateX(100%);  opacity: 0; pointer-events: none; }
.tab-panel--active { transform: translateX(0);    opacity: 1; pointer-events: auto; }
.tab-panel--left   { position: absolute; top: 0; left: 0; right: 0; transform: translateX(-100%); opacity: 0; pointer-events: none; }

/* ── Export radio ── */
.export-option {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem; border-radius: 10px;
  border: 1px solid rgba(88,101,242,0.15); background: rgba(255,255,255,0.03);
  cursor: pointer; transition: all 0.15s; user-select: none;
}
.export-option:hover                   { border-color: rgba(88,101,242,0.35); background: rgba(88,101,242,0.06); }
.export-option input[type=radio]       { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; }
.export-option:has(input:checked)      { border-color: rgba(88,101,242,0.5); background: rgba(88,101,242,0.1); }
.export-option-body  { display: flex; flex-direction: column; gap: 0.1rem; }
.export-option-title { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.export-option-desc  { font-size: 0.72rem; color: var(--text-dim); }

.export-option input[type=radio] { display: none; }
.export-radio-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(88,101,242,0.4); background: transparent;
  flex-shrink: 0; position: relative; transition: border-color 0.15s;
}
.export-option:has(input:checked) .export-radio-dot {
  border-color: var(--accent); background: rgba(124,92,252,0.15);
}
.export-option:has(input:checked) .export-radio-dot::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ── Notes ── */
.notes-list  { display: flex; flex-direction: column; gap: 0.5rem; }
.note-card {
  background: rgba(255,255,255,0.025); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.85rem 1rem;
  transition: border-color 0.15s; position: relative;
}
.note-card:hover  { border-color: rgba(88,101,242,0.3); }
.note-card.pinned { border-color: rgba(251,191,36,0.3); background: rgba(251,191,36,0.04); }
.note-card-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.note-title-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.86rem; font-weight: 700; color: var(--text); font-family: inherit;
}
.note-title-input::placeholder { color: var(--text-muted); font-weight: 500; }
.note-pin-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.9rem; opacity: 0.35; transition: opacity 0.15s;
  padding: 0.1rem; flex-shrink: 0;
}
.note-pin-btn.pinned { opacity: 1; }
.note-pin-btn:hover  { opacity: 0.8; }
.note-del-btn {
  background: none; border: none; cursor: pointer;
  font-size: 0.78rem; color: var(--text-muted);
  padding: 0.1rem 0.3rem; border-radius: 4px;
  transition: color 0.15s; flex-shrink: 0; font-family: inherit;
}
.note-del-btn:hover  { color: var(--danger); }
.note-body {
  width: 100%; background: transparent; border: none; outline: none;
  color: var(--text-dim); font-size: 0.82rem; line-height: 1.6;
  font-family: inherit; resize: none; min-height: 56px;
}
.note-body::placeholder { color: var(--text-muted); }
.note-meta   { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.4rem; font-family: 'DM Mono', monospace; }
.notes-empty { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.84rem; }
.add-note-btn {
  width: 100%; padding: 0.6rem; border-radius: 10px;
  border: 1px dashed rgba(88,101,242,0.25); background: transparent;
  color: var(--text-muted); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s; margin-top: 0.5rem;
}
.add-note-btn:hover { border-color: rgba(88,101,242,0.5); color: #a8b4ff; }

/* ── Stats bar ── */
.stats-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0; position: relative; z-index: 1; }
.stat-chip {
  padding: 0.2rem 0.65rem; border-radius: 20px; font-size: 0.73rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.04); color: var(--text-dim);
}
.stat-chip span         { font-weight: 700; }
.stat-chip.done  span  { color: var(--success); }
.stat-chip.open  span  { color: var(--accent); }
.stat-chip.total span  { color: var(--text-dim); }

/* ── Category sections ── */
.category-section { position: relative; z-index: 1; }
.category-header  {
  display: flex; align-items: center; gap: 0.6rem;
  margin-bottom: 0.65rem; padding: 0.5rem 0.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.category-drag-handle {
  font-size: 0.9rem; color: #3a3a5a; cursor: grab;
  user-select: none; padding: 0 0.2rem; touch-action: none;
}
.category-drag-handle:active { cursor: grabbing; }
.category-name-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--text); font-family: inherit; cursor: text; min-width: 60px;
}
.category-name-input::placeholder { color: #3a3a5a; }
.category-progress        { font-size: 0.68rem; color: #3a3a5a; white-space: nowrap; }
.category-header-actions  { display: flex; gap: 0.25rem; opacity: 0; transition: opacity 0.15s; }
.category-section:hover .category-header-actions { opacity: 1; }

/* ── Task list ── */
.task-list           { display: flex; flex-direction: column; gap: 0.3rem; min-height: 2rem; }
.task-list.drag-over { background: rgba(88,101,242,0.05); border-radius: 8px; }
.task-item {
  display: flex; align-items: flex-start; gap: 0.6rem;
  padding: 0.55rem 0.7rem; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.025);
  transition: all 0.15s; cursor: default; position: relative;
}
.task-item:hover       { background: rgba(88,101,242,0.07); border-color: rgba(88,101,242,0.2); }
.task-item.dragging    { opacity: 0.4; border-style: dashed; }
.task-item.drag-target { border-color: rgba(88,101,242,0.5); background: rgba(88,101,242,0.08); }
.task-item.completed .task-text { text-decoration: line-through; color: #444; }
.task-drag {
  font-size: 0.85rem; color: #3a3a5a; cursor: grab;
  user-select: none; padding-top: 1px; flex-shrink: 0; touch-action: none;
}
.task-drag:active { cursor: grabbing; }

/* Checkbox */
.task-cb-wrap { display: inline-flex; align-items: center; flex-shrink: 0; cursor: pointer; position: relative; }
.task-cb-wrap input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.task-cb-box {
  width: 17px; height: 17px; flex-shrink: 0; border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.18); background: rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.task-cb-wrap input:checked + .task-cb-box {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 8px rgba(124,92,252,0.45);
}
.task-cb-wrap input:checked + .task-cb-box::after {
  content: ''; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px); display: block;
}
.task-cb-wrap:hover .task-cb-box { border-color: rgba(124,92,252,0.55); }

/* Task body */
.task-text {
  flex: 1; font-size: 0.86rem; line-height: 1.4; color: var(--text);
  outline: none; border: none; background: transparent;
  font-family: inherit; cursor: text; resize: none;
  min-height: 1.2em; word-break: break-word; overflow: hidden; white-space: pre-wrap;
}
.task-text:focus              { color: var(--text); }
.task-text.placeholder-active { color: #3a3a5a; }
.task-actions   { display: flex; gap: 0.2rem; opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }
.task-item:hover .task-actions { opacity: 1; }
.task-body      { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.task-meta-row  { display: flex; flex-wrap: wrap; gap: 0.3rem; min-height: 0; }

/* Due date badges */
.task-due-badge   { display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 600; padding: 0.1rem 0.45rem; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); }
.task-due-overdue { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.4); color: var(--red); }
.task-due-today   { background: rgba(251,191,36,0.15);  border-color: rgba(251,191,36,0.4);  color: var(--amber); }
.task-due-soon    { background: rgba(96,165,250,0.12);  border-color: rgba(96,165,250,0.3);  color: #60a5fa; }
.task-due-ok      { background: rgba(255,255,255,0.05); }
.task-assignee-chip {
  display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 600;
  padding: 0.1rem 0.45rem; border-radius: 20px;
  background: rgba(124,92,252,0.1); border: 1px solid rgba(124,92,252,0.25); color: var(--accent2);
}

/* Add task row */
.add-task-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.7rem; border-radius: 10px;
  border: 1px dashed rgba(88,101,242,0.2); background: rgba(88,101,242,0.03);
  cursor: text; transition: all 0.15s; margin-top: 0.25rem;
}
.add-task-row:hover { border-color: rgba(88,101,242,0.4); background: rgba(88,101,242,0.06); }
.add-task-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 0.85rem; color: var(--text); font-family: inherit;
}
.add-task-input::placeholder { color: #3a3a5a; }

/* Add category */
.add-category-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 0.85rem; border-radius: 12px;
  border: 1px dashed rgba(88,101,242,0.2); background: transparent;
  cursor: pointer; transition: all 0.18s; font-family: inherit;
  color: var(--text-dim); font-size: 0.85rem; font-weight: 600;
  width: 100%; position: relative; z-index: 1; margin-top: 0.5rem;
}
.add-category-btn:hover { border-color: rgba(88,101,242,0.45); background: rgba(88,101,242,0.05); color: var(--text); }

/* ── Settings modal (todo-specific overrides) ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: linear-gradient(145deg,#13131f,#0f0f1a);
  border: 1px solid rgba(88,101,242,0.3); border-radius: 20px;
  padding: 1.75rem 2rem; width: 90%; max-width: 440px;
  animation: modalIn 0.25s cubic-bezier(.16,1,.3,1) both;
}
@keyframes modalIn { from { transform: scale(0.93); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin: 0 0 1rem; font-size: 1.1rem; color: var(--text); }
.settings-section { margin-bottom: 1.25rem; }
.settings-label   { font-size: 0.68rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 0.5rem; }
.settings-row     { display: flex; gap: 0.5rem; align-items: center; }
.settings-input   {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(88,101,242,0.2); border-radius: 8px;
  padding: 0.4rem 0.75rem; color: var(--text); font-family: inherit;
  font-size: 0.85rem; outline: none;
}
.settings-input:focus { border-color: rgba(88,101,242,0.5); }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }

/* ── Toast (todo-specific, centred) ── */
#toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,30,0.95); border: 1px solid rgba(88,101,242,0.3);
  border-radius: 10px; padding: 0.6rem 1.2rem;
  font-size: 0.83rem; font-weight: 500; backdrop-filter: blur(20px);
  opacity: 0; transition: all 0.3s; pointer-events: none;
  z-index: 1000; white-space: nowrap;
}
#toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: rgba(46,204,113,0.4); color: var(--success); }
#toast.error   { border-color: rgba(231,76,60,0.4);  color: var(--danger); }

/* ── Mobile ── */
@media (max-width: 540px) {
  body       { padding: 1rem 0.5rem 3rem; }
  .glass-card{ padding: 1.25rem 1rem; }
}
