/* Fill a grid square that has a picture. Relies on the existing
   .mgrs-cell class on each grid polygon (set by main.js). */
.leaflet-interactive.mgrs-cell.has-picture {
  fill: #1e88e5;
  fill-opacity: 0.4;
}

/* Floating "Add picture" button, centered at the bottom of the map. */
.picture-add-btn {
  position: absolute;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #1e88e5;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: 500 15px/1 system-ui, sans-serif;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.picture-add-btn:disabled {
  background: #9ec5ec;
  cursor: not-allowed;
}

/* Hint above the locate button. */
.picture-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font: 13px/1.3 system-ui, sans-serif;
  pointer-events: none;
}

/* Picture view popup. */
.picture-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.picture-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: system-ui, sans-serif;
}

.picture-modal img {
  max-width: min(600px, 90vw);
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.picture-modal .picture-meta {
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #333;
}

.picture-modal .picture-meta-top {
  padding-top: 12px;
  padding-bottom: 8px;
}

.picture-modal .picture-meta-bottom {
  padding-top: 8px;
  padding-bottom: 12px;
  border-top: 1px solid #eee;
}

.picture-modal .picture-meta .picture-number {
  font-weight: 600;
}

.picture-modal .picture-meta .picture-time {
  color: #666;
  font-size: 13px;
}

.picture-modal .picture-like-area {
  display: inline-flex;
  align-items: center;
}

.picture-modal .picture-like,
.picture-modal .picture-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font: 600 13px/1.2 system-ui, sans-serif;
  color: #333;
  background: rgba(0, 0, 0, 0.06);
  border: 0;
}

.picture-modal .picture-like-btn {
  cursor: pointer;
}

.picture-modal .picture-like-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.12);
}

.picture-modal .picture-like-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.picture-modal .picture-like-btn.is-liked {
  color: #e53935;
}

.picture-modal .picture-actions .picture-time {
  margin-right: 4px;
}

.picture-modal .picture-meta .picture-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.picture-modal button {
  appearance: none;
  background: #eee;
  border: 0;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  color: #333;
}

.picture-modal button.picture-delete {
  background: #c62828;
  color: #fff;
}

.picture-modal .picture-empty {
  padding: 32px 24px;
  text-align: center;
  color: #666;
}

.picture-modal .picture-username-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  color: #1e88e5;
  cursor: pointer;
  text-decoration: underline;
}

.picture-modal .picture-username-btn:hover {
  color: #1565c0;
}

.picture-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 4px;
  z-index: 9001;
  font-family: system-ui, sans-serif;
  font-size: 14px;
}
