:root {
  --todoist-red: #db4c3f;
  --todoist-hover: #c53727;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Task Priority Colors */
.priority-1 { border-left: 3px solid #d1d5db; }
.priority-2 { border-left: 3px solid #3b82f6; }
.priority-3 { border-left: 3px solid #f59e0b; }
.priority-4 { border-left: 3px solid var(--todoist-red); }

/* Task Item Styles */
.task-item {
  transition: all 0.2s;
}

.task-item:hover {
  background-color: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.task-item.dragging {
  opacity: 0.5;
}

/* Checkbox Styles */
.checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.checkbox:hover {
  border-color: var(--todoist-red);
}

.checkbox:checked {
  background-color: var(--todoist-red);
  border-color: var(--todoist-red);
}

.checkbox:checked::after {
  content: '✓';
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Button Styles */
.btn-primary {
  background-color: var(--todoist-red);
  color: white;
}

.btn-primary:hover {
  background-color: var(--todoist-hover);
}

/* Sidebar Styles */
.sidebar-item {
  transition: background-color 0.15s;
}

.sidebar-item:hover {
  background-color: #f3f4f6;
}

.sidebar-item.active {
  background-color: #fef2f2;
  color: var(--todoist-red);
  font-weight: 500;
}

/* Project and Label Colors */
.project-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Label Badge Styles */
.label-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.label-badge:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.label-badge.selected {
  box-shadow: 0 0 0 2px white, 0 0 0 4px currentColor;
}

/* Assignee Avatar Styles */
/* Assignee Chip Styles (List format) */
.assignee-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background-color: white;
}

.assignee-chip:hover {
  border-color: #d1d5db;
  background-color: #f9fafb;
}

.assignee-chip.selected {
  border-color: var(--todoist-red);
  background-color: #fef2f2;
}

.assignee-chip .assignee-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.assignee-chip span {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.assignee-chip.selected span {
  color: var(--todoist-red);
}

/* Assignee Avatar Styles */
.assignee-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
}

.assignee-avatar:hover {
  transform: scale(1.1);
}

.assignee-avatar.selected {
  box-shadow: 0 0 0 2px white, 0 0 0 4px currentColor;
}

/* Markdown Preview Styles */
.prose {
  color: #374151;
}

.prose h1, .prose h2, .prose h3 {
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.prose li {
  margin: 0.25em 0;
}

.prose code {
  background-color: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

.prose pre {
  background-color: #1f2937;
  color: #f3f4f6;
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
}

.prose blockquote {
  border-left: 4px solid #d1d5db;
  padding-left: 1em;
  color: #6b7280;
  margin: 1em 0;
}

.prose a {
  color: var(--todoist-red);
  text-decoration: underline;
}

.prose input[type="checkbox"] {
  margin-right: 0.5em;
}

/* Comment Styles */
.comment-item {
  padding: 12px;
  background-color: #f9fafb;
  border-radius: 8px;
  border-left: 3px solid #e5e7eb;
}

.comment-item:hover {
  border-left-color: var(--todoist-red);
}

/* Drag Handle */
.drag-handle {
  cursor: move;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .drag-handle {
  opacity: 1;
}

/* Recurrence Badge */
.recurrence-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background-color: #dbeafe;
  color: #1e40af;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* Stats Card */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Keyboard Shortcut Hint */
.keyboard-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}

.keyboard-hint.show {
  opacity: 1;
}

/* Loading Spinner */
.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--todoist-red);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.toast.success {
  background: #059669;
}

.toast.error {
  background: #dc2626;
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Display Mode Toggle Styles */
.display-mode-active {
  background-color: var(--todoist-red) !important;
  color: white !important;
}

/* Assignee Group Styles */
.assignee-group {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.assignee-group-header {
  padding: 12px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.assignee-group-header:hover {
  background: #f3f4f6;
}

.assignee-group-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assignee-group-toggle {
  color: #6b7280;
  transition: transform 0.2s;
}

.assignee-group-toggle.collapsed {
  transform: rotate(-90deg);
}

.assignee-group-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assignee-group-name {
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.assignee-group-count {
  font-size: 12px;
  color: #6b7280;
}

.assignee-group-tasks {
  padding: 8px;
}

.assignee-group-tasks.collapsed {
  display: none;
}

.assignee-group-tasks .task-item {
  margin-bottom: 8px;
}

.assignee-group-tasks .task-item:last-child {
  margin-bottom: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: 0;
    top: 52px;
    height: calc(100vh - 52px);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .task-item {
    font-size: 14px;
  }

  #searchInput {
    width: 150px;
  }

  .modal-content {
    width: 95%;
    max-height: 90vh;
  }
}
