/* === TASKFLOW — CSS === */
:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273548;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --todo: #f59e0b;
  --progress: #3b82f6;
  --review: #a855f7;
  --done: #22c55e;
  --danger: #ef4444;
  --font: 'Inter', -apple-system, sans-serif;
  --radius: 12px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: auto;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.header-left h1 {
  font-size: 26px;
  font-weight: 800;
}

.header-left h1 span {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 20px;
}

#clear-btn {
  font-family: var(--font);
  font-size: 13px;
  padding: 6px 14px;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

#clear-btn:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

/* Board */
#board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* Columns */
.column {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.column-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.todo-dot { background: var(--todo); }
.progress-dot { background: var(--progress); }
.review-dot { background: var(--review); }
.done-dot { background: var(--done); }

.column-header h2 {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.column-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Card list */
.card-list {
  flex: 1;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.2s;
  border-radius: 8px;
  padding: 4px;
}

.card-list.drag-over {
  background: rgba(99, 102, 241, 0.08);
  outline: 2px dashed rgba(99, 102, 241, 0.3);
  outline-offset: -2px;
}

/* Cards */
.card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 14px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  border-left: 3px solid transparent;
  position: relative;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.card.color-blue { border-left-color: #3b82f6; }
.card.color-green { border-left-color: #22c55e; }
.card.color-purple { border-left-color: #a855f7; }
.card.color-orange { border-left-color: #f97316; }
.card.color-pink { border-left-color: #ec4899; }
.card.color-none { border-left-color: var(--border); }

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
}

.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-priority {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
}

.priority-low { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.priority-medium { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.priority-high { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.card-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.card:hover .card-actions { opacity: 1; }

.card-action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.1s;
}

.card-action-btn:hover { background: rgba(255, 255, 255, 0.1); }

/* Add card button */
.add-card-btn {
  font-family: var(--font);
  font-size: 13px;
  padding: 10px;
  background: none;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.15s;
}

.add-card-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface-2);
}

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 90%;
  max-width: 420px;
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  margin-bottom: 12px;
  resize: vertical;
}

.modal-content input:focus,
.modal-content textarea:focus { border-color: var(--accent); }

.modal-content input::placeholder,
.modal-content textarea::placeholder { color: var(--text-muted); }

.modal-row {
  margin-bottom: 14px;
}

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

.priority-picker, .color-picker {
  display: flex;
  gap: 6px;
}

.priority-btn {
  font-family: var(--font);
  font-size: 12px;
  padding: 6px 14px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s;
}

.priority-btn.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
}

.color-btn.selected { border-color: white; transform: scale(1.15); }
.color-btn:hover { transform: scale(1.1); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary, .btn-secondary {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }

/* Footer */
footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
}

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

/* Responsive */
@media (max-width: 900px) {
  #board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 550px) {
  #board { grid-template-columns: 1fr; }
  .column { min-height: 200px; }
}
