/* The Trips page (views/trips.erb, public/js/trips.js). Builds on the
   Places page's layout and components in places.css. */

/* "Plan a new trip" is a link in the add tile's place. */
.trips-page a.pl-add-tile { text-decoration: none; }

/* ---------- Add a shared trip ---------- */

.tr-shared {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 0.85rem;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: var(--text-sm);
  font-weight: 600;
}
.tr-shared[hidden] { display: none; }
.tr-shared__row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.trips-page .tr-shared input {
  flex: 1 1 280px;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-md);
}
.tr-shared__status { margin: 0; color: var(--route); font-weight: 400; }
.tr-shared__status.is-error { color: var(--danger); }
.tr-shared__status[hidden] { display: none; }

/* ---------- Cards ---------- */

.tr-card__cover {
  position: relative;
  height: 160px;
  background: var(--parchment-dark);
}
.tr-card__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Distance and drive time, where a place card shows coordinates. */
.tr-card__totals {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  background: var(--label-bg);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: 600;
}
.tr-card__totals span { display: inline-flex; align-items: center; gap: 4px; }
.tr-card__totals svg { width: 13px; height: 13px; }
.tr-card__cover .pl-star {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--label-bg);
}
.tr-card__cover .pl-star:hover { background: var(--surface); }

.tr-tag--folder { background: var(--route-soft); color: var(--route-dark); font-weight: 600; }

/* Completed trips: a green check tag, and the card/table toggle lit up. */
.tr-tag--done {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--route);
  color: #fff;
  font-weight: 600;
}
.tr-tag--done svg { width: 11px; height: 11px; }
.pl-table__name .tr-tag--done { margin-left: var(--space-2); vertical-align: middle; }
.pl-mini__text .tr-tag--done { align-self: flex-start; color: #fff; }
.tr-done[aria-pressed="true"] { color: var(--route); }
:root[data-theme="dark"] .tr-tag--folder { color: var(--ink); }

/* State flags along the trip, in stop order. */
.tr-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.tr-flags__more { color: var(--muted); font-size: var(--text-xs); }

/* ---------- Table and board ---------- */

.tr-table__thumb {
  width: 56px;
  height: 36px;
  margin-right: var(--space-3);
  border-radius: 6px;
  object-fit: cover;
  vertical-align: middle;
  background: var(--parchment-dark);
}
.tr-table__actions { white-space: nowrap; padding: 0.2rem 0.4rem; }
.tr-table__actions .pl-icon { width: 34px; height: 34px; }

.tr-board__dot { background: var(--route); }
.tr-mini__thumb {
  flex: none;
  width: 52px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--parchment-dark);
}
.tr-board__empty {
  margin: 0;
  padding: 0.25rem;
  color: var(--muted);
  font-size: var(--text-sm);
}

/* ---------- Edit sheet ---------- */

.tr-sheet__thumb {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--parchment-dark);
}
.tr-new-folder { margin-top: var(--space-2); }
.tr-new-folder[hidden] { display: none; }
.trips-page .tr-new-folder input { width: 100%; box-sizing: border-box; }
.tr-sheet__totals { margin: 0; color: var(--muted-strong); font-weight: 400; }
.tr-sheet__stops {
  margin: 0;
  padding-left: 1.4rem;
  max-height: 180px;
  overflow-y: auto;
  color: var(--muted-strong);
  font-size: var(--text-sm);
  font-weight: 400;
  line-height: 1.5;
}
.tr-share { display: flex; gap: var(--space-2); }
.trips-page .tr-share input {
  flex: 1;
  min-width: 0;
  color: var(--muted-strong);
  font-size: var(--text-sm);
}
