:root {
  --color-navy: #0b1426;
  --color-blue: #003db5;
  --color-accent: #0055ff;

  --color-bg: #060d1a;
  --color-surface: #0e1829;
  --color-surface-2: #131f35;
  --color-surface-hover: #192842;

  --color-text: #e2e8f3;
  --color-text-secondary: #8494ad;
  --color-text-muted: #4d5e78;

  --color-border: rgba(255, 255, 255, 0.07);

  --color-success: #22c55e;
  --color-success-soft: rgba(34, 197, 94, 0.12);
  --color-danger: #ef4444;
  --color-danger-soft: rgba(239, 68, 68, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px 40px;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(
      ellipse 80% 50% at 20% 10%,
      rgba(0, 85, 255, 0.08) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 60% 40% at 80% 90%,
      rgba(0, 61, 181, 0.06) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

.app {
  width: 100%;
  max-width: 540px;
  position: relative;
  z-index: 1;
}

/* ── Header ──────────────────────────────────── */

.app-header {
  text-align: center;
  margin-bottom: 32px;
}

.header-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-blue));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 85, 255, 0.35);
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: white;
  margin-bottom: 4px;
}

.header-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 300;
}

/* ── Card ────────────────────────────────────── */

.app-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.35);
}

/* ── Form / Input ────────────────────────────── */

.todo-form {
  margin-bottom: 20px;
}

.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.todo-input {
  flex: 1;
  padding: 14px 18px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.todo-input::placeholder {
  color: var(--color-text-muted);
}

.todo-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 85, 255, 0.15);
}

.todo-button {
  padding: 14px 22px;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition), transform var(--transition),
    box-shadow var(--transition);
  white-space: nowrap;
}

.todo-button:hover {
  background: #1a6aff;
  box-shadow: 0 4px 16px rgba(0, 85, 255, 0.35);
  transform: translateY(-1px);
}

.todo-button:active {
  transform: translateY(0);
}

/* ── Filter Bar ──────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: var(--color-surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
}

.filter-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover {
  color: var(--color-text-secondary);
}

.filter-btn.active {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 85, 255, 0.3);
}

/* ── Todo Container ──────────────────────────── */

.todo-container {
  max-height: 420px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.todo-container::-webkit-scrollbar {
  width: 4px;
}

.todo-container::-webkit-scrollbar-track {
  background: transparent;
}

.todo-container::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: 4px;
}

/* ── Todo List ───────────────────────────────── */

.todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Todo Item ───────────────────────────────── */

.todo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--color-surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  animation: slideIn 0.3s ease-out;
}

.todo:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border);
}

.todo-item {
  flex: 1;
  list-style: none;
  font-size: 0.9rem;
  color: var(--color-text);
  transition: all var(--transition);
  word-break: break-word;
}

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

/* ── Complete Button (Circle Checkbox) ───────── */

.complete-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid var(--color-text-muted);
  background: transparent;
  color: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: all var(--transition);
}

.complete-btn:hover {
  border-color: var(--color-success);
  background: var(--color-success-soft);
  color: var(--color-success);
}

.completed .complete-btn {
  border-color: var(--color-success);
  background: var(--color-success);
  color: white;
}

/* ── Trash Button ────────────────────────────── */

.trash-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all var(--transition);
  opacity: 0;
}

.todo:hover .trash-btn {
  opacity: 1;
}

.trash-btn:hover {
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

/* ── Empty State ─────────────────────────────── */

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.empty-state span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── Footer / Stats ──────────────────────────── */

.app-footer {
  padding-top: 16px;
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  display: none;
}

.app-footer span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ── Animations ──────────────────────────────── */

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.todo-exit {
  animation: slideOut 0.25s ease forwards;
  pointer-events: none;
}

@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(20px) scale(0.95);
  }
}

/* ── Responsive ──────────────────────────────── */

@media (max-width: 480px) {
  body {
    padding: 30px 12px 24px;
  }

  .app-card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }

  .input-wrapper {
    flex-direction: column;
  }

  .todo-button {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .todo {
    gap: 10px;
    padding: 12px;
  }

  .trash-btn {
    opacity: 1;
  }
}
