apps/tasks/src/styles.css
/* CSS Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Light theme (default) */
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-surface-hover: #e9ecef;
  --color-border: #dee2e6;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-primary: #0d6efd;
  --color-primary-hover: #0b5ed7;
  --color-success: #198754;
  --color-warning: #fd7e14;
  --color-danger: #dc3545;
  --color-error: #dc3545;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #121212;
    --color-surface: #1e1e1e;
    --color-surface-hover: #2a2a2a;
    --color-border: #404040;
    --color-text: #ffffff;
    --color-text-muted: #b0b0b0;
    --color-primary: #4dabf7;
    --color-primary-hover: #339af0;
    --color-success: #51cf66;
    --color-warning: #ff922b;
    --color-danger: #ff6b6b;
    --color-error: #ff6b6b;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
  }
}

/* Manual theme overrides */
[data-theme="light"] {
  --color-bg: #ffffff;
  --color-surface: #f8f9fa;
  --color-surface-hover: #e9ecef;
  --color-border: #dee2e6;
  --color-text: #212529;
  --color-text-muted: #6c757d;
  --color-primary: #0d6efd;
  --color-primary-hover: #0b5ed7;
  --color-success: #198754;
  --color-warning: #fd7e14;
  --color-danger: #dc3545;
  --color-error: #dc3545;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  --color-bg: #121212;
  --color-surface: #1e1e1e;
  --color-surface-hover: #2a2a2a;
  --color-border: #404040;
  --color-text: #ffffff;
  --color-text-muted: #b0b0b0;
  --color-primary: #4dabf7;
  --color-primary-hover: #339af0;
  --color-success: #51cf66;
  --color-warning: #ff922b;
  --color-danger: #ff6b6b;
  --color-error: #ff6b6b;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layout */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
}

#theme-toggle {
  background: none;
  border: 2px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.25rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#theme-toggle:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-primary);
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Task Input Form */
.task-input {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text);
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

#cancel-edit-btn {
  background: var(--color-text-muted);
  margin-left: 0.5rem;
}

#cancel-edit-btn:hover {
  background: var(--color-danger);
}

/* Task Filters */
.task-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-controls label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.sort-controls select {
  padding: 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  background: var(--color-bg);
  color: var(--color-text);
}

/* Tasks Display */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.1s ease;
}

.task-item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.task-item.completed {
  opacity: 0.7;
}

.task-item.overdue {
  border-left: 4px solid var(--color-danger);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.task-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.task-title.completed {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.task-priority {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-weight: 500;
  text-transform: uppercase;
}

.task-priority.high {
  background: var(--color-danger);
  color: white;
}

.task-priority.medium {
  background: var(--color-warning);
  color: white;
}

.task-priority.low {
  background: var(--color-success);
  color: white;
}

.task-notes {
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.task-due {
  font-weight: 500;
}

.task-due.overdue {
  color: var(--color-danger);
  font-weight: 600;
}

.task-actions {
  display: flex;
  gap: 0.5rem;
}

.task-actions button {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.btn-complete {
  background: var(--color-success);
}

.btn-edit {
  background: var(--color-warning);
}

.btn-delete {
  background: var(--color-danger);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.loading-spinner {
  text-align: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Error Display */
.error-display {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.error-card {
  background: var(--color-surface);
  border: 1px solid var(--color-danger);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  max-width: 400px;
}

.error-card h3 {
  color: var(--color-danger);
  margin-bottom: 0.5rem;
}

.error-card button {
  background: var(--color-danger);
  margin-top: 1rem;
}

/* Footer */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

footer p {
  margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }
  
  header h1 {
    font-size: 1.25rem;
  }
  
  main {
    padding: 1rem;
  }
  
  .task-input {
    padding: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .task-filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .task-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .task-meta {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  
  .task-actions {
    margin-top: 0.5rem;
  }
}