:root {
  --bg: #1a1a1a;
  --border: #3d3d3d;
  --accent: #1e6e41;
  --accent-neon: #00ff00;
  --text: #e0e0e0;
  --card-bg: #232323;
  --status-complete: #1e6e41;
  --status-pending: #a00;
  --font-header: 'Fira Mono', 'Consolas', monospace;
  --font-body: 'Roboto', 'Arial', sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.2rem 2vw 0.6rem 2vw;
  border-bottom: 2px solid var(--border);
}

h1 {
  font-family: var(--font-header);
  font-size: 2rem;
  letter-spacing: 2px;
  margin: 0;
}

main {
  max-width: 600px;
  margin: 1rem auto 0 auto;
  padding: 0 2vw;
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

#clock-row-container {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding: 0 2vw;
}
#clock-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 2.2em;
  margin-top: 0.1em;
  margin-bottom: 0.2em;
}
#date {
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 1.13em;
  color: var(--text);
  text-shadow: none;
  letter-spacing: 0.08em;
}
#clock {
  font-family: 'Fira Mono', 'Consolas', monospace;
  font-size: 1.15em;
  color: var(--accent-neon);
  text-shadow: 0 0 8px var(--accent-neon), 0 0 16px #0f0;
  letter-spacing: 0.08em;
  animation: clock-blink 1s steps(1) infinite;
}
@keyframes clock-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.7; }
}

.card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  padding: 1.2rem 1rem 1rem 1rem;
  box-sizing: border-box;
  box-shadow: 0 2px 8px #0007;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.category-card {
  margin-bottom: 1.2rem;
  position: relative;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.category-header h3 {
  margin: 0;
}

.add-task-fab {
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.35em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px #0007;
  transition: background 0.2s;
  margin: 0 auto;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
  padding: 0;
}
.add-task-fab:hover, .add-task-fab:focus {
  background: #24a35c;
}

.category-content {
  width: 100%;
}

.progress-bar-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0.5em 0 0.5em 0;
}
.progress-bar-canvas {
  width: 98%;
  max-width: 480px;
  height: 22px !important;
  min-height: 22px !important;
  display: block;
}

.task-list {
  margin: 0.7em 0 0 0;
  padding: 0;
  list-style: none;
  transition: max-height 0.3s;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 0;
}

.task-info {
  display: flex;
  align-items: center;
  gap: 1em;
  flex: 1;
}

.task-name {
  font-family: var(--font-header);
  font-size: 1em;
}

.status {
  font-family: var(--font-header);
  font-size: 0.9em;
  padding: 0.15em 0.7em;
  border-radius: 5px;
  margin-right: 0.5em;
}

.task-right {
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.status.complete {
  background: var(--status-complete);
  color: #fff;
}

.status.pending {
  background: var(--status-pending);
  color: #fff;
}

.task-delete {
  color: #a00;
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s;
}
.task-delete:hover {
  color: #fff;
  opacity: 1;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 1.1em;
  height: 1.1em;
}

button, select {
  font-family: var(--font-header);
  font-size: 1em;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 0.5em 1.1em;
  margin: 0.5em auto;
  cursor: pointer;
  transition: background 0.2s;
  display: block;
  width: 200px;
}

.controls-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1em auto;
  width: 80%;
}

button.accent, select {
  background: var(--accent);
}

button:hover, select:hover {
  background: #24a35c;
}

dialog {
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  padding: 2em;
  min-width: 300px;
  box-shadow: 0 2px 16px #000a;
}

dialog label {
  display: block;
  margin: 1em 0 0.5em 0;
}

dialog input, dialog select {
  width: 100%;
  margin-top: 0.3em;
  margin-bottom: 0.7em;
  padding: 0.4em;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #181818;
  color: var(--text);
}

dialog menu {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  margin-top: 1.5em;
}

#toast {
  position: fixed;
  bottom: 2em;
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  max-width: 90vw;
  background: #232323ee;
  color: #fff;
  font-family: var(--font-header);
  font-size: 1.1em;
  padding: 1em 2em;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.3s;
}

#toast.show {
  opacity: 1;
  pointer-events: auto;
}

#confetti-root {
  position: fixed;
  left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999;
}

footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
  background: transparent;
  flex-shrink: 0;
}

.theme-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0.6em;
}

.theme-footer select {
  min-width: 180px;
  max-width: 100vw;
  text-align: center;
}

.purge-link-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.purge-link {
  color: #a00;
  text-align: center;
  font-family: var(--font-header);
  font-size: 1em;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  display: block;
  width: auto;
  transition: color 0.2s;
  margin: 0.5em auto 0 auto;
}
.purge-link:hover, .purge-link:focus {
  color: #fff;
  text-decoration: underline;
}

/* High Contrast Dark Theme */
.theme-hc-dark {
  --bg: #000;
  --border: #fff;
  --accent: #fff;
  --accent-neon: #00ff00;
  --text: #fff;
  --card-bg: #222;
  --status-complete: #0f0;
  --status-pending: #f00;
}
.theme-hc-dark button, .theme-hc-dark select {
  color: #000;
  background: #fff;
}
.theme-hc-dark dialog {
  background: #111;
  color: #fff;
}

/* High Contrast Light Theme */
.theme-hc-light {
  --bg: #fff;
  --border: #000;
  --accent: #000;
  --accent-neon: #00ff00;
  --text: #000;
  --card-bg: #f7f7f7;
  --status-complete: #090;
  --status-pending: #c00;
}
.theme-hc-light button, .theme-hc-light select {
  color: #fff;
  background: #000;
}
.theme-hc-light dialog {
  background: #fff;
  color: #000;
}

/* Neon Green Theme */
.theme-neon {
  --bg: #131313;
  --border: #00ff00;
  --accent: #00ff00;
  --accent-neon: #00ff00;
  --text: #00ff00;
  --card-bg: #191919;
  --status-complete: #00ff00;
  --status-pending: #ff00ff;
}
.theme-neon button, .theme-neon select {
  color: #131313;
  background: #00ff00;
}
.theme-neon dialog {
  background: #191919;
  color: #00ff00;
}

/* Mobile-first adjustments */
@media (max-width: 600px) {
  main {
    max-width: 98vw;
    padding: 0 1vw;
  }
  #clock-row-container {
    max-width: 98vw;
    padding: 0 1vw;
  }
  #theme-purge-controls {
    max-width: 98vw;
    padding: 0 1vw 1.5em 1vw;
  }
  .card {
    padding: 1em 0.5em 0.8em 0.5em;
  }
  .category-header h3 {
    font-size: 1.1em;
  }
}
