body {
  font-family: 'Manrope', sans-serif;
  background: #f5f5f5;
  color: #333;
  margin: 0;
}

/* ADMIN submit listing button icon (📝) */
#adminForm button {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
#adminForm button::before {
  content: '📝';
}

/* USER Welcome block match width */
.welcome {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

/* Section Titles */
.grid-section-title {
  font-size: 1.4rem;
  text-align: center;
  margin: 2rem auto 1rem auto;
  padding: 0.5rem 0;
  border-bottom: 2px solid #007bff;
  color: #007bff;
  max-width: 600px;
}

/* Category Section Titles */
.category-section-title {
  font-size: 1.3rem;
  text-align: center;
  margin: 2.5rem 0 1rem 0;
  color: #444;
}

/* Category Navigation Buttons */
.category-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem auto 1.5rem auto;
  max-width: 900px;
  padding: 0 1rem;
}
.category-nav button {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.category-nav button:hover {
  background: #0056b3;
}
#photoPreview .photo-thumb {
  position: relative;
  cursor: grab;
}
#photoPreview .photo-thumb img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}
/* Back to Top Button */
#backToTopBtn {
  position: fixed;
  bottom: 75px;
  right: 5px;
  z-index: 999;
  background: #333;
  color: white;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
#backToTopBtn:hover {
  background: #000;
}

#userSelect {
  appearance: none;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" class="bi bi-caret-down-fill" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658A.5.5 0 0 1 2.905 5h10.19a.5.5 0 0 1 .454.658l-4.796 5.482a.5.5 0 0 1-.76 0z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  width: 350px;
}

/* Section padding + separation */
.public-grid,
.claimed-grid {
  display: grid;
  align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1rem;
  background-color: #fdfdfd;
  border-top: 1px solid #ddd;
  overflow-x: hidden;
}


/* Mobile override: full width and center */
@media (max-width: 768px) {
  .public-grid,
  .claimed-grid {
    grid-template-columns: 100%;
    justify-content: center;
    max-width: 100%;
  }
}

.item-card a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.item-card p {
  word-break: break-word;
  overflow-wrap: anywhere;
}


/* User form fields side by side on larger screens */
.user-auth {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
  box-sizing: border-box;
}
.user-auth input {
  flex: 1 1 45%;
  padding: 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}
.user-auth button {
  flex: 1 1 100%;
  padding: 0.8rem;
  font-size: 1rem;
  font-weight: bold;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}
.user-auth button::before {
  content: '✅';
}
@media (max-width: 600px) {
  .user-auth input {
    flex: 1 1 100%;
  }
}

/* Item card styling */
.item-card {
  background: white;
  padding: 1rem;
  margin: 1rem auto;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-self: start;
  max-width: 320px;
}
.item-card h3 {
  margin: 0.3rem 0;
  font-size: 1.1rem;
}
.item-card p {
  margin: 0.2rem 0;
  font-size: 0.95rem;
}
.item-card p.description {
  text-align: left;
}

.item-card .price {
  font-weight: bold;
  margin: 0.3rem 0;
  color: #222;
}
.item-card img.feature {
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.item-card .thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}
.item-card .thumbs img {
  width: 50px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
}

/* Cleaned-up Claim button */
.item-card button.claim {
  background-color: #28a745;
  color: #fff;
  border: none;
  padding: 0.65rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease;
}
.item-card button.claim:hover {
  background-color: #1e7e34;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #007bff;
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 8px;
  display: none;
  z-index: 9999;
}
.toast.show {
  display: block;
}

/* Sticky Totals Bar */
#totalsBar, #adminTotalsBar {
  position: sticky;
  bottom: 0;
  background: #28a745;
  color: white;
  text-align: center;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
}
#totalsBar::before,
#adminTotalsBar::before {
  content: '💰 ';
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal.hidden {
  display: none;
}
.modal-content {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  max-width: 420px;
  width: 90vw;
  max-height: 90vh;  /* ← semicolon added here */
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overscroll-behavior: contain;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  z-index: 10001;
}
.modal-close:hover {
  color: #000;
}

.modal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.modal-content div {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.modal-content button {
  font-size: 1rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: #007bff;
  color: white;
  font-weight: bold;
  transition: background 0.3s ease;
}
.modal-content button:hover {
  background: #0056b3;
}


/* Admin action buttons */
button {
  padding: 0.5rem 1rem;
  margin: 0.3rem;
  font-size: 0.95rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}
button:hover {
  background-color: #0056b3;
}

.video-thumb {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.video-thumb video {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  color: white;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
  pointer-events: none;
}