/* ============================================================
   Packing mode — check-off UI
   Uses the shared design tokens from styles.css so it inherits
   light/dark theming automatically.
   ============================================================ */

/* --- progress header ---------------------------------------- */

.packing-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--card-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md, 8px);
}

.packing-progress__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
}

.packing-progress__bar {
  flex: 1;
  height: 8px;
  min-width: 60px;
  background: var(--surface-color);
  border-radius: var(--border-radius-full, 999px);
  overflow: hidden;
}

.packing-progress__fill {
  height: 100%;
  width: 0;
  background: var(--success-color, #10b981);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.packing-progress__reset {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm, 6px);
  cursor: pointer;
  white-space: nowrap;
}

.packing-progress__reset:hover {
  color: var(--text-color);
  background: var(--surface-color);
}

.packing-progress.is-complete .packing-progress__label {
  color: var(--success-color, #10b981);
}

/* --- per-item checkbox -------------------------------------- */

.packing-checkbox {
  display: inline-flex;
  align-items: center;
  /* Generous hit area: this gets tapped repeatedly, often one-handed. */
  padding: 0.5rem;
  margin: -0.5rem;
  cursor: pointer;
  flex-shrink: 0;
}

.packing-checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.packing-checkbox__box {
  display: inline-block;
  position: relative;
  width: 22px;
  height: 22px;
  background: var(--card-color);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm, 6px);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.packing-checkbox__box::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 7px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

.packing-checkbox__input:checked + .packing-checkbox__box {
  background: var(--success-color, #10b981);
  border-color: var(--success-color, #10b981);
}

.packing-checkbox__input:checked + .packing-checkbox__box::after {
  transform: rotate(45deg) scale(1);
}

/* Keyboard focus must stay visible even though the input itself is hidden. */
.packing-checkbox__input:focus-visible + .packing-checkbox__box {
  outline: 2px solid var(--accent-color, #059669);
  outline-offset: 2px;
}

/* --- packed row treatment ----------------------------------- */

.is-packed .item-name,
.is-packed .packing-item__name {
  color: var(--text-muted);
  text-decoration: line-through;
}

.is-packed {
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .packing-progress__fill,
  .packing-checkbox__box,
  .packing-checkbox__box::after {
    transition: none;
  }
}
