/* ===== Base ===== */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, rgba(74, 80, 220, 0.22), transparent 32%),
    linear-gradient(180deg, #041020 0%, #060c15 40%, #020409 100%);
  color: #eaf0ff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 36px 16px 24px;
}

.page-shell {
  width: min(1180px, 100%);
}

.app-header,
.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(2.8rem, 4vw, 5rem);
  letter-spacing: -0.03em;
}

.app-subtitle {
  margin: 10px 0 0;
  color: rgba(234, 240, 255, 0.8);
  font-size: 1.05rem;
  max-width: 620px;
}

.app-badge {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 16px;
  color: #d9deff;
  font-size: 0.95rem;
  font-weight: 700;
}

.app-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.list-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.overview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.overview-label {
  margin: 0;
  color: rgba(234, 240, 255, 0.7);
  font-size: 0.95rem;
}

.overview-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #eaf0ff;
  font-size: 0.95rem;
  font-weight: 700;
}

.todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 56px 16px 16px;
  margin: 10px 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

li:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

li.dragging {
  opacity: 0.5;
}

li.drag-over {
  border-color: rgba(124, 92, 255, 0.85);
  background: rgba(124, 92, 255, 0.2);
}

li[draggable="true"] {
  cursor: grab;
}

li p {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: #eaf0ff;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.task-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
  align-items: center;
}

.icon-button,
.complete-checkbox {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(10, 16, 28, 0.72);
  color: #eaf0ff;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.icon-button:hover,
.complete-checkbox:hover {
  transform: translateY(-1px);
  border-color: rgba(124, 92, 255, 0.9);
  background: rgba(124, 92, 255, 0.16);
}

.icon-button.active {
  background: rgba(255, 204, 74, 0.14);
  border-color: rgba(255, 204, 74, 0.35);
}

.desktop-only {
  display: inline-flex;
}

.mobile-only {
  display: none;
}

.icon-button::after,
.complete-checkbox::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(20, 25, 35, 0.95);
  color: #f8fafe;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 120ms ease, transform 120ms ease;
}

.icon-button:hover::after,
.complete-checkbox:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.complete-checkbox {
  gap: 0;
  padding: 0;
  min-width: 42px;
  min-height: 42px;
  width: 42px;
  height: 42px;
  justify-content: center;
  border: none;
  background: transparent;
}

.complete-checkbox input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.complete-checkbox span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 26, 40, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
  color: transparent;
  font-size: 1rem;
}

.complete-checkbox:hover span {
  border-color: rgba(124, 92, 255, 0.9);
}

.complete-checkbox input:checked + span {
  border-color: #4ade80;
  background: linear-gradient(145deg, #164d1f, #4ade80);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
  color: #f8fafe;
}

.complete-checkbox input:checked + span::after {
  content: "✔";
}

.due-date {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  color: rgba(234, 240, 255, 0.78);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: normal;
}

.due-date-line {
  display: block;
}

.overdue {
  color: #ffb4c0;
  background: rgba(231, 22, 64, 0.22);
  border-color: rgba(231, 22, 64, 0.35);
  font-weight: 700;
}

.due-today {
  color: #ffe2b0;
  background: rgba(255, 152, 0, 0.22);
  border-color: rgba(255, 152, 0, 0.35);
  font-weight: 700;
}

.task-form {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  flex-wrap: wrap;
}

.new-task-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1 1 60%;
  min-width: 260px;
}

.new-task-field .toolbar-label {
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  resize: horizontal;
  font-size: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 14px 16px;
  background: rgba(7, 14, 26, 0.72);
  color: #eaf0ff;
  line-height: 1.4;
  overflow-y: hidden;
}

textarea:focus {
  border-color: rgba(124, 92, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

input,
button {
  font-family: inherit;
  font-size: 0.98rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 12px 14px;
  background: rgba(10, 16, 28, 0.72);
  color: #eaf0ff;
  outline: none;
}

input:focus,
button:focus {
  border-color: rgba(124, 92, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.16);
}

input::placeholder,
textarea::placeholder {
  color: rgba(234, 240, 255, 0.55);
}

input[type="date"] {
  width: 170px;
}

button {
  cursor: pointer;
  background: rgba(106, 86, 190, 0.92);
  border: 1px solid rgba(52, 10, 238, 0.35);
  color: #fff;
  font-weight: 700;
  transition: transform 100ms ease, filter 120ms ease, background 120ms ease;
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  transform: translateY(1px);
}

input:disabled,
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.task-buttons button,
.task-buttons input[type="button"] {
  padding: 9px 12px;
  border-radius: 14px;
}

.delete-task-btn {
  cursor: pointer;
  background: rgba(209, 97, 119, 0.95);
  border: 1px solid rgba(231, 22, 64, 0.35);
  color: white;
  font-weight: 700;
}

.secondary-button {
  background: rgba(65, 76, 184, 0.9);
}

.small-button {
  width: 42px;
  min-width: 42px;
  padding: 10px 0;
}

.complete {
  text-decoration: line-through;
  opacity: 0.65;
}

.important {
  font-weight: 800;
  color: #ffd1dc;
}

.important::before {
  content: "❗ ";
  margin-right: 4px;
}

.lists-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.toolbar-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  color: rgba(234, 240, 255, 0.75);
  font-size: 0.95rem;
}

.toolbar-small {
  min-width: 160px;
}

.toolbar-input {
  flex: 1;
  min-width: 240px;
}

.task-form-right {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  flex: 0 0 auto;
}

.alarm-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(234, 240, 255, 0.82);
  font-size: 0.95rem;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(234, 240, 255, 0.76);
}

