/* list.css — Improved List page */

.list-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}
.list-header h1 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.list-count {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  background: var(--faint);
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--muted);
  white-space: nowrap;
}

/* Filter card */
/* ── Compact filter bar (two rows) ── */
.list-filter-bar {
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.list-filter-row--bottom {
  flex-wrap: wrap;
}
.list-filter-spacer {
  flex: 1;
}
.list-cat-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden; /* chips are limited by JS to top 5 */
}
.list-cat-chips::-webkit-scrollbar { display: none; }

/* keep old names harmless */
.filter-card { display: none; }
.filter-label { font-size:10px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:0.08em; }

/* Search */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  color: var(--text);
  outline: none;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45,74,138,0.10);
}

/* Type toggle */

/* Category chips */

/* Rating seg */

/* Table card */
.table-card { padding: 0; overflow: hidden; }

/* Sortable table */
.list-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.list-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
.list-table th.sortable {
  cursor: pointer;
}
.list-table th.sortable:hover {
  background: var(--rule);
  color: var(--text);
}
.list-table th.sort-asc::after  { content: " ↑"; opacity: 0.8; }
.list-table th.sort-desc::after { content: " ↓"; opacity: 0.8; }

.list-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.list-table tbody tr {
  cursor: pointer;
  transition: background .08s ease;
}
.list-table tbody tr:hover td { background: var(--accent-bg); }
.list-table tbody tr:last-child td { border-bottom: none; }

/* Wishlist column */
.col-wl { width: 36px; text-align: center; padding: 0 8px !important; }

/* Type tag */
.type-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.type-tag-place {
  background: var(--faint);
  color: var(--muted);
  border-color: var(--rule);
}
.type-tag-product {
  background: var(--faint);
  color: var(--muted);
  border-color: var(--rule);
}

/* Rating badge in table */
.rating-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rating-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.rating-val { font-weight: 700; }
.rating-votes { font-size: 12px; color: var(--muted); }

/* Empty state */
.list-empty {
  text-align: center;
  padding: 48px 20px;
}
.list-empty-icon { font-size: 36px; margin-bottom: 10px; }
.list-empty h3 { margin: 0 0 6px; }

/* ══════════════════════════════
   MOBILE — list.css
══════════════════════════════ */
@media (max-width: 768px) {
  .list-header { flex-direction: column; align-items: flex-start; gap: 6px; margin: 10px 0 8px; }
  .list-header h1 { font-size: 20px; }
  .filter-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .filter-label { min-width: auto; }

  /* Top filter row: search full width first line, controls below */
  .list-filter-row--top {
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .search-wrap {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    order: -1; /* always first */
    flex-basis: 100%;
  }
  .type-toggle { flex-shrink: 0; }
  .list-filter-spacer { display: none; }
  .chain-toggle-wrap { margin-left: 0; }

  /* Bottom filter row: chips scroll horizontally */
  .list-filter-row--bottom {
    min-width: 0;
    overflow: hidden;
  }
  .list-cat-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-width: 0;
  }
  .list-cat-chips::-webkit-scrollbar { display: none; }

  /* Table: tighter, smaller font, hide non-essential columns */
  .col-type    { display: none; }
  .col-address { display: none; }
  .col-cat     { display: none; }

  .list-table th, .list-table td { padding: 7px 6px; }
  .list-table th { font-size: 9px; }
  .list-table td { font-size: 11px; }

  /* Give votes and rating fixed widths so they don't collapse */
  .col-votes  { width: 36px; text-align: center; }
  .col-rating { width: 54px; }
  .col-wl     { width: 28px; }

  .rating-dot  { width: 7px; height: 7px; }
  .rating-val  { font-size: 11px; }
}

/* ══════════════════════════════
   JOURNEY MODE — list.css
══════════════════════════════ */
.journey-inline-toggle { flex-shrink: 0; }

/* shared two-label toggle (same shape as map float, no shadow) */
.journey-float-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 5px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  gap: 0;
}
.journey-float-toggle:hover { border-color: var(--text); }
.journey-opt {
  padding: 3px 10px;
  border-radius: 99px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.journey-opt-active {
  background: var(--text);
  color: var(--page-bg);
}
.journey-divider {
  color: var(--rule);
  font-size: 10px;
  padding: 0 1px;
}

/* unvisited rows — soft grey, still readable */
tr.journey-unvisited-row td {
  opacity: 0.4;
  filter: grayscale(0.6);
}
tr.journey-unvisited-row:hover td {
  opacity: 0.7;
  filter: grayscale(0.2);
}

/* ── Chain toggle (checkbox style, matches map) ── */
.chain-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #888);
  white-space: nowrap;
  user-select: none;
}
.chain-toggle-wrap input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent, #2d4a8a);
  cursor: pointer;
}
.chain-toggle-label { cursor: pointer; }
