/* ── Themes ─────────────────────────────────────────────────────────────── */

:root,
[data-theme="cyberpunk-dark"] {
  --bg: #0d0d1a;
  --bg-card: #161628;
  --bg-list: #1a1a2e;
  --primary: #ffe600;
  --secondary: #ff006e;
  --accent: #00f5ff;
  --text: #e0e0ff;
  --text-muted: #888aaa;
  --border: #2a2a4a;
  --shadow: 0 0 16px rgba(255, 230, 0, 0.15);
  --glow-primary: 0 0 12px rgba(255, 230, 0, 0.5);
  --glow-secondary: 0 0 12px rgba(255, 0, 110, 0.5);
  --glow-accent: 0 0 12px rgba(0, 245, 255, 0.5);
  --radius: 6px;
  --font: "Courier New", Courier, monospace;
}

[data-theme="cyberpunk-light"] {
  --bg: #ffe600;
  --bg-card: #ffffff;
  --bg-list: #fff9c4;
  --primary: #ff006e;
  --secondary: #ff4081;
  --accent: #c800a1;
  --text: #ff006e;
  --text-muted: #cc005a;
  --border: #ffd54f;
  --shadow: 0 2px 12px rgba(255, 0, 110, 0.15);
  --glow-primary: 0 0 12px rgba(255, 0, 110, 0.5);
  --glow-secondary: 0 0 12px rgba(255, 64, 129, 0.4);
  --glow-accent: 0 0 12px rgba(200, 0, 161, 0.4);
  --radius: 6px;
  --font: "Courier New", Courier, monospace;
}

[data-theme="synthwave"] {
  --bg: #1a0533;
  --bg-card: #220940;
  --bg-list: #2a0d50;
  --primary: #ff6ec7;
  --secondary: #ff9e00;
  --accent: #c77dff;
  --text: #f0d0ff;
  --text-muted: #a080c0;
  --border: #3d1a66;
  --shadow: 0 0 16px rgba(255, 110, 199, 0.15);
  --glow-primary: 0 0 12px rgba(255, 110, 199, 0.6);
  --glow-secondary: 0 0 12px rgba(255, 158, 0, 0.5);
  --glow-accent: 0 0 12px rgba(199, 125, 255, 0.5);
  --radius: 6px;
  --font: "Segoe UI", system-ui, sans-serif;
}

[data-theme="cotton-candy"] {
  --bg: #fff0f8;
  --bg-card: #ffffff;
  --bg-list: #ffe8f5;
  --primary: #ff69b4;
  --secondary: #9b59b6;
  --accent: #5bc0eb;
  --text: #2d1b33;
  --text-muted: #7a5a85;
  --border: #f0c0e0;
  --shadow: 0 2px 12px rgba(255, 105, 180, 0.12);
  --glow-primary: 0 0 8px rgba(255, 105, 180, 0.4);
  --glow-secondary: 0 0 8px rgba(155, 89, 182, 0.3);
  --glow-accent: 0 0 8px rgba(91, 192, 235, 0.3);
  --radius: 12px;
  --font: "Georgia", serif;
}

/* ── Reset & Base ───────────────────────────────────────────────────────── */

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

html,
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

img, svg {
  display: block;
}

/* ── Utilities ──────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  transition: all 0.15s;
}

.btn:hover {
  background: var(--primary);
  color: var(--bg);
  box-shadow: var(--glow-primary);
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
}

.btn-primary:hover {
  box-shadow: var(--glow-primary);
  filter: brightness(1.1);
}

.btn-danger {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-danger:hover {
  background: var(--secondary);
  color: #fff;
  box-shadow: var(--glow-secondary);
}

.btn-ghost {
  border-color: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-list);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

/* ── Nav ────────────────────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 52px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
  text-shadow: var(--glow-primary);
  text-decoration: none;
}

.nav-spacer {
  flex: 1;
}

.nav-email {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Board Layout ───────────────────────────────────────────────────────── */

.board-container {
  display: flex;
  gap: 16px;
  padding: 24px;
  overflow-x: auto;
  min-height: calc(100vh - 52px);
  align-items: flex-start;
}

.list-column {
  flex-shrink: 0;
  width: 272px;
  background: var(--bg-list);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 100px);
}

.list-column.drag-over {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.list-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  font-weight: 700;
  color: var(--primary);
}

.list-header input {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-family: inherit;
  font-size: inherit;
  width: 100%;
  outline: none;
}

.list-header input:focus {
  border-bottom: 1px solid var(--primary);
}

.list-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

.list-add-btn {
  margin: 8px;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: left;
  font-size: 13px;
  transition: all 0.15s;
  width: calc(100% - 16px);
}

.list-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.card-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.card-item:hover {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-1px);
}

.card-item.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
}

.card-item-title {
  font-size: 14px;
  font-weight: 500;
}

.card-item-type {
  display: inline-block;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--border);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Modal ──────────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 540px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  outline: none;
  resize: none;
  line-height: 1.4;
  padding: 0;
}

.modal-title:focus {
  border-bottom: 1px solid var(--primary);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.modal-footer .spacer {
  flex: 1;
}

.type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.type-toggle button {
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  transition: all 0.15s;
}

.type-toggle button.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

/* ── Checklist ──────────────────────────────────────────────────────────── */

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

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

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checklist-item-text {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

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

.checklist-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
}

.checklist-item:hover .checklist-delete {
  opacity: 1;
}

.checklist-delete:hover {
  color: var(--secondary);
}

/* ── Add List ───────────────────────────────────────────────────────────── */

.add-list-column {
  flex-shrink: 0;
  width: 272px;
}

.add-list-trigger {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-align: left;
  font-size: 14px;
  transition: all 0.15s;
}

.add-list-trigger:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.add-list-form {
  background: var(--bg-list);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.add-list-form input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  margin-bottom: 8px;
}

.add-list-form input:focus {
  border-color: var(--primary);
}

.add-list-form .actions {
  display: flex;
  gap: 8px;
}

/* ── Login Page ─────────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-logo {
  font-size: 36px;
  font-weight: 900;
  color: var(--primary);
  text-shadow: var(--glow-primary);
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.login-tagline {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
}

/* ── Boards Dashboard ───────────────────────────────────────────────────── */

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  padding: 24px;
}

.board-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.board-card:hover {
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-2px);
  text-decoration: none;
}

.board-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* ── ThemeSelector ──────────────────────────────────────────────────────── */

.theme-select {
  padding: 4px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.theme-select:focus {
  border-color: var(--primary);
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ── Misc ───────────────────────────────────────────────────────────────── */

.page-content {
  padding: 24px;
}

.error-msg {
  color: var(--secondary);
  font-size: 13px;
  margin-top: 8px;
}

.success-msg {
  color: var(--accent);
  font-size: 13px;
  margin-top: 8px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
  padding: 24px 24px 0;
}

.llm-btn-tooltip {
  position: relative;
}

.llm-btn-tooltip::after {
  content: "Coming soon";
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-list);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.llm-btn-tooltip:hover::after {
  opacity: 1;
}

.list-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.list-header:hover .list-delete-btn {
  opacity: 1;
}

.list-delete-btn:hover {
  color: var(--secondary);
}

.add-card-form {
  padding: 0 8px 8px;
}

.add-card-form textarea {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  resize: none;
  margin-bottom: 8px;
  font-family: inherit;
  font-size: 14px;
}

.add-card-form .actions {
  display: flex;
  gap: 8px;
}
