/* Todo Widget Styles */
.todo-widget {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  transition: all 0.3s ease;
  z-index: 100;
  min-width: 320px;
  max-width: 450px;
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.todo-widget.collapsed {
  min-width: 200px;
  max-width: 280px;
}

.todo-widget-header {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border-radius: 16px 16px 0 0;
}

.todo-widget.collapsed .todo-widget-header {
  border-bottom: none;
  border-radius: 16px;
}

.todo-widget-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #1f2937;
}

.todo-widget-title i {
  color: #6366f1;
}

.todo-widget-summary {
  font-size: 14px;
  color: #6b7280;
  font-weight: 400;
}

.todo-widget-toggle {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.todo-widget-toggle:hover {
  color: #4b5563;
  transform: scale(1.1);
}

.todo-widget-toggle i {
  transition: transform 0.3s ease;
}

.todo-widget.collapsed .todo-widget-toggle i {
  transform: rotate(180deg);
}

.todo-widget-content {
  max-height: 400px;
  overflow-y: auto;
  animation: expandIn 0.3s ease;
}

@keyframes expandIn {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 400px;
  }
}

.todo-widget.collapsed .todo-widget-content {
  display: none;
}

.todo-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}

.todo-empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #e5e7eb;
}

.todo-empty-state p {
  margin: 0;
  font-size: 14px;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  transition: all 0.2s;
}

.todo-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.todo-item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.todo-status-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.3s ease;
}

.todo-status-icon.pending {
  color: #9ca3af;
}

.todo-status-icon.in_progress {
  color: #3b82f6;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

.todo-status-icon.completed {
  color: #10b981;
}

.todo-status-icon.failed {
  color: #ef4444;
}

.todo-status-icon.cancelled {
  color: #6b7280;
}

.todo-item-content {
  flex: 1;
}

.todo-item-text {
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  margin: 0;
}

.todo-item.completed .todo-item-text {
  text-decoration: line-through;
  color: #9ca3af;
}

.todo-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

.todo-priority {
  display: flex;
  align-items: center;
  gap: 4px;
}

.todo-priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.todo-priority-badge.priority-1 {
  background: #fee2e2;
  color: #dc2626;
}

.todo-priority-badge.priority-2 {
  background: #fef3c7;
  color: #d97706;
}

.todo-priority-badge.priority-3 {
  background: #fef9c3;
  color: #ca8a04;
}

.todo-priority-badge.priority-4 {
  background: #d1fae5;
  color: #059669;
}

.todo-priority-badge.priority-5 {
  background: #dbeafe;
  color: #2563eb;
}

.todo-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: capitalize;
  transition: all 0.3s ease;
}

.todo-status-badge.pending {
  background: #f3f4f6;
  color: #6b7280;
}

.todo-status-badge.in_progress {
  background: #dbeafe;
  color: #2563eb;
}

.todo-status-badge.completed {
  background: #d1fae5;
  color: #059669;
}

.todo-status-badge.failed {
  background: #fee2e2;
  color: #dc2626;
}

.todo-status-badge.cancelled {
  background: #f3f4f6;
  color: #4b5563;
}

.todo-success-criteria {
  margin-top: 8px;
  padding: 8px;
  background: #eff6ff;
  border-radius: 8px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.4;
}

.todo-failure-reason {
  margin-top: 8px;
  padding: 8px;
  background: #fef2f2;
  border-radius: 8px;
  font-size: 12px;
  color: #991b1b;
  line-height: 1.4;
}

.todo-progress-bar {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.todo-content-section {
  padding: 16px;
}

.todo-progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.todo-progress-label {
  color: #6b7280;
}

.todo-progress-value {
  color: #374151;
  font-weight: 600;
}

.todo-progress-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.todo-progress-fill {
  height: 100%;
  background: linear-gradient(to right, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* Loading state */
.todo-widget-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6b7280;
}

.todo-widget-loading i {
  animation: spin 1s linear infinite;
}

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

/* Error state */
.todo-widget-error {
  padding: 20px;
  text-align: center;
  color: #ef4444;
}

.todo-widget-error i {
  font-size: 24px;
  margin-bottom: 8px;
}

.todo-widget-error p {
  margin: 0;
  font-size: 14px;
}

/* Dark mode support */
[data-theme="dark"] .todo-widget {
  background: #1f2937;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .todo-widget-header {
  background: #111827;
  border-color: #374151;
}

[data-theme="dark"] .todo-widget-title {
  color: #f3f4f6;
}

[data-theme="dark"] .todo-widget-summary {
  color: #9ca3af;
}

[data-theme="dark"] .todo-widget-toggle {
  color: #9ca3af;
}

[data-theme="dark"] .todo-widget-toggle:hover {
  color: #d1d5db;
}

[data-theme="dark"] .todo-item {
  background: #111827;
  border-color: #374151;
}

[data-theme="dark"] .todo-item:hover {
  border-color: #4b5563;
}

[data-theme="dark"] .todo-item-text {
  color: #e5e7eb;
}

[data-theme="dark"] .todo-item-meta {
  color: #9ca3af;
}

[data-theme="dark"] .todo-empty-state {
  color: #6b7280;
}

[data-theme="dark"] .todo-empty-state i {
  color: #374151;
}

[data-theme="dark"] .todo-progress-label {
  color: #9ca3af;
}

[data-theme="dark"] .todo-progress-value {
  color: #f3f4f6;
}

[data-theme="dark"] .todo-progress-track {
  background: #374151;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .todo-widget {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    max-width: calc(100vw - 32px);
    min-width: 280px;
    z-index: 500;
    /* Safari-specific fixes */
    -webkit-transform: translateX(-50%) translateZ(0);
    transform: translateX(-50%) translateZ(0);
  }
  
  .todo-widget.collapsed {
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    max-width: 250px;
  }
  
  .todo-widget-content {
    max-height: 300px;
  }
  
  .todo-item-text {
    font-size: 13px;
  }
  
  .todo-item-meta {
    flex-wrap: wrap;
    gap: 8px;
  }
} 