:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --danger-color: #f72585;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --gray-color: #6c757d;
  --high-priority: #ef233c;
  --medium-priority: #ff9f1c;
  --low-priority: #2ec4b6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 30px 15px;
  margin: 0;
  color: var(--dark-color);
}

.container {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
  transition: all 0.3s ease;
}

header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  color: var(--primary-color);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.date-display {
  color: var(--gray-color);
  font-size: 0.9rem;
}

.tabs {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.tab-btn {
  padding: 8px 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-color);
  position: relative;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: var(--primary-color);
  font-weight: bold;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary-color);
}

.tab-btn:hover:not(.active) {
  color: var(--secondary-color);
}

.input-section {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

input[type="text"] {
  flex: 1;
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  transition: border 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

button {
  padding: 12px 20px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

button:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.add-btn {
  min-width: 100px;
}

.task-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 15px;
}

.search-box {
  flex: 1;
  position: relative;
  max-width: 250px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-color);
}

.search-box input {
  width: 100%;
  padding-left: 35px;
}

.sort-options select {
  padding: 10px 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background-color: white;
  cursor: pointer;
}

.task-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--gray-color);
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  background: white;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

li:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

li.high-priority {
  border-left-color: var(--high-priority);
}

li.medium-priority {
  border-left-color: var(--medium-priority);
}

li.low-priority {
  border-left-color: var(--low-priority);
}

li.completed span.task-text {
  text-decoration: line-through;
  color: var(--gray-color);
  opacity: 0.7;
}

li.important .task-text::before {
  content: '⭐ ';
}

.task-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.task-text {
  flex: 1;
  word-break: break-word;
  padding-right: 10px;
}

.task-due {
  font-size: 0.75rem;
  color: var(--gray-color);
  margin-top: 3px;
}

.task-due.overdue {
  color: var(--danger-color);
  font-weight: bold;
}

.actions {
  display: flex;
  gap: 8px;
}

.actions button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-color);
  transition: all 0.2s ease;
}

.actions button:hover {
  background: #f0f0f0;
  color: var(--dark-color);
}

.actions button.complete:hover {
  color: var(--success-color);
}

.actions button.edit:hover {
  color: var(--primary-color);
}

.actions button.delete:hover {
  color: var(--danger-color);
}

.actions button.important:hover {
  color: var(--warning-color);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-color);
  display: none;
}

.empty-state i {
  font-size: 50px;
  margin-bottom: 15px;
  color: #e0e0e0;
}

.empty-state p {
  font-size: 18px;
}

.priority-colors {
  display: flex;
  justify-content: space-around;
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid #eee;
  font-size: 0.8rem;
  color: var(--gray-color);
}

.color-info {
  display: flex;
  align-items: center;
  gap: 5px;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.color-dot.high {
  background-color: var(--high-priority);
}

.color-dot.medium {
  background-color: var(--medium-priority);
}

.color-dot.low {
  background-color: var(--low-priority);
}

.editing {
  outline: 2px dashed var(--primary-color);
  padding: 5px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .container {
    padding: 15px;
  }
  
  .input-section {
    flex-direction: column;
  }
  
  button {
    width: 100%;
    justify-content: center;
  }
  
  .task-controls {
    flex-direction: column;
  }
  
  .search-box {
    max-width: 100%;
  }
  
  .priority-colors {
    flex-direction: column;
    gap: 8px;
  }
}