/*
 * ara-pickers.css — shared styles for fieldtools-style picker buttons + overlays.
 *
 * Extracted from src/mobile/fieldtools.html inline styles so view-public-entry
 * (and other pages) can reuse the exact same pickers without duplicating CSS.
 *
 * Depends on CSS variables from src/shared/css/style.css or the page's own
 * theme block: --panel, --panel-2, --border, --text, --muted, --accent, --radius.
 */

/* Picker trigger button (category-pill) */
.category-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2, #111827);
  color: var(--text, #e5edf7);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.category-pill:hover {
  border-color: var(--accent, #10b981);
}

.category-current {
  font-size: 0.95rem;
  color: var(--text, #e5edf7);
}

.category-none {
  opacity: 0.6;
}

/* Overlay */
.category-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 11000;
}

.category-overlay.open,
.category-overlay.visible {
  display: flex;
}

.category-panel {
  box-sizing: border-box;
  background: var(--panel, #0f172a);
  border-radius: var(--radius, 14px);
  padding: 16px 16px 12px;
  width: min(520px, calc(100vw - 32px));
  max-height: 85vh;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.75);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  display: flex;
  flex-direction: column;
  margin: auto;
}

.category-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.category-panel-header h2 {
  font-size: 1.1rem;
  margin: 0;
  color: var(--text, #e5edf7);
}

.category-panel-intro {
  margin: 0 0 10px;
  font-size: 0.9rem;
  color: var(--muted, #9ca3af);
  flex-shrink: 0;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
}

.category-list::-webkit-scrollbar {
  display: none;
}

#speciesList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

#speciesList::-webkit-scrollbar {
  display: none;
}

#speciesSearchInput {
  width: 100%;
  padding: 12px 14px;
  border-radius: 0.75rem;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  background: var(--panel-2, #111827);
  color: var(--text, #e5edf7);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

#speciesSearchInput:focus {
  outline: none;
  border-color: var(--accent, #10b981);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

#speciesSearchInput::placeholder {
  color: var(--muted, #9ca3af);
}

.category-option,
.landform-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2, #111827);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  color: var(--text, #e5edf7);
  transition: background 0.15s, border-color 0.15s;
  transform: none !important;
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.category-option:hover,
.landform-option:hover {
  background: var(--panel, #0f172a);
  border-color: var(--accent, #10b981);
}

.category-option.selected {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--accent, #10b981);
}

.category-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.category-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text, #e5edf7);
}

.category-desc {
  font-size: 0.8rem;
  color: var(--muted, #9ca3af);
  margin-top: 2px;
}

.category-panel-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.category-panel-footer button {
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  color: var(--text, #e5edf7);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: background 0.15s, border-color 0.15s;
}

.btn-ghost:hover {
  background: var(--panel-2, #111827);
  border-color: var(--accent, #10b981);
}

@media (max-width: 480px) {
  .category-panel {
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius, 14px) var(--radius, 14px) 0 0;
    margin-top: auto;
  }

  .category-overlay.open,
  .category-overlay.visible {
    align-items: flex-end;
  }

  .category-option {
    padding: 12px 10px;
  }

  .category-desc {
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
 * Field Edit mode — GPS tracker accuracy chips + clinometer styles.
 * Ported from src/shared/fieldtools.html so view-public-entry's Field Edit
 * mode can host the fieldtools GPS tracker + clinometer inline.
 * ------------------------------------------------------------------------ */

/* Location accuracy chips */
.acc-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.acc-grey,
.acc-pill.acc-grey,
.acc-dot.acc-grey {
  background: #46505e;
  color: #e2e8f0;
}

.acc-amber,
.acc-pill.acc-amber,
.acc-dot.acc-amber {
  background: #ffb300;
  color: #2b1a00;
}

.acc-green,
.acc-pill.acc-green,
.acc-dot.acc-green {
  background: #1b5e2b;
  color: #e6fff2;
}

.acc-red,
.acc-pill.acc-red,
.acc-dot.acc-red {
  background: #7a2020;
  color: #ffdede;
}

.acc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Clinometer — embedded in Height card during Field Edit */
.clino-wrap {
  position: relative;
  height: 180px;
  border: 1px solid var(--border, #334155);
  border-radius: 12px;
  background: #0b1a2f;
  margin: 10px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clino-lock {
  width: 140px;
  height: 140px;
  border: 0;
  border-radius: 999px;
  background: #cfe0ff;
  color: #0b2250;
  font-weight: 900;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25) inset;
}

.clino-lock.active {
  background: #2b66d6;
  color: #e8f0ff;
  border: 2px solid #1b4ca3;
}

.clino-lock:active {
  transform: scale(.98);
}

.clino-readout {
  background: var(--panel-2, #111827);
  color: var(--text, #e5e7eb);
  border: 1px solid var(--border, #334155);
  border-radius: 0.75rem;
  padding: 12px 14px;
  margin: 10px 0 12px;
}

.clino-readout .angle {
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--accent-2, #60a5fa);
}

.clino-readout .status {
  color: var(--muted, #94a3b8);
  font-size: 0.92rem;
  margin-top: 4px;
}

/* Small tag badge used by GPS "best fix" panel */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2, #111827);
  color: var(--muted, #94a3b8);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border, #334155);
}

/* Body class toggled while Field Edit is active — lets pages hide the
 * legacy manual-coord section and surface field-only controls. */
body.ara-edit-mode-field #editLocationManualSection {
  display: none !important;
}

/* --------------------------------------------------------------------------
 * Inline Admin Edit Mode — hide the read-only public cards so the admin
 * only sees the editable cards (General, Location, Measurements, Terrain).
 * The measurementsCard stays visible because its significanceText block is
 * replaced by the significance textarea during edit mode. The adminSection
 * stays visible so the admin can still flip status / upload photos.
 * ------------------------------------------------------------------------ */
body.ara-edit-mode #categoriesCard,
body.ara-edit-mode #speciesCard,
body.ara-edit-mode #historyCard,
body.ara-edit-mode #publicMeasurementsCard,
body.ara-edit-mode #speciesComparisonCard,
body.ara-edit-mode #validationFlagsBanner,
body.ara-edit-mode #publicLocationCard,
body.ara-edit-mode #publicAdvancedToggleWrap,
body.ara-edit-mode #advancedDataSection,
body.ara-edit-mode #publicMetadataWrap,
body.ara-edit-mode #communityPhotosSection,
body.ara-edit-mode #submitPhotosSection,
body.ara-edit-mode #personalSection,
body.ara-edit-mode #topActionBar {
  display: none !important;
}
