:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --accent: #0b72ff;
  --accent-soft: #e2edff;
  --text: #1a2433;
  --muted: #6b778c;
  --danger: #ff3b30;
  --done: #22c55e;
  --border: #dde3ee;
}

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
}

.app {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header with logo */
.header {
  padding: 8px 12px;
  background: #ffffff;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo {
  height: 28px;          /* adjust if you want it smaller/bigger */
  width: auto;
  max-width: 180px;
  display: block;
}

/* Content */
.content {
  padding: 16px 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* List selector row (dropdown + buttons) */
.lists-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.list-select {
  flex: 1;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: #ffffff;
  outline: none;
}

.list-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.list-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #eff6ff;
  color: #1d4ed8;
  white-space: nowrap;
}

.list-btn:active {
  background: #e0e7ff;
}

/* Add row */
.add-row {
  display: flex;
  gap: 8px;
}

.add-row input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  outline: none;
}

.add-row input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Big add button */
.add-btn {
  border: none;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  transition: transform 0.05s ease-out, box-shadow 0.05s ease-out;
}

.add-btn:active {
  transform: scale(0.96) translateY(1px);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

/* Add icon inside the button */
.add-icon {
  width: 24px;   /* tweak this if icon feels too big/small */
  height: 24px;
  display: block;
}

/* List items */
.list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  flex: 1;
  overflow-y: auto;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
}

.empty-state {
  padding: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: white;
}

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

.item-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.item-title {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.item.done .item-title {
  text-decoration: line-through;
  color: var(--muted);
}

.item.done {
  background: #f0fdf4;
}

.checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
}

.checkbox.done {
  border-color: var(--done);
  background: var(--done);
  color: white;
}

/* Item action buttons: move / edit / delete */
.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 6px;
}

.icon-btn.move {
  color: #4b5563;
  font-size: 1.2rem;
}

.icon-btn.edit {
  color: #0f766e;
}

.icon-btn.delete {
  color: var(--danger);
}

/* Footer */
.footer {
  padding: 8px 16px 10px;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  background: #f9fafb;
}

.footer-buttons {
  display: flex;
  gap: 6px;
}

.footer-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #e5e7eb;
  color: #111827;
}

.footer-btn:active {
  background: #d1d5db;
}

.footer-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.loading {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ===== Modal styles ===== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-out;
}

.modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 16px 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
  transform: scale(0.9) translateY(12px);
  opacity: 0;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

.modal-backdrop.visible .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-body h2 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.modal-body p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-btn {
  border-radius: 999px;
  border: none;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.modal-btn.secondary {
  background: #e5e7eb;
  color: #111827;
}

.modal-btn.primary {
  background: var(--accent);
  color: white;
}
