/* === Task/Todo Floating Panel — Anthropic === */

/* Panel container */
.task-panel {
  position: fixed;
  right: 0;
  top: 56px;
  bottom: 0;
  width: 340px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.06);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-base, 0.2s) ease, opacity var(--transition-base, 0.2s) ease;
}
.task-panel.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.task-panel.visible {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Main content shifts left when panel is open */
.session-container.panel-open {
  margin-right: 340px;
  transition: margin-right var(--transition-base, 0.2s) ease;
}

/* Header */
.tp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.tp-title {
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.tp-close-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-fast, 0.12s);
}
.tp-close-btn:hover { color: var(--text-primary); }

/* Scrollable body */
.tp-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* Empty state */
.tp-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 48px 24px;
}

/* Progress bar */
.tp-progress {
  position: relative;
  height: 28px;
  background: var(--bg-input, #f5f1eb);
  margin: 12px 16px;
  border-radius: 6px;
  overflow: hidden;
}
.tp-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--green, #3b8a6a);
  border-radius: 6px;
  transition: width 0.3s ease;
  opacity: 0.2;
}
.tp-progress-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* Section */
.tp-section {
  border-top: 1px solid var(--border-light);
}
.tp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 6px;
}
.tp-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.tp-section-stats {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}
.tp-stat-dim {
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}
.tp-section-body {
  padding: 4px 12px 12px;
}

/* Task/Todo item */
.tp-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 6px;
  transition: background var(--transition-fast, 0.12s);
}
.tp-item:hover {
  background: var(--bg-input, #f5f1eb);
}

/* Status icon */
.tp-item-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  margin-top: 1px;
}
.tp-icon-done {
  color: var(--green, #3b8a6a);
}
.tp-icon-active {
  color: var(--accent, #d97757);
  animation: tpPulse 1.5s ease-in-out infinite;
}
.tp-icon-pending {
  color: var(--text-muted);
}
.tp-icon-deleted {
  color: var(--red, #c83c3c);
}

@keyframes tpPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Item content */
.tp-item-content {
  flex: 1;
  min-width: 0;
}
.tp-item-subject {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}
.tp-status-completed .tp-item-subject {
  text-decoration: line-through;
  color: var(--text-muted);
}
.tp-status-deleted .tp-item-subject {
  text-decoration: line-through;
  color: var(--text-muted);
  opacity: 0.5;
}
.tp-blocked .tp-item-subject {
  opacity: 0.55;
}

/* Active form (spinner text) */
.tp-item-active {
  font-size: 0.78rem;
  color: var(--accent, #d97757);
  margin-top: 2px;
  font-style: italic;
}

/* Blocked indicator */
.tp-item-blocked {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-mono, "Fira Code", monospace);
}

/* Owner badge */
.tp-item-owner {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-input, #f5f1eb);
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 2px;
  white-space: nowrap;
}

/* Toggle badge in nav */
.task-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-light, #fff);
  background: var(--accent, #d97757);
  border-radius: 9px;
  margin-left: 4px;
  vertical-align: middle;
}
.task-count-badge.hidden { display: none; }

/* Active toggle button state */
#task-panel-toggle.active {
  color: var(--accent, #d97757);
  background: rgba(217, 119, 87, 0.08);
}

/* === Responsive === */
@media (max-width: 640px) {
  .task-panel {
    width: 100%;
    top: 0;
    z-index: 200;
  }
  .session-container.panel-open {
    margin-right: 0;
  }
}
