/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --success-dark: #15803d;
  --danger: #dc2626;
  --danger-dark: #b91c1c;
  --secondary: #6b7280;
  --secondary-dark: #4b5563;
  --border: #e5e7eb;
  --bg-gray: #f9fafb;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-gray);
  padding: 20px;
}

/* Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Header */
.header {
  margin-bottom: 32px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  padding-bottom: 24px;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 12px;
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Priority Filter */
.priority-filter {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-gray);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.filter-link {
  padding: 6px 16px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s;
  border: 1px solid var(--border);
  background: white;
}

.filter-link:hover {
  color: var(--primary);
  border-color: var(--primary);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: white;
  margin-bottom: 24px;
}

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

.btn-success {
  background: var(--success);
  color: white;
  font-weight: 600;
}

.btn-success:hover {
  background: var(--success-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--border);
  font-weight: 400;
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-secondary {
  background: white;
  color: var(--secondary);
  border: 1px solid var(--border);
  font-weight: 500;
}

.btn-secondary:hover {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 0.85rem;
}

/* Alerts */
.notice, .alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.notice {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* Tasks Section */
.tasks-section {
  margin-bottom: 40px;
}

.tasks-section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  background: white;
  transition: box-shadow 0.2s;
}

.task-card:hover {
  box-shadow: var(--shadow-lg);
}

.task-card.task--completed {
  background: var(--bg-gray);
  opacity: 0.75;
}

.task-content {
  margin-bottom: 16px;
}

.task-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.task-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

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

/* Priority Badges */
.priority-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.priority-badge.priority-low {
  background: #f3f4f6;
  color: #6b7280;
}

.priority-badge.priority-normal {
  background: #dbeafe;
  color: #1e40af;
}

.priority-badge.priority-high {
  background: #fef3c7;
  color: #92400e;
}

.task-description {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.task-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

/* Forms */
.task-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

/* Error Messages */
.error-messages {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
}

.error-messages h3 {
  color: #991b1b;
  font-size: 1rem;
  margin-bottom: 8px;
}

.error-messages ul {
  list-style: none;
  padding-left: 0;
}

.error-messages li {
  color: #991b1b;
  font-size: 0.9rem;
  padding: 4px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .task-actions {
    flex-direction: column;
  }

  .task-actions .btn {
    width: 100%;
  }

  .priority-filter {
    flex-direction: column;
    align-items: flex-start;
  }
}
