/* Baby Registry Checklist */

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ---- Overall Progress Bar ---- */
.progress-bar-wrap {
  height: 8px;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar-fill {
  height: 100%;
  background: #38a169;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ---- Filter Row ---- */
.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  background: var(--color-bg-secondary);
}

.filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ---- Category Sections ---- */
.registry-category {
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}

.category-header:hover {
  background: var(--color-bg-secondary);
}

.collapse-icon {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.registry-category.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.cat-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.cat-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.cat-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-bg-secondary);
  border-radius: 2px;
  max-width: 120px;
  overflow: hidden;
}

.cat-progress-fill {
  height: 100%;
  background: #38a169;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.category-body {
  border-top: 1px solid var(--color-border-light);
}

.registry-category.collapsed .category-body {
  display: none;
}

/* ---- Checklist Items ---- */
.registry-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.registry-item:last-child {
  border-bottom: none;
}

.registry-item.purchased .item-name {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

/* Custom checkbox */
.checkbox-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-wrap input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface);
  transition: all var(--transition-fast);
  font-size: 0;
  color: #fff;
}

.checkbox-wrap input:checked + .checkmark {
  background: #38a169;
  border-color: #38a169;
  font-size: 12px;
}

.item-name {
  font-size: 0.9rem;
  color: var(--color-text);
  flex-shrink: 0;
}

.item-notes {
  flex: 1;
  min-width: 0;
  border: none;
  border-bottom: 1px dashed var(--color-border-light);
  background: transparent;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  padding: 4px 6px;
  font-family: inherit;
}

.item-notes::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.item-notes:focus {
  border-bottom-color: var(--color-primary);
  outline: none;
}

.item-delete {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.5;
  transition: all var(--transition-fast);
}

.item-delete:hover {
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.08);
  opacity: 1;
}

/* ---- Add Item Row ---- */
.add-item-row {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  align-items: center;
}

.new-item-input {
  flex: 1;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}

.new-item-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.btn-add-item {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.btn-add-item:hover {
  background: var(--color-bg-secondary);
}

/* ---- Add Category Row ---- */
.add-category-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  align-items: center;
}

.add-category-row input {
  flex: 1;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}

.add-category-row input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ---- Action Buttons ---- */
.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-bg-secondary);
}

.btn-danger {
  background: var(--color-surface);
  color: #e53e3e;
  border-color: #e53e3e;
}

.btn-danger:hover {
  background: #e53e3e;
  color: #fff;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .registry-item {
    flex-wrap: wrap;
  }
  .item-notes {
    flex-basis: 100%;
    margin-left: 32px;
    margin-top: 2px;
  }
  .cat-progress-bar {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 12px;
  }
  .stat-value {
    font-size: 1rem;
  }
  .filter-row {
    flex-wrap: wrap;
  }
}

/* ---- Print ---- */
@media print {
  .action-buttons,
  .add-item-row,
  .add-category-row,
  .filter-row,
  .item-delete {
    display: none !important;
  }
  .registry-category {
    break-inside: avoid;
  }
  .registry-category.collapsed .category-body {
    display: block !important;
  }
}
