/**
 * board.css — Board area, list columns, loading overlay, empty states.
 * Also contains the drag-and-drop ghost/chosen/dragging class overrides.
 */

/* ── Board toolbar (search & filters) ────────────────────────── */

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-sm);
  padding: 6px var(--space-md);
  background-color: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  flex-wrap: wrap;
  z-index: 10;
}

.board-toolbar__search {
  flex: 0 0 210px;
  min-width: 160px;
}

.board-toolbar__input {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  border-radius: var(--radius-sm);
}

.board-toolbar__input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.board-toolbar__input:focus {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: white;
  color: white;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.board-toolbar__select {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: auto;
}

.board-toolbar__select option {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
}

.board-toolbar__select:focus {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: white;
  color: white;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* ── Board area ─────────────────────────────────────────────── */

.board-area {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--list-col-gap);
  padding: var(--space-md);
  overflow-x: auto;
  overflow-y: hidden;

  /* Dynamic board colour set via JS: el.style.setProperty('--board-color', color) */
  background-color: var(--board-color, var(--color-primary));
  background-image: linear-gradient(
    140deg,
    rgba(255 255 255 / 0.08) 0%,
    rgba(0 0 0 / 0.12) 100%
  );
}

/* ── List column ─────────────────────────────────────────────── */

.list-col {
  flex-shrink: 0;
  width: var(--list-col-width);
  max-height: calc(100vh - var(--navbar-height) - 48px - var(--space-md) * 2);
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-fast);
}

/* Drag states */
.list-col--ghost {
  opacity: 0.35;
  background-color: rgba(255 255 255 / 0.4) !important;
  box-shadow: none !important;
}

.list-col--dragging {
  box-shadow: var(--shadow-lg) !important;
  transform: rotate(1.5deg);
  opacity: 0.95;
}

/* ── List header ─────────────────────────────────────────────── */

.list-col__header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-xs) var(--space-xs) var(--space-sm);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.list-col__drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  font-size: 1.1rem;
  line-height: 1;
  background: none;
  border: none;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  flex-shrink: 0;
  user-select: none;
}

.list-col__drag-handle:active { cursor: grabbing; }

.list-col__drag-handle:hover { color: var(--color-text-secondary); }

.list-col__title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-text-primary);
  word-break: break-word;
  line-height: 1.3;
  margin: 0;
}

.list-col__count {
  flex-shrink: 0;
  background-color: var(--color-surface-hover);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

/* ── List dropdown menu ──────────────────────────────────────── */

.list-col__menu .btn-icon {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

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

.list-col__cards {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xs) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 32px;   /* keeps drop target visible even when empty */
}

/* ── Add card button ─────────────────────────────────────────── */

.list-col__add-card {
  flex-shrink: 0;
  width: 100%;
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-secondary);
  background: none;
  border: none;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.list-col__add-card:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text-primary);
}

.list-col__add-card:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: -2px;
}

/* ── "Add another list" button ───────────────────────────────── */

.list-col--add {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  height: 48px;
  max-height: 48px;
  background-color: rgba(255 255 255 / 0.18) !important;
  color: white !important;
  font-weight: 600;
  font-size: 0.875rem;
  border: 2px dashed rgba(255 255 255 / 0.4);
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
  align-self: flex-start; /* don't stretch to board height */
}

.list-col--add:hover {
  background-color: rgba(255 255 255 / 0.28) !important;
  border-color: rgba(255 255 255 / 0.6);
}

.list-col--add:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ── Loading overlay ─────────────────────────────────────────── */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-active) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-overlay__content {
  text-align: center;
  color: white;
}

.loading-overlay__logo {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-overlay__msg {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: var(--space-sm);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.95); }
}

/* ── Empty board state ───────────────────────────────────────── */

.empty-state {
  margin: auto;
  text-align: center;
  color: white;
  padding: var(--space-2xl);
  max-width: 400px;
}

.empty-state__icon {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: var(--space-md);
  display: block;
}

.empty-state__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.empty-state__desc {
  opacity: 0.8;
  margin-bottom: var(--space-lg);
  font-size: 0.9375rem;
}
