/* Dark mode foundation */
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1e1e1e;
  color: #e0e0e0;
}

/* Login view */
#login-view {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-card {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 2rem;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.login-title {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 1.5rem 0;
  font-weight: 600;
}

#login-form {
  display: flex;
  flex-direction: column;
}

#username {
  width: 100%;
  background: #252525;
  border: 1px solid #3a3a3a;
  color: white;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

#password {
  width: 100%;
  background: #252525;
  border: 1px solid #3a3a3a;
  color: white;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

#password:focus {
  outline: none;
  border-color: #d4943a;
}

#login-form button {
  width: 100%;
  background: #d4943a;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 500;
}

#login-form button:hover {
  background: #c4842e;
}

#login-error {
  color: #e74c3c;
  font-size: 0.875rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* Board view */
.board-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #2a2a2a;
  border-bottom: 1px solid #3a3a3a;
}

.board-title {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

#clear-done-btn {
  background: transparent;
  color: #999;
  border: 1px solid #444;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

#clear-done-btn:hover {
  color: #d4a574;
  border-color: #d4a574;
}

#logout-btn {
  background: transparent;
  color: #999;
  border: 1px solid #444;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

#logout-btn:hover {
  color: white;
  border-color: #666;
}

/* Board grid layout */
#board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: #333;
  min-height: calc(100vh - 52px);
  overflow-x: auto;
}

/* Column styling */
.column {
  background: #1e1e1e;
  display: flex;
  flex-direction: column;
}

.column-header {
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a8a8a;
  background: #2a2a2a;
  text-align: center;
  border-bottom: 1px solid #3a3a3a;
}

/* Current day column highlight */
.column-today .column-header {
  color: #d4943a;
}

.column-tasks {
  flex: 1;
  padding: 0.5rem;
}

.column-empty {
  color: #555;
  font-style: italic;
  font-size: 0.8rem;
  padding: 0.75rem;
  text-align: center;
}

/* Task styling */
.task {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  margin-bottom: 0.375rem;
  color: #e0e0e0;
  line-height: 1.4;
}

/* Task done state - only affects text, not toggle button */
.task-done .task-text {
  text-decoration: line-through;
  opacity: 0.45;
  color: #888;
}

/* Toggle button for done/undone */
.toggle-done {
  display: inline-block;
  width: 1.2em;
  text-align: center;
  cursor: pointer;
  color: #666;
  margin-right: 0.25rem;
  user-select: none;
}

.toggle-done:hover {
  color: #999;
}

/* Task text span - clickable to edit */
.task-text {
  cursor: pointer;
}

/* Edit mode input */
.task-edit-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid #d4943a;
  color: #e0e0e0;
  font: inherit;
  width: calc(100% - 1.5em);
  padding: 0;
  outline: none;
}

/* Task editing state - highlight parent */
.task-editing {
  background: rgba(212, 148, 58, 0.1);
}

/* Add task area at bottom of columns */
.add-task-area {
  padding: 0.5rem 0.75rem;
  color: #444;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s ease;
  user-select: none;
}

.add-task-area:hover {
  color: #666;
  background: rgba(255, 255, 255, 0.03);
}

.task-priority {
  /* Base class for any priority - specific levels handle styling */
}

.task-priority-1 {
  border-left: 3px solid #f0ad4e;
  padding-left: calc(0.75rem - 3px);
}

.task-priority-2 {
  border-left: 3px solid #e67e22;
  background: rgba(230, 126, 34, 0.08);
  padding-left: calc(0.75rem - 3px);
}

.task-priority-3 {
  border-left: 3px solid #e74c3c;
  background: rgba(231, 76, 60, 0.12);
  font-weight: 500;
  padding-left: calc(0.75rem - 3px);
}

/* Task selection state */
.task-selected {
  outline: 1px solid #d4943a;
  outline-offset: -1px;
  background: rgba(212, 148, 58, 0.12);
}

/* Drag-and-drop styles */
.task[draggable="true"] {
  cursor: grab;
}

.task-dragging {
  opacity: 0.4;
}

.drop-indicator {
  height: 2px;
  background: #d4943a;
  margin: 0;
  pointer-events: none;
  transition: none;
}

.column-tasks.drag-over {
  background: rgba(212, 148, 58, 0.05);
}

/* Undo toast */
.undo-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #e0e0e0;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  transition: transform 0.2s ease;
}

.undo-toast.show {
  transform: translateX(-50%) translateY(0);
}

.undo-toast .undo-btn {
  color: #d4943a;
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}

.undo-toast .undo-btn:hover {
  color: #e0a84e;
}

/* Blinking/pulsing task (contains * in text) */
@keyframes task-pulse {
  0%, 100% { background: #2a2a2a; }
  50% { background: #5a4428; }
}

.task-blink {
  animation: task-pulse 2s ease-in-out infinite;
}

.task-blink.task-priority-2 {
  animation-name: task-pulse-p2;
}

@keyframes task-pulse-p2 {
  0%, 100% { background: rgba(230, 126, 34, 0.08); }
  50% { background: rgba(230, 126, 34, 0.35); }
}

.task-blink.task-priority-3 {
  animation-name: task-pulse-p3;
}

@keyframes task-pulse-p3 {
  0%, 100% { background: rgba(231, 76, 60, 0.12); }
  50% { background: rgba(231, 76, 60, 0.40); }
}

/* Responsive: stack columns on mobile */
@media (max-width: 768px) {
  #board {
    grid-template-columns: 1fr;
  }
}
