/* ============================================================
   Base & Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Single merged body rule — removes the conflicting duplicate */
body {
  margin: 0 auto;
  background-color: #fcfcfc;
  padding: 70px 50px 80px; /* top accounts for fixed nav; bottom for fixed footer */
  max-width: 1100px;
  box-shadow: 1px 4px 10px 1px #aaa;
  font-family: sans-serif;
  line-height: 1.6;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
}

label {
  color: #777;
  font-size: 0.8em;
}

/* ============================================================
   Header & Nav
   ============================================================ */
header {
  background: #333;
  color: #fff;
  padding: 10px 20px;
  text-align: left;
  position: fixed;        /* keep header visible while scrolling */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;           /* above header and all page content */
}

.menu-toggle {
  display: none;
}

.hamburger {
  font-size: 24px;
  cursor: pointer;
  display: inline-block;
  padding: 10px 16px;
  color: #fff;
  line-height: 1;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  background: #333;
  border: 1px solid #444;
  min-width: 140px;
}

.menu li {
  padding: 10px 20px;
}

.menu a {
  color: #fff;
  text-decoration: none;
}

.menu-toggle:checked ~ .menu {
  display: block;
}

/* ============================================================
   Main & Footer
   ============================================================ */
main {
  padding: 20px 0;
}

footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

/* ============================================================
   Add-task & Filter containers
   ============================================================ */
.add-task-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.add-task-container input[type="text"] {
  flex: 1 1 200px;
  height: 36px;
  padding: 6px 16px;
  border: none;
  background-color: #f3f3f3;
  margin-bottom: 0;   /* override global input rule inside containers */
}

.add-task-container input[type="date"] {
  height: 36px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  background-color: #f3f3f3;
  margin-bottom: 0;
}

.filter-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

/* ============================================================
   Form controls (global)
   ============================================================ */

/* Scoped margin — only standalone inputs outside flex containers */
input {
  margin-bottom: 15px;
}

input[type="text"] {
  display: block;
  height: 32px;
  padding: 6px 16px;
  width: 100%;
  border: none;
  background-color: #f3f3f3;
}

select {
  height: 36px;
  padding: 4px 8px;
  border: 1px solid #ddd;
  background-color: #f3f3f3;
  cursor: pointer;
}

button {
  display: inline-block;
  margin: 0;
  height: 36px;               /* was 1.5rem — too short, clipped text */
  padding: 0 18px;
  border-radius: 25px;
  border: none;
  color: #eee;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 1px 4px 10px 1px #aaa;

  background: #207cca;
  background: -moz-linear-gradient(left, #207cca 0%, #9f58a3 100%);
  background: -webkit-linear-gradient(left, #207cca 0%, #9f58a3 100%);
  background: linear-gradient(to right, #207cca 0%, #9f58a3 100%);
}

button:hover {
  opacity: 0.9;
}

/* ============================================================
   Table
   ============================================================ */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  border: 1px solid #ddd;
}

th, td {
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #f2f2f2;
}

/* ============================================================
   Task row elements
   ============================================================ */
.task-item {
  align-items: center;
}

/* Prevent global input margin from misaligning checkboxes in table rows */
.task-item input[type="checkbox"] {
  margin-bottom: 0;
  margin-right: 0;
  vertical-align: middle;
}

.task-text {
  margin-right: 10px;
}

.task-category,
.task-priority,
.task-due-date {
  width: 80px;
  text-align: center;
}

.delete-button {
  color: red;
  cursor: pointer;
}

.line-through {
  text-decoration: line-through;
  color: #999;
}
