/* =========================================================
   Lists & Wishes
   ========================================================= */

.lists-main {
  padding: 24px 20px 96px;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.lists-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.list-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: rise 0.4s ease-out both;
  position: relative;
}
.list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.list-card.archived {
  opacity: 0.6;
  border-style: dashed;
}

.list-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.list-card-meta {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 500;
}
.list-card-progress {
  margin-top: 10px;
  height: 4px;
  background: var(--bg);
  border-radius: 2px;
  overflow: hidden;
}
.list-card-progress-bar {
  height: 100%;
  background: var(--emerald);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Detail view */
.list-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.back-btn {
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: var(--ink);
  flex-shrink: 0;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); }

.list-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 1;
}
.list-detail-actions {
  display: flex;
  gap: 8px;
}
.list-owner-info {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 20px;
  padding-left: 52px;
}

.add-item-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.add-item-wrap input {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  transition: all 0.15s ease;
}
.add-item-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.items-list {
  list-style: none;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  margin-bottom: 6px;
  transition: all 0.15s ease;
  animation: rise 0.3s ease-out both;
}
.item-row:hover { box-shadow: var(--shadow-sm); }
.item-row.checked {
  opacity: 0.5;
}
.item-row.checked .item-text {
  text-decoration: line-through;
}

.item-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s ease;
  flex-shrink: 0;
  color: transparent;
}
.item-checkbox:hover { border-color: var(--primary); }
.item-checkbox.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.item-text {
  flex: 1;
  font-size: 15px;
  color: var(--ink);
}
.item-added-by {
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.item-delete {
  font-size: 16px;
  color: var(--ink-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s ease;
}
.item-row:hover .item-delete { opacity: 1; }
.item-delete:hover { color: var(--rose); }

/* Tag grid for visibility */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.tag-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--rule);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  font-family: var(--font-body);
  color: var(--ink-soft);
}
.tag-opt:hover { border-color: var(--primary); }
.tag-opt.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.form-error {
  color: var(--rose);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

@media (max-width: 720px) {
  .lists-main { padding: 16px 12px 64px; }
  .lists-grid { grid-template-columns: 1fr; }
  .list-detail-header { gap: 8px; }
  .list-title { font-size: 20px; }
  .list-owner-info { padding-left: 0; }
}
