html {
  -webkit-text-size-adjust: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.header h1 {
  margin: 0;
  font-size: 26px;
}

.user-info {
  margin-bottom: 12px;
  color: #666;
  font-size: 14px;
}

.user-info div {
  margin-bottom: 2px;
}

.top-section {
  background: white;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.logout-btn {
  background: transparent;
  border: none;
  color: #555;
  cursor: pointer;
  font-size: 14px;
}

.logout-btn:hover {
  text-decoration: underline;
}

body {
  font-family: Trebuchet MS, Calibri;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  background: #f7f7f7;
  color: #222;
}

h1,
h2 {
  margin-bottom: 16px;
}

h3 {
  margin-top: 10px;
  margin-bottom: 8px;
  font-size: 16px;
  color: #666;
}

/* Inputs */

input,
select,
textarea,
button {
  font-size: 16px;
}

input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

li input {
  flex: 1;
  margin-bottom: 0;
}

/* Buttons */

button {
  padding: 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

#signedOutView button,
#signedInView button,
#clearButton {
  margin-top: 8px;
}

/* List items */

li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

li span {
  flex: 1;
  font-size: 17px;
  word-break: break-word;
}

.bought-item {
  opacity: 0.6;
}

li div {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Item action buttons */

li div button {
  font-size: 18px;
  padding: 8px;
  min-width: 40px;
  border-radius: 10px;
  background: #f1f3f5;
}

/* Button colors */

li div button:nth-child(1) {
  color: #2e7d32;
}

li div button:nth-child(2) {
  color: #3949ab;
}

li div button:nth-child(3) {
  color: #d32f2f;
}

li div button:hover {
  background: #e9ecef;
}

/* Sections */

.add-row,
.list-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.add-row input,
.list-row input {
  margin-bottom: 0;
  flex: 1;
}

.add-row button,
.list-row button {
  width: auto;
  white-space: nowrap;
}

#itemCount {
  margin: 8px 0 14px 0;
  color: #666;
}

hr {
  margin: 20px 0;
  border: none;
  border-top: 1px solid #ddd;
}

/* Editing */

.editing-row {
  background: #f8f9fa;
}

/* List pills */

.list-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.list-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: #e9ecef;
  cursor: pointer;
  white-space: nowrap;
  font-size: 16px;
}

.list-pill.active {
  background: #333;
  color: white;
}

.list-pill:hover {
  background: #ced4da;
}

.add-pill {
  font-weight: bold;
  min-width: 40px;
}

/* Categories */

.category-section {
  margin-bottom: 18px;
}

.category-heading {
  margin: 16px 0 8px 0;
  font-size: 16px;
  color: #555;
}

/* Bought section */

.bought-subheading {
  margin: 10px 0 8px 0;
  font-size: 16px;
  color: #777;
}

.bought-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.bought-toggle:hover {
  text-decoration: underline;
}

/* Editing styles */

.edit-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.edit-fields input,
.edit-fields select {
  margin-bottom: 0;
}

/* Mobile */

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  /* ===== LIST ITEMS ===== */
  li {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  li span {
    font-size: 16px;
    min-width: 0;
  }

  li div {
    width: auto;
    gap: 4px;
    flex-shrink: 0;
  }

  li div button {
    flex: 0 0 auto;
    width: auto;
    min-width: 34px;
    padding: 6px;
    font-size: 16px;
    margin-bottom: 0;
  }

  /* ===== ADD / LIST ROW ===== */
  .add-row,
  .list-row {
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
  }

  .add-row input,
  .list-row input {
    flex: 1;
    min-width: 0;
    padding: 12px;
  }

  .add-row select,
  .list-row select {
    min-width: 90px;
    padding: 12px 8px;
    flex-shrink: 0;
  }

  .add-row button,
  .list-row button {
    width: auto;
    padding: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-bottom: 0;
  }
}

/*Animations below*/

/* smooth transitions */
button,
.list-pill,
li {
  transition: all 0.15s ease;
}

/* button tap feedback */
button:active {
  transform: scale(0.95);
}

/* item appear animation */
/*li {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}*/

/*End of Animations*/

/* How to render emppty lists or categories */

.empty-state {
  text-align: center;
  color: #777;
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  line-height: 1.6;
}

.done-state {
  font-size: 14px;
  color: #777;
  margin-bottom: 10px;
}
