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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
}

.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 500px;
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.tabs {
  display: flex;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
}

.tab {
  flex: 1;
  padding: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: #374151;
  background: #e5e7eb;
}

.tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
  background: white;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

.add-form {
  display: flex;
  gap: 0.5rem;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

#item-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

#item-input:focus {
  outline: none;
  border-color: #667eea;
}

#item-input::placeholder {
  color: #9ca3af;
}

button[type="submit"] {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:active {
  transform: translateY(0);
}

.delete-all-checked {
  width: 100%;
  padding: 1rem 1.5rem;
  background: #f97316;
  color: white;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 10;
  min-height: 48px;
}

.delete-all-checked:hover {
  background: #ea580c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.delete-all-checked:active {
  transform: translateY(0);
}

.delete-all-checked.visible {
  display: block;
}

.items-list {
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
}

.item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s;
  cursor: pointer;
}

.item:hover {
  background-color: #f9fafb;
}

.item:last-child {
  border-bottom: none;
}

.item input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #667eea;
}

.item-name {
  flex: 1;
  font-size: 1rem;
  color: #1f2937;
  transition: color 0.2s;
}

.item.completed .item-name {
  color: #9ca3af;
  text-decoration: line-through;
}

.delete-button {
  padding: 0.5rem 0.75rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
}

.item:hover .delete-button {
  opacity: 1;
}

.delete-button:hover {
  background: #dc2626;
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #9ca3af;
  font-size: 1rem;
}

/* Mobile responsive */
@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .container {
    border-radius: 0;
    max-width: 100%;
    min-height: 100vh;
  }

  .items-list {
    max-height: none;
    flex: 1;
  }

  .delete-button {
    opacity: 1;
  }
}
