/* Basic dark theme, responsive layout, and accessible focus styles */

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #0b1120; /* dark navy */
  color: #e5e7eb;      /* light gray */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem;
}

/* App container */
.app {
  width: 100%;
  max-width: 480px;
  background: #020617;
  border-radius: 1rem;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6);
  padding: 1.5rem 1.5rem 1.25rem;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.app-header h1 {
  font-size: 1.9rem;
  letter-spacing: 0.05em;
}

.subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

/* Add task */
.add-task-section {
  margin-bottom: 1rem;
}

#taskForm {
  display: flex;
  gap: 0.5rem;
}

#taskInput {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.95rem;
}

#taskInput::placeholder {
  color: #6b7280;
}

#taskInput:focus {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

button {
  border: none;
  cursor: pointer;
}

#taskForm button[type="submit"] {
  padding: 0.6rem 0.95rem;
  border-radius: 0.55rem;
  background: #38bdf8;
  color: #020617;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}

#taskForm button[type="submit"]:hover {
  background: #0ea5e9;
  transform: translateY(-1px);
}

#taskForm button[type="submit"]:active {
  transform: translateY(0);
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.filters {
  display: flex;
  gap: 0.35rem;
}

.filter-button {
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: transparent;
  color: #9ca3af;
  border: 1px solid transparent;
}

.filter-button.active {
  background: #111827;
  color: #e5e7eb;
  border-color: #1f2937;
}

.filter-button:hover {
  color: #e5e7eb;
}

.link-button {
  background: none;
  color: #9ca3af;
  font-size: 0.8rem;
  text-decoration: underline;
}

.link-button:hover {
  color: #e5e7eb;
}

/* Task list */
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  background: #020617;
  border: 1px solid #111827;
}

.task-item.completed {
  opacity: 0.7;
}

.task-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: #22c55e;
}

.task-title {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.3;
}

.task-title.completed {
  text-decoration: line-through;
  color: #6b7280;
}

.task-actions {
  display: flex;
  gap: 0.25rem;
}

.task-actions button {
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.4rem;
}

.task-actions button:hover {
  background: #111827;
  color: #e5e7eb;
}

/* Footer */
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* Utility */
.visually-hidden {
  position: absolute;
  height: 1px;
  width: 1px;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/* Scrollbar for task list (optional) */
.task-list::-webkit-scrollbar {
  width: 6px;
}

.task-list::-webkit-scrollbar-thumb {
  background: #1f2937;
  border-radius: 999px;
}
