/* ===========================
   GLOBAL RESET
=========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base body layout (theme-specific colors will override) */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Main container */
.todo-container {
  width: 100%;
  max-width: 460px;
  padding: 24px 28px;
  border-radius: 14px;
}

/* Input row */
.todo-input-area {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

/* Todo text + actions layout */
.todo-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
}

.todo-text {
  flex: 1;
  margin-right: 12px;
  font-size: 14px;
  line-height: 1.4;
}

/* Container for the Done/Undo + Delete buttons */
.todo-actions {
  display: flex;
  gap: 8px; /* spacing between buttons */
}

/* List layout */
#todo-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Clear Completed wrapper: align button to the right */
.clear-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ===========================
   THEME TOGGLE BUTTON
=========================== */
#theme-toggle {
  margin-bottom: 18px;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: 0.2s;
}

/* ===========================
   NORMAL (LIGHT) THEME
=========================== */
body.theme-normal {
  background: #f3f4f6;
  color: #111827;
}

body.theme-normal .todo-container {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.theme-normal h1 {
  color: #111827;
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.4rem;
  font-weight: 700;
}

/* Input */
body.theme-normal #todo-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fefefe;
  font-size: 14px;
  transition: 0.2s;
}

body.theme-normal #todo-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 6px rgba(37, 99, 235, 0.3);
}

/* Add + Clear Completed buttons */
body.theme-normal #add-btn,
body.theme-normal #clear-completed-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

body.theme-normal #add-btn:hover,
body.theme-normal #clear-completed-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* Toggle button in normal theme */
body.theme-normal #theme-toggle {
  background: #e5e7eb;
  color: #111827;
}

body.theme-normal #theme-toggle:hover {
  transform: translateY(-2px);
}

/* Todo items in normal theme */
body.theme-normal .todo-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: 0.2s;
}

body.theme-normal .todo-item:hover {
  background: #f3f4ff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* Completed style */
body.theme-normal .completed {
  text-decoration: line-through;
  color: #9ca3af;
}

/* Buttons inside todo items – NORMAL THEME */
/* Undo/Done */
body.theme-normal .complete-btn {
  background: #10b981;
  color: white;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

body.theme-normal .complete-btn:hover {
  background: #059669;
  transform: translateY(-2px);
}

/* Delete */
body.theme-normal .delete-btn {
  background: #ef4444;
  color: white;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}

body.theme-normal .delete-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ===========================
   HACKER THEME (NEON GREEN)
=========================== */
body.theme-hacker {
  background: radial-gradient(circle at top, #020617 0, #000000 60%, #020617 100%);
  font-family: "Consolas", "Fira Code", monospace;
  color: #e5e7eb;
}

body.theme-hacker .todo-container {
  background: rgba(10, 15, 30, 0.95);
  border: 1px solid #22c55e55;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.25);
}

/* Title */
body.theme-hacker h1 {
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.4rem;
  font-weight: 700;
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

/* Input */
body.theme-hacker #todo-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: #020617;
  border: 1px solid #1f2937;
  color: #d1fae5;
  caret-color: #22c55e;
  font-size: 14px;
  transition: 0.2s;
}

body.theme-hacker #todo-input:focus {
  border-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* Add + Clear Completed buttons – HACKER THEME */
body.theme-hacker #add-btn,
body.theme-hacker #clear-completed-btn {
  background: #22c55e;
  color: #020617;
  font-weight: 700;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.8);
  transition: 0.2s;
}

body.theme-hacker #add-btn:hover,
body.theme-hacker #clear-completed-btn:hover {
  background: #4ade80;
  box-shadow: 0 0 20px rgba(74, 222, 128, 1);
  transform: translateY(-2px);
}

/* Toggle button in hacker theme */
body.theme-hacker #theme-toggle {
  background: #0f172a;
  color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

body.theme-hacker #theme-toggle:hover {
  transform: translateY(-2px);
}

/* Todo items in hacker theme */
body.theme-hacker .todo-item {
  background: #020617;
  border: 1px solid #1e293b;
  transition: 0.2s;
}

body.theme-hacker .todo-item:hover {
  border-color: #22c55e80;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
  transform: translateY(-3px);
}

/* Completed tasks – hacker */
body.theme-hacker .completed {
  color: #64748b;
  text-decoration: line-through;
}

/* Buttons inside todo items – HACKER THEME */
/* Undo/Done */
body.theme-hacker .complete-btn {
  background: #22c55e;
  color: #020617;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
  transition: 0.2s;
}

body.theme-hacker .complete-btn:hover {
  background: #4ade80;
  box-shadow: 0 0 16px rgba(74, 222, 128, 1);
  transform: translateY(-2px);
}

/* Delete */
body.theme-hacker .delete-btn {
  background: #ef4444;
  color: #ffffff;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.7);
  transition: 0.2s;
}

body.theme-hacker .delete-btn:hover {
  background: #f97373;
  box-shadow: 0 0 18px rgba(248, 113, 113, 1);
  transform: translateY(-2px);
}

/* ===========================
   MOBILE RESPONSIVE TWEAKS
   (small screens)
=========================== */
@media (max-width: 480px) {
  body {
    padding: 16px;
    align-items: flex-start; /* card starts a bit higher */
  }

  .todo-container {
    max-width: 100%;
    width: 100%;
    padding: 16px 14px;
    border-radius: 10px;
  }

  /* Make title a bit smaller on phones */
  h1 {
    font-size: 1.2rem;
    margin-bottom: 14px;
  }

  /* Theme toggle full width on mobile */
  #theme-toggle {
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 7px 10px;
    margin-bottom: 12px;
  }

  /* Stack input + button vertically */
  .todo-input-area {
    flex-direction: column;
    gap: 8px;
  }

  /* Add button full width */
  #add-btn {
    width: 100%;
    text-align: center;
  }

  /* Todo items: a bit tighter */
  .todo-item {
    padding: 8px 10px;
  }

  /* Buttons inside each todo: slightly smaller, can wrap */
  .todo-actions {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .todo-actions button {
    padding: 5px 10px;
    font-size: 11px;
  }

  /* Clear Completed button: not too big */
  .clear-wrapper {
    margin-top: 12px;
  }

  #clear-completed-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
