body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f4f4;
  color: #222;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

.task-container {
  width: 90%;
  max-width: 480px;
  margin: 20px auto;
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

h1 {
  text-align: center;
  margin-top: 0;
}

.task-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.task-input input,
.task-input select,
.task-input button {
  flex: 1 1 100%;
  padding: 8px;
  font-size: 14px;
}

#voiceInputBtn {
  flex: 1 1 100%;
  background: #eaeaea;
  cursor: pointer;
}

#addTaskButton {
  background-color: #4CAF50;
  color: white;
  font-weight: bold;
  cursor: pointer;
  border: none;
}

.task-filters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

#taskScrollWrapper {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-top: 10px;
  padding: 5px;
  background: #fafafa;
}

#taskList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#taskList li {
  padding: 8px;
  border-bottom: 1px solid #ddd;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

#taskList li.completed {
  text-decoration: line-through;
  opacity: 0.6;
}

#taskList li.overdue {
  background: #ffe0e0;
}

#taskList button {
  margin-left: 5px;
  cursor: pointer;
}

.task-stats {
  display: flex;
  justify-content: space-around;
  font-size: 14px;
  margin-top: 10px;
}

.category-bar-container {
  margin-top: 6px;
}

.category-bar {
  background: #ddd;
  border-radius: 6px;
  overflow: hidden;
  height: 8px;
  margin-top: 3px;
}

.category-fill {
  background: #4CAF50;
  height: 100%;
  transition: width 0.3s;
}

details {
  margin: 8px 0;
}

.dark body {
  background-color: #111;
  color: #f4f4f4;
}

.dark .task-container {
  background-color: #222;
}

.export-btn {
  background: #007bff;
  color: white;
  padding: 6px 10px;
  border: none;
  cursor: pointer;
}

/* DARK MODE FIXES */
body.dark {
  background-color: #121212;
  color: #f0f0f0;
}

body.dark .task-container {
  background-color: #1e1e1e;
  color: #f0f0f0;
}

body.dark input,
body.dark select,
body.dark button,
body.dark textarea {
  background-color: #2a2a2a;
  color: #f0f0f0;
  border: 1px solid #555;
}

body.dark input::placeholder {
  color: #aaa;
}

body.dark summary {
  color: #ddd;
}

body.dark .category-bar {
  background: #444;
}

body.dark .category-fill {
  background: #4CAF50;
}

body.dark .task-stats {
  color: #ccc;
}

body.dark #taskScrollWrapper {
  background-color: #2a2a2a;
}

body.dark details[open] summary::after {
  filter: brightness(0.8);
}

body.dark #taskList li {
  background: #2c2c2c;
  border-bottom: 1px solid #444;
}

body.dark #taskList li.overdue {
  background: #442222;
}

/* Drag And Drop */ 

/* Highlight target during drag-over */
li.drag-over {
  border: 2px dashed #4caf50;
  background-color: #f0fff0;
}

/* Optional: Visual cue for dragging */
li:active {
  opacity: 0.6;
  cursor: grabbing;
}

li {
  user-select: none;
  -webkit-user-select: none; /* For Safari */
  -moz-user-select: none;    /* For Firefox */
  -ms-user-select: none;     /* For IE/Edge */
}

/* Theme */

body.light {
  background: #fefefe;
  color: #111;
}

body.dark {
  background: #222;
  color: #eee;
}

body.purple {
  background: #2e003e;
  color: #fcdfff;
}

body.matrix {
  background: #000;
  color: #00ff00;
}

body.matrix li {
  background-color: #001a00;
  border-color: #00ff00;
  color: #00ff00;
}

body.purple li {
  background-color: #3e0066;
  border-color: #bf00ff;
  color: #fcdfff;
}

/* Sub Tasks */

.subtask-list {
  margin-top: 5px;
  padding-left: 20px;
}

.subtask {
  font-size: 0.9em;
  margin: 2px 0;
}

.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 480px;
}

.task-container {
  flex: 1; /* pushes footer to bottom */
}

footer {
  background-color: #222;
  color: white;
  text-align: center;
  font-size: 14px;
  padding: 10px;
  opacity: 0.7;
}

/* Links */

a {
  color: #00f8ff;
  text-decoration: none;
}

a:visited {
  color: #00f8ff;
}

a:hover {
  text-decoration: underline;
}

a:active {
  color: #00e0ff;
}