.app-footer {
  margin-top: 18px;
  color: rgba(234, 240, 255, 0.75);
  font-size: 0.96rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.hidden {
  display: none;
}

.modal-content {
  width: min(460px, 100%);
  background: #1f242b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.modal-content h2 {
  margin: 0 0 10px 0;
  font-size: 1.35rem;
  color: #eaf0ff;
}

.modal-content p {
  margin: 0 0 20px 0;
  color: rgba(234, 240, 255, 0.82);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-actions button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

#modal-cancel {
  background: rgba(255, 255, 255, 0.12);
  color: #eaf0ff;
}

#modal-confirm {
  background: rgba(231, 22, 64, 0.92);
  color: white;
}

input[type="button"]:active {
  transform: translateY(1px);
}

input:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* make small icon buttons look good (arrows) */
.task-buttons input[type="button"] {
  padding: 8px 10px;
  border-radius: 12px;
}

/* ===== Completed + Important styles ===== */
.complete {
  text-decoration: line-through;
  opacity: 0.65;
}

.important {
  font-weight: 800;
  color: #ffd1dc;
}

.important::before {
  content: "❗ ";
  margin-right: 4px;
}

.lists-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  flex-wrap: wrap;
}

#list-select,
#new-list-name {
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 10px 12px;
  background: rgba(10, 16, 28, 0.55);
  color: #eaf0ff;
  outline: none;
}

#list-select {
  min-width: 220px;
}

#new-list-name {
  flex: 1;
  min-width: 220px;
}

.delete-task-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(231, 22, 64, 0.35);
  border-radius: 50%;
  background: rgba(209, 97, 119, 0.88);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.delete-task-btn:hover {
  background: rgba(231, 22, 64, 0.95);
  transform: translateY(-1px);
}

.delete-task-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 50%;
  transform: translateX(50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(20, 25, 35, 0.96);
  color: #f8fafe;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: opacity 120ms ease, transform 120ms ease;
}

.delete-task-btn:hover::after {
  opacity: 1;
  transform: translateX(50%) translateY(-4px);
}

@media (max-width: 960px) {
  body {
    padding: 24px 14px 20px;
  }

  .app-header,
  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-card {
    padding: 20px;
  }

  .app-subtitle {
    max-width: 100%;
  }

  .lists-toolbar {
    align-items: stretch;
  }

  .toolbar-label,
  .toolbar-input,
  .toolbar-actions,
  .task-form-right {
    width: 100%;
  }

  .toolbar-label {
    min-width: auto;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .task-form {
    align-items: stretch;
  }

  .new-task-field {
    flex: 1 1 100%;
    min-width: auto;
  }

  .task-form-right {
    gap: 10px;
    align-items: stretch;
  }

  .task-form-right label,
  .alarm-toggle,
  .task-form-right button {
    width: 100%;
  }

  input[type="date"] {
    width: 100%;
  }

  li {
    flex-wrap: wrap;
    align-items: center;
  }

  li p {
    min-width: 0;
  }

  .task-buttons {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    padding: 18px 12px 18px;
  }

  .app-card {
    padding: 18px;
    border-radius: 18px;
  }

  .app-header h1 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .app-subtitle {
    font-size: 1rem;
  }

  .lists-toolbar,
  .task-form-right {
    gap: 12px;
  }

  .toolbar-actions {
    justify-content: stretch;
    gap: 10px;
  }

  .toolbar-actions button {
    flex: 1 1 48%;
  }

  .task-form-right {
    flex-direction: column;
  }

  .task-form-right label,
  .alarm-toggle,
  .task-form-right button,
  .toolbar-actions button {
    width: 100%;
  }

  .task-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }

  .task-buttons button,
  .task-buttons label,
  .task-buttons .complete-checkbox {
    width: auto;
  }

  .task-buttons .icon-button,
  .task-buttons .complete-checkbox {
    min-width: 42px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .todo-list li {
    padding: 14px;
  }

  .modal-content {
    padding: 22px;
    width: min(100%, 420px);
  }

  .modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-actions button {
    width: 100%;
  }
}

/*popup*/ 
/* body {
    background-color: #070d0d;
    font-family: sans-serif;
    color: #fff;
}

ul {
    padding: 10px;
    background-color: #fff;
}

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #b30049;
    padding: 2px;
    margin: 2px;
    color: #070d0d;
    font-size: 1.2rem;
}

p {
    margin: 2px;
}


#new-task-input {
    display: flex;
    width: 100%;
    justify-content: space-between;
    background-color: #fff;
}

input {
    font-size: 1.2rem;
    border: 2px solid #fff;
    padding: 6px;
}

input[type="text"] {
    flex-basis: 80%;
}
input[type="button"]#new-task-button {
    flex-grow: 1;
}

input[type="button"] {
    background: #b30049;
    color: #fff;
}

.complete {
    text-decoration: line-through;
}

.important::before {
    content: "❗ ";
    margin-right: 5px;
}
.important {
    font-weight: bold;
    color: #e71640;
}

.task-buttons {
    display: flex;
    align-items: center;
    gap:  8px;
}

.due-date {
    font-size: 0.9rem;
    color: #666;
}

li p {
    flex-grow: 1;
}

.overdue {
    color: #e71640;
    font-weight: bold;
}

.due-today {
    color: #ff9800;
    font-weight: bold;
}

.task-buttons input {
    min-width: 32px;
}

input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
  */