/* Add a place: step 1 (placing the pin) */
#add-info.add-step {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1010; /* above Leaflet controls, below navbars and modals */
  width: min(360px, calc(100% - 32px));
  margin: 0;
  padding: 16px 18px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  text-align: left;
}

.add-step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #138496;
}

.add-step-title {
  font-size: 18px;
  font-weight: 500;
  margin: 2px 0 6px;
}

.add-step-title svg,
.add-step-title i {
  color: #28a745;
  margin-right: 4px;
}

.add-step p {
  font-size: 14px;
  color: #495057;
  margin: 0 0 14px;
}

.add-step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 575px) {
  #add-info.add-step {
    top: auto;
    bottom: 76px;
  }
}

body.adding-place #map {
  cursor: crosshair;
}

/* Add a place: step 2 (details form) */
.add-modal {
  border: 0;
  border-radius: 14px;
  overflow: hidden;
}

.add-modal .modal-header {
  align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eef0f2;
}

.add-modal .modal-title {
  font-size: 20px;
  font-weight: 500;
  margin-top: 2px;
}

.add-modal .modal-body {
  padding: 18px 20px 6px;
}

.add-modal .modal-footer {
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #eef0f2;
  background: #fafbfc;
}

.add-field {
  margin-bottom: 18px;
}

.add-field > label,
.add-field > .field_with_errors > label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 6px;
}

.add-required {
  font-size: 11px;
  font-weight: 400;
  color: #868e96;
  margin-left: 4px;
}

.add-modal .form-control {
  border-radius: 8px;
}

.add-hint {
  font-size: 12px;
  color: #6c757d;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.add-hint svg,
.add-hint i {
  color: #adb5bd;
  margin-right: 2px;
}

.add-hint-warn {
  background: #fff8e1;
  border-color: #ffe08a;
  color: #7a5b00;
}

.add-hint-warn svg,
.add-hint-warn i {
  color: #e0a800;
}

.add-error {
  display: none;
  font-size: 13px;
  color: #dc3545;
  margin-top: 4px;
}

.place-name-input.is-invalid {
  border-color: #dc3545;
}

.place-name-input.is-invalid ~ .add-error {
  display: block;
}

/* Photo drop zone */
.add-photo {
  position: relative;
  border: 2px dashed #ced4da;
  border-radius: 10px;
  background: #f8f9fa;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.add-photo:hover,
.add-photo.is-dragging {
  border-color: #17a2b8;
  background: #eef9fb;
}

.add-photo input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.add-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 12px;
  font-size: 14px;
  color: #6c757d;
  text-align: center;
}

.add-photo-empty svg,
.add-photo-empty i {
  font-size: 24px;
  color: #17a2b8;
}

.add-photo-preview {
  display: none;
  position: relative;
}

.add-photo.has-photo {
  border-style: solid;
  border-color: #dee2e6;
  background: #fff;
}

.add-photo.has-photo .add-photo-empty {
  display: none;
}

.add-photo.has-photo .add-photo-preview {
  display: block;
}

.add-photo-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

.add-photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
}

.add-photo-remove:hover {
  background: #dc3545;
}

/* Map choice pills */
.add-maps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.add-map-option {
  padding: 5px 14px;
  border: 1px solid #ced4da;
  border-radius: 999px;
  font-size: 14px;
  color: #495057;
  background: #fff;
  cursor: pointer;
  user-select: none;
}

.add-map-option:hover {
  border-color: #17a2b8;
}

.btn-check:checked + .add-map-option {
  background: #17a2b8;
  border-color: #17a2b8;
  color: #fff;
}

.btn-check:focus-visible + .add-map-option {
  outline: 2px solid #17a2b8;
  outline-offset: 2px;
}

.add-signup-note {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #eef9fb;
  font-size: 13px;
  color: #0c5460;
}

.add-signup-note svg,
.add-signup-note i {
  font-size: 18px;
  color: #17a2b8;
  flex: 0 0 auto;
}

/* Save button states */
#save-button .add-save-busy {
  display: none;
}

#save-button.is-saving .add-save-label {
  display: none;
}

#save-button.is-saving .add-save-busy {
  display: inline;
}

.add-photo-remove {
  display: none;
}

.add-photo.is-new .add-photo-remove {
  display: block;
}

.add-photo-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
}

.add-photo.is-new .add-photo-badge {
  display: none;
}

/* Edit place page */
.place-form-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 8px 0 110px;
}

.place-form-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.place-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid #eef0f2;
}

.place-form-header h1 {
  font-size: 22px;
  font-weight: 500;
  margin: 2px 0 0;
}

.place-form-header a {
  flex: 0 0 auto;
  font-size: 14px;
  color: #138496;
  text-decoration: none;
  margin-top: 4px;
}

.place-form-body {
  padding: 20px 24px 4px;
}

.place-form-body .form-control {
  border-radius: 8px;
}

.place-form-footer {
  display: flex;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid #eef0f2;
  background: #fafbfc;
}
