/* Garage Sale Map — mobile-first styles. */

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
}

.gs-marker {
  background: none;
  border: none;
}

/* Import page */

.import-page {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.import-page h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.import-page input[type="file"] {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-bottom: 1rem;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: #fff;
}

/* Buttons */

.btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

/* Banners */

.banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.banner-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.banner-warn {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.banner-summary {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 1000;
  max-width: 40rem;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

.banner-dismiss {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #065f46;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.banner-dismiss:hover {
  background: rgba(6, 95, 70, 0.12);
}

.banner-summary p {
  margin: 0 0 0.25rem;
}

.banner-summary ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
  max-height: 10rem;
  overflow-y: auto;
}

.import-link {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1000;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
}

/* Location dialog (bottom sheet on phones, centered on desktop) */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* The `hidden` attribute must win over `display: flex`, otherwise the
   dialog is always visible and cannot be dismissed. */
.dialog-backdrop[hidden] {
  display: none;
}

.dialog {
  width: 100%;
  max-width: 34rem;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  background: #fff;
  border-radius: 12px 12px 0 0;
  padding: 1rem;
}

.dialog h2 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  word-break: break-word;
}

.dlg-label {
  color: #4b5563;
  margin: 0 0 0.75rem;
  min-height: 0;
}

.status-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.status-buttons button {
  min-height: 44px;
  font-size: 0.95rem;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.status-buttons button.selected {
  border-color: #2563eb;
  background: #eff6ff;
  font-weight: 600;
}

.dialog label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

#dlg-note {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #9ca3af;
  border-radius: 8px;
}

.char-count {
  text-align: right;
  color: #6b7280;
  font-size: 0.8rem;
  margin: 0.25rem 0 0.75rem;
}

.dialog-actions {
  display: flex;
  gap: 0.5rem;
}

.dialog-actions .btn {
  flex: 1;
}

.dlg-message {
  min-height: 1.2em;
  color: #065f46;
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

@media (min-width: 768px) {
  .dialog-backdrop {
    align-items: center;
  }

  .dialog {
    border-radius: 12px;
  }
}
