/* ------------------------------------------------------------------
   1) Make search input and search button each full-width on its own line
   ------------------------------------------------------------------ */
#search-form {
  max-width: 600px;
  margin: 1rem auto;
  box-sizing: border-box;
}
#search-form input[type="text"] {
  display: block;
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}
#search-form button {
  display: block;
  width: 100%;
  padding: 0.5rem;
  background-color: #007BFF;
  color: #fff;
  border: 1px solid #007BFF;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  box-sizing: border-box;
}
#search-form button:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

/* ------------------------------------------------------------------
   2) Style for each “row-item” in search results / selected list
   ─ (You should already have these from your original CSS, but
     just double-check you didn’t accidentally delete them.)
   ------------------------------------------------------------------ */
.row-item {
  display: grid;
  grid-template-columns: 1.2rem 1fr 60px 24px;
  grid-template-rows: auto auto;
  column-gap: 1rem;
  row-gap: 0.25rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
  background: #fff;
  transition: background-color 0.3s;
}
.row-item:last-child {
  border-bottom: none;
}
.row-item .drag-handle {
  grid-column: 1;
  grid-row: 1 / span 2;
  cursor: grab;
  font-size: 1.2rem;
  color: #888;
  justify-self: center;
  align-self: center;
}
.row-item .drag-handle:hover {
  color: #555;
}
.row-item .title {
  grid-column: 2;
  grid-row: 1;
  font-weight: bold;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  word-break: break-word;
}
.row-item .details {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.9rem;
  color: #555;
  line-height: 1.2;
  word-break: break-word;
  cursor: pointer;
}
.row-item .quantity-input {
  width: 100%;
}
.row-item .sel-remove-btn {
  grid-column: 4;
  grid-row: 1 / span 2;
  background: none;
  border: none;
  color: #a00;
  font-size: 1.2rem;
  cursor: pointer;
  justify-self: center;
  align-self: center;
}
.row-item .sel-remove-btn:hover {
  color: #c00;
}
.index-num {
  grid-column: 1;
  grid-row: 1 / span 2;
  justify-self: center;
  align-self: center;
  font-weight: bold;
}
.sel-remove-btn {
  display: block;
}
.row-item.done {
  background: #C8E6C9 !important;
}

/* ------------------------------------------------------------------
   3) Section title styling
   ------------------------------------------------------------------ */
.section-title {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #333;
}

/* ------------------------------------------------------------------
   4) “Flow Summary” panel and warning text
   ------------------------------------------------------------------ */
#summary.task {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: 1rem auto;
  box-sizing: border-box;
  position: relative;
}
.list-summary {
  padding: 1.5rem;
}
.summary-warning {
  color: #c00;
  font-size: 0.97em;
  margin-top: 0.7em;
  display: block;
}

/* ------------------------------------------------------------------
   5) Collapsible “Utilities & Help” (copied from index)
   ------------------------------------------------------------------ */
.collapse-container {
  max-width: 600px;
  margin: 1rem auto;
}
.collapse-header {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.collapse-header h2 {
  margin: 0;
  font-size: 1rem;
  color: #333;
}
.collapse-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}
.collapse-content {
  background: white;
  border-top: 1px solid #eee;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-top: -1px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapse-content.open {
  max-height: 200px;
}
.collapse-content ul {
  list-style: none;
  padding: 0.5rem 1rem;
  margin: 0;
}
.collapse-content li {
  margin: 0.5rem 0;
}
.collapse-content a {
  color: #007BFF;
  text-decoration: none;
}
.collapse-content a:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------------
   6) Autocomplete dropdown (for #search-autocomplete) 
   ------------------------------------------------------------------ */
#search-autocomplete {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}
#autocomplete-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
#autocomplete-box > div {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}
#autocomplete-box > div:last-child {
  border-bottom: none;
}
#autocomplete-box > div:hover {
  background-color: #f0f0f0;
}



/* ------------------------------------------------------------------
   8) Timer controls, error/success glows, etc. 
   (you probably already have these, but just in case:)
   ------------------------------------------------------------------ */
.unit-row {
  display: flex;
  gap: 1rem;
}
.unit-row input {
  width: 100%;
}
.timer-controls {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
}
.timer-controls button {
  flex: 1;
}


.todo-extra-input {
  flex: 1;
  width: 100%;
}

.input-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.todo-label {
  font-size: 0.75rem;
  color: #555;
  margin-bottom: 0.25rem;
}

/* style for the small add buttons used in the flow builder */
.add-task-btn {
  width: 1.8rem;
  height: 1.8rem;
  min-width: 1.8rem;
  min-height: 1.8rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #007BFF;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.add-task-btn:hover {
  background: #0056b3;
}

.create-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}
.create-row:last-child {
  border-bottom: none;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}
.pagination button {
  padding: 0.25rem 0.6rem;
  border: 1px solid #ccc;
  background: #f8f8f8;
  cursor: pointer;
  border-radius: 4px;
}
.pagination button:hover {
  background: #eee;
}

/* styles for the list of saved flows */
#lists-container .row-item {
  position: relative;
  padding-right: 2rem;
}
#lists-container .section-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
#pending-container .section-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}
#lists-container .delete-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background: none;
  border: none;
  color: #a00;
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
  line-height: 1rem;
  padding: 0;
  cursor: pointer;
}
#lists-container .delete-btn:hover {
  color: #d00;
}
#lists-container .edit-link {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  font-size: 0.85rem;
}

.certainty-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  color: #fff;
  font-size: 0.75rem;
  margin-left: 0.3rem;
}
.row-item.done .title {
  text-decoration: underline;
}

.progress-saved {
  background: #fff8d4;
}

.pickup-btn {
  display: block;
  margin: 0.5rem 0 0;
  text-align: left;
}

.new-list-btn {
  display: block;
  margin: 1rem auto 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 1.1rem;
  max-width: 200px;
  background: #007BFF;
  color: #fff;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
}
.new-list-btn:hover {
  background: #0056b3;
}

/* In progress filter styled to match sort buttons */
#progress-filter-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}
#progress-filter-label input {
  width: 1.1rem;
  height: 1.1rem;
}

.pickup-inline {
  font-size: 0.85rem;
  margin-left: 0.5rem;
}
#show-more-btn {
  display: block;
  margin: 0.5rem auto;
}

#done-btn {
  display:none;
  padding:0.5rem 1rem;
  background:#4CAF50;
  color:#fff;
  border:none;
  border-radius:4px;
  cursor:pointer;
}

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  z-index: 9999;
  pointer-events:none;
  top: -10px;
  animation: confetti-fall 1.8s forwards;
}

@keyframes confetti-fall {
  to { transform: translateY(100vh) rotate(720deg); opacity:0; }
}
