/* Hive Task Progress Widget Styles v1 */
/* All classes prefixed htp- to avoid collisions */

/* Toggle button (injected into header) */
.htp-toggle-btn {
  background: none;
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  padding: 4px 10px;
  color: inherit;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.htp-toggle-btn:hover {
  background: rgba(128, 128, 128, 0.1);
}

.htp-badge {
  background: #6366f1;
  color: white;
  font-size: 10px;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.htp-badge.htp-active {
  display: flex;
}

/* Right sidebar panel */
.htp-sidebar {
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100%;
  background: #1a1a2e;
  color: #e0e0e0;
  z-index: 9000;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.2);
}

.htp-sidebar.htp-open {
  right: 0;
}

.htp-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 14px;
}

.htp-close {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.htp-close:hover {
  color: #fff;
}

.htp-task-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.htp-empty {
  text-align: center;
  color: #666;
  font-size: 13px;
  padding: 30px 16px;
}

/* Task card in sidebar */
.htp-task {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid #666;
  transition: border-color 0.2s;
}

.htp-task[data-status="in-progress"] {
  border-left-color: #6366f1;
}

.htp-task[data-status="done"] {
  border-left-color: #22c55e;
}

.htp-task[data-status="failed"] {
  border-left-color: #ef4444;
}

.htp-task-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.htp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.htp-status-dot.htp-pending { background: #666; }
.htp-status-dot.htp-in-progress { background: #6366f1; }
.htp-status-dot.htp-done { background: #22c55e; }
.htp-status-dot.htp-failed { background: #ef4444; }

.htp-task-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Steps within a task */
.htp-task-steps {
  margin-top: 6px;
  padding-left: 16px;
  font-size: 12px;
  color: #999;
}

.htp-step {
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.htp-step.htp-step-done { color: #22c55e; }
.htp-step.htp-step-active { color: #6366f1; }
.htp-step.htp-step-failed { color: #ef4444; }

/* Inline checklist (in chat messages) */
.htp-inline-checklist {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 8px;
  margin: 8px 0;
  overflow: hidden;
}

.htp-inline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #666;
  transition: background 0.1s;
}

.htp-inline-header:hover {
  background: rgba(99, 102, 241, 0.08);
}

.htp-inline-label {
  flex: 1;
}

.htp-inline-expand {
  font-size: 11px;
  transition: transform 0.2s;
}

.htp-inline-checklist.htp-expanded .htp-inline-expand {
  transform: rotate(90deg);
}

.htp-inline-steps {
  display: none;
  padding: 0 12px 8px 32px;
  font-size: 12px;
}

.htp-inline-checklist.htp-expanded .htp-inline-steps {
  display: block;
}

.htp-inline-step {
  padding: 2px 0;
  color: #888;
}

.htp-inline-step.htp-step-done::before {
  content: '\2713 ';
  color: #22c55e;
}

.htp-inline-step.htp-step-active::before {
  content: '\25CB ';
  color: #6366f1;
}

/* CSS spinner */
.htp-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: htp-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes htp-spin {
  to { transform: rotate(360deg); }
}

/* Summary badge (after completion) */
.htp-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #888;
  background: rgba(128, 128, 128, 0.08);
  border-radius: 4px;
  padding: 2px 8px;
  margin-top: 4px;
  cursor: pointer;
}

.htp-summary-badge:hover {
  background: rgba(128, 128, 128, 0.15);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .htp-sidebar {
    width: 100%;
    right: -100%;
  }
}
