* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #a855f7;
  --primary-dark: #9333ea;
  --success: #c084fc;
  --warning: #a855f7;
  --danger: #9333ea;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #d8b4fe, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-pending .stat-number {
  color: var(--warning);
}
.stat-completed .stat-number {
  color: var(--success);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  width: 200px;
}

.search-form button {
  padding: 0.75rem 1rem;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.filters {
  display: flex;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

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

.btn-add {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #a855f7, #9333ea);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.task-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

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

.task-card.priority-3 {
  border-left: 4px solid #9333ea;
}

.task-card.priority-2 {
  border-left: 4px solid #a855f7;
}

.task-card.priority-1 {
  border-left: 4px solid #c084fc;
}

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

.task-header h3 {
  font-size: 1.1rem;
}

.priority-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
}

.priority-badge.priority-3 {
  background: rgba(147, 51, 234, 0.3);
  color: #e9d5ff;
}

.priority-badge.priority-2 {
  background: rgba(168, 85, 247, 0.3);
  color: #f3e8ff;
}

.priority-badge.priority-1 {
  background: rgba(192, 132, 252, 0.3);
  color: #faf5ff;
}

.task-description {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.task-status.completed {
  color: #c084fc;
}

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

.task-actions a {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.btn-complete {
  background: rgba(192, 132, 252, 0.2);
  color: #c084fc;
}

.btn-complete:hover {
  background: #a855f7;
  color: white;
}

.btn-reopen {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.btn-reopen:hover {
  background: #9333ea;
  color: white;
}

.btn-edit {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.btn-edit:hover {
  background: #9333ea;
  color: white;
}

.btn-delete {
  background: rgba(147, 51, 234, 0.2);
  color: #9333ea;
}

.btn-delete:hover {
  background: #7e22ce;
  color: white;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--card);
  padding: 2rem;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  position: relative;
  border: 1px solid var(--border);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

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

.edit-form {
  background: var(--card);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.back-link {
  color: var(--primary);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
  }

  .search-form input {
    width: 100%;
  }

  .filters {
    width: 100%;
    justify-content: center;
  }
}
