/* Camp Map Styles */
:root {
  /* Pastel fills / strokes — match reservation status */
  --camp-map-available-fill: rgba(186, 230, 200, 0.72);
  --camp-map-available-stroke: #6fa888;
  --camp-map-available-fill-hover: rgba(166, 220, 185, 0.88);
  --camp-map-available-stroke-hover: #4d8a68;
  --camp-map-available-label: #2d5a40;

  --camp-map-reserved-fill: rgba(255, 205, 198, 0.72);
  --camp-map-reserved-stroke: #e09888;
  --camp-map-reserved-fill-hover: rgba(255, 188, 178, 0.9);
  --camp-map-reserved-stroke-hover: #c96b5c;
  --camp-map-reserved-label: #8b3d32;

  --camp-map-pending-fill: rgba(255, 235, 170, 0.75);
  --camp-map-pending-stroke: #d4b86a;
  --camp-map-pending-fill-hover: rgba(255, 225, 145, 0.92);
  --camp-map-pending-stroke-hover: #b8954a;
  --camp-map-pending-label: #7a6220;

  --camp-map-unknown-fill: rgba(210, 220, 235, 0.65);
  --camp-map-unknown-stroke: #9aa8bc;
  --camp-map-unknown-fill-hover: rgba(195, 208, 228, 0.85);
  --camp-map-unknown-stroke-hover: #7a889e;
  --camp-map-unknown-label: #4a5568;
}

.map-container {
  width: 100%;
  height: 600px;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f4f1;
}

.camp-map-viewport {
  position: relative;
}

.camp-map-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 0.65rem 1rem 0.75rem;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.98) 75%, rgba(255, 255, 255, 0));
  border-top: 1px solid rgba(40, 167, 69, 0.15);
  pointer-events: none;
}

.camp-map-hud-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.35rem;
}

.camp-map-hud-badge--available {
  background: rgba(186, 230, 200, 0.95);
  color: #1e4d2e;
  border: 1px solid rgba(80, 140, 100, 0.35);
}

.camp-map-hud-badge--reserved {
  background: rgba(255, 205, 198, 0.95);
  color: #6b2e26;
  border: 1px solid rgba(200, 100, 85, 0.35);
}

.camp-map-hud-badge--pending {
  background: rgba(255, 235, 170, 0.95);
  color: #5c4a12;
  border: 1px solid rgba(200, 170, 80, 0.4);
}

.camp-map-hud-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.camp-map-hud-title {
  color: #1e5f2f;
}

.camp-map-hud-desc {
  color: #495057;
  line-height: 1.35;
}

.camp-map-footer .camp-map-legend {
  font-size: 0.8rem;
  color: #495057;
}

.legend-swatch {
  display: inline-block;
  width: 1rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.legend-campsite {
  background: var(--camp-map-available-fill);
  border-color: var(--camp-map-available-stroke);
}

.legend-swatch-available {
  background: var(--camp-map-available-fill);
  border-color: var(--camp-map-available-stroke);
}

.legend-swatch-reserved {
  background: var(--camp-map-reserved-fill);
  border-color: var(--camp-map-reserved-stroke);
}

.legend-swatch-pending {
  background: var(--camp-map-pending-fill);
  border-color: var(--camp-map-pending-stroke);
}

.legend-swatch-unknown {
  background: var(--camp-map-unknown-fill);
  border-color: var(--camp-map-unknown-stroke);
}

.legend-facility {
  background: #d2b48c;
  border-color: #8b4513;
}

.legend-water {
  background: rgba(74, 144, 226, 0.65);
  border-color: #2c5aa0;
}

.legend-road {
  background: transparent;
  border-style: dashed;
  border-color: #6c4a2e;
}

.legend-trail {
  background: repeating-linear-gradient(90deg, #654321 0 4px, transparent 4px 7px);
  border: none;
}

.camp-map-bg-image {
  opacity: 0.92;
}

/* Dynamic map (photo + circle markers from admin) — pan + wheel zoom */
.map-container.map-container--dynamic {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 0;
  isolation: isolate;
}

/* Pan + zoom (transform); image at native aspect inside a pixel-sized stage */
.map-container--dynamic .camp-map-pan-zoom-outer {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  outline: none;
  cursor: grab;
  padding-bottom: 3.5rem;
  box-sizing: border-box;
}

.map-container--dynamic .camp-map-pan-zoom-outer.camp-map-pan-zoom-outer--dragging {
  cursor: grabbing;
  user-select: none;
}

.map-container--dynamic .camp-map-pan-zoom-outer:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(25, 135, 84, 0.35);
}

.map-container--dynamic .camp-map-pan-zoom-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.camp-map-dynamic-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 120px;
}

.map-container--dynamic .camp-map-dynamic-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  vertical-align: top;
  background: #e5e3df;
}

.camp-map-dynamic-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.campsite-site-dynamic {
  outline: none;
}

.campsite-dyn-circle {
  pointer-events: all;
  cursor: pointer;
  stroke-width: 2.5;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}

.campsite-dyn-circle--available {
  fill: var(--camp-map-available-fill);
  stroke: var(--camp-map-available-stroke);
}

.campsite-dyn-circle--reserved {
  fill: var(--camp-map-reserved-fill);
  stroke: var(--camp-map-reserved-stroke);
}

.campsite-dyn-circle--pending {
  fill: var(--camp-map-pending-fill);
  stroke: var(--camp-map-pending-stroke);
}

.campsite-dyn-circle--unknown {
  fill: var(--camp-map-unknown-fill);
  stroke: var(--camp-map-unknown-stroke);
}

.campsite-site-dynamic.is-hovered .campsite-dyn-circle--available,
.campsite-site-dynamic:focus .campsite-dyn-circle--available {
  fill: var(--camp-map-available-fill-hover);
  stroke: var(--camp-map-available-stroke-hover);
  filter: drop-shadow(0 1px 4px rgba(80, 140, 100, 0.35));
}

.campsite-site-dynamic.is-hovered .campsite-dyn-circle--reserved,
.campsite-site-dynamic:focus .campsite-dyn-circle--reserved {
  fill: var(--camp-map-reserved-fill-hover);
  stroke: var(--camp-map-reserved-stroke-hover);
  filter: drop-shadow(0 1px 4px rgba(200, 100, 90, 0.35));
}

.campsite-site-dynamic.is-hovered .campsite-dyn-circle--pending,
.campsite-site-dynamic:focus .campsite-dyn-circle--pending {
  fill: var(--camp-map-pending-fill-hover);
  stroke: var(--camp-map-pending-stroke-hover);
  filter: drop-shadow(0 1px 4px rgba(190, 150, 60, 0.35));
}

.campsite-site-dynamic.is-hovered .campsite-dyn-circle--unknown,
.campsite-site-dynamic:focus .campsite-dyn-circle--unknown {
  fill: var(--camp-map-unknown-fill-hover);
  stroke: var(--camp-map-unknown-stroke-hover);
  filter: drop-shadow(0 1px 4px rgba(100, 110, 130, 0.35));
}

.campsite-dyn-label {
  font-weight: 700;
  pointer-events: none;
  font-family: var(--font-sans);
}

.campsite-dyn-label--available {
  fill: var(--camp-map-available-label);
}

.campsite-dyn-label--reserved {
  fill: var(--camp-map-reserved-label);
}

.campsite-dyn-label--pending {
  fill: var(--camp-map-pending-label);
}

.campsite-dyn-label--unknown {
  fill: var(--camp-map-unknown-label);
}

/* Admin camp map editor */
.camp-map-editor-wrap {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
}

.camp-map-editor-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  user-select: none;
}

.camp-map-editor-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.camp-map-editor-circle {
  stroke-width: 3;
  pointer-events: all;
  cursor: grab;
}

.camp-map-editor-circle--available {
  fill: var(--camp-map-available-fill);
  stroke: var(--camp-map-available-stroke);
}

.camp-map-editor-circle--reserved {
  fill: var(--camp-map-reserved-fill);
  stroke: var(--camp-map-reserved-stroke);
}

.camp-map-editor-circle--pending {
  fill: var(--camp-map-pending-fill);
  stroke: var(--camp-map-pending-stroke);
}

.camp-map-editor-circle--unknown {
  fill: var(--camp-map-unknown-fill);
  stroke: var(--camp-map-unknown-stroke);
}

.camp-map-editor-circle:active {
  cursor: grabbing;
}

.camp-map-editor-circle-selected {
  stroke: #5b8fd4 !important;
  stroke-width: 5 !important;
  filter: drop-shadow(0 0 4px rgba(70, 130, 200, 0.45));
}

.camp-map-editor-label {
  font-weight: 700;
  pointer-events: none;
  font-family: var(--font-sans);
}

.camp-map-editor-label--available {
  fill: var(--camp-map-available-label);
}

.camp-map-editor-label--reserved {
  fill: var(--camp-map-reserved-label);
}

.camp-map-editor-label--pending {
  fill: var(--camp-map-pending-label);
}

.camp-map-editor-label--unknown {
  fill: var(--camp-map-unknown-label);
}

.camp-map-editor-label--location {
  fill: #2c4a6b;
}

.camp-map-editor-rect {
  stroke-width: 3;
  pointer-events: all;
  cursor: grab;
  fill: rgba(173, 200, 230, 0.72);
  stroke: #5a7a9e;
}

.camp-map-editor-rect:active {
  cursor: grabbing;
}

/* Public map: location markers (squares, not tied to reservation status) */
.campsite-dyn-rect {
  pointer-events: all;
  cursor: pointer;
  stroke-width: 2.5;
  fill: rgba(173, 200, 230, 0.72);
  stroke: #5a7a9e;
  transition: fill 0.15s ease, stroke 0.15s ease, filter 0.15s ease;
}

.campsite-site-dynamic.is-hovered .campsite-dyn-rect,
.campsite-site-dynamic:focus .campsite-dyn-rect {
  fill: rgba(155, 190, 228, 0.92);
  stroke: #3d5a78;
  filter: drop-shadow(0 1px 4px rgba(60, 90, 120, 0.35));
}

.campsite-site-dynamic.is-selected .campsite-dyn-circle,
.campsite-site-dynamic.is-selected .campsite-dyn-rect {
  filter: drop-shadow(0 0 0 3px rgba(25, 135, 84, 0.75));
}

.campsite-dyn-label--location {
  fill: #2c4a6b;
}

.legend-swatch-camp {
  border-radius: 50%;
  background: var(--camp-map-available-fill);
  border-color: var(--camp-map-available-stroke);
}

.legend-swatch-location {
  border-radius: 2px;
  background: rgba(173, 200, 230, 0.85);
  border-color: #5a7a9e;
}

.camp-map-sidebar .card-body {
  min-height: 12rem;
}

@media (min-width: 992px) {
  .camp-map-sidebar .card-body {
    min-height: 480px;
  }
}

.camp-map-editor-map-container {
  min-height: 360px;
}

@media (min-width: 992px) {
  .camp-map-editor-map-container {
    min-height: 600px;
  }
}

.camp-map-admin-sidebar {
  min-height: 280px;
}

.campsite-site.is-selected .campsite-shape {
  stroke-width: 4;
  filter: drop-shadow(0 0 3px rgba(25, 135, 84, 0.55));
}

.map-facility.is-selected .facility-shape {
  stroke: #198754 !important;
  stroke-width: 4;
  filter: drop-shadow(0 0 3px rgba(25, 135, 84, 0.45));
}

/* Same card hover fix as Google embed — avoid transform glitches over the SVG */
.camp-map-card:hover {
  transform: none;
}

/* Google Maps iframe (About page) — do not reuse .map-container (fixed 600px breaks embed layout) */
.google-map-embed {
  width: 100%;
  overflow: hidden;
  background: #e5e3df;
  line-height: 0;
}

.google-map-embed iframe {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
  vertical-align: bottom;
}

@media (max-width: 768px) {
  .google-map-embed iframe {
    height: min(55vh, 400px);
  }
}

/* Avoid transform on hover over embedded maps (fixes iframe repaint / “broken” map tiles) */
.card-map-embed:hover {
  transform: none;
}

.camp-map {
  display: block;
  width: 100%;
  height: 100%;
  font-family: var(--font-sans);
}

.map-water {
  fill: rgba(74, 144, 226, 0.55);
  stroke: #2c5aa0;
  stroke-width: 2;
  pointer-events: none;
}

.map-water-label {
  font-size: 13px;
  font-weight: 600;
  fill: #1a4a7a;
  text-anchor: middle;
  font-family: var(--font-sans);
  pointer-events: none;
}

.map-road {
  fill: none;
  stroke: #7a5c3e;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  pointer-events: none;
}

.map-trail {
  fill: none;
  stroke: #654321;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 10, 8;
  opacity: 0.75;
  pointer-events: none;
}

.campsite-site {
  cursor: pointer;
  outline: none;
}

.campsite-shape {
  stroke-width: 2;
  transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
}

.campsite-shape--available {
  fill: var(--camp-map-available-fill);
  stroke: var(--camp-map-available-stroke);
}

.campsite-shape--reserved {
  fill: var(--camp-map-reserved-fill);
  stroke: var(--camp-map-reserved-stroke);
}

.campsite-shape--pending {
  fill: var(--camp-map-pending-fill);
  stroke: var(--camp-map-pending-stroke);
}

.campsite-shape--unknown {
  fill: var(--camp-map-unknown-fill);
  stroke: var(--camp-map-unknown-stroke);
}

.campsite-site:hover .campsite-shape--available,
.campsite-site.is-hovered .campsite-shape--available {
  fill: var(--camp-map-available-fill-hover);
  stroke: var(--camp-map-available-stroke-hover);
  stroke-width: 3;
  filter: drop-shadow(0 2px 6px rgba(80, 140, 100, 0.3));
}

.campsite-site:hover .campsite-shape--reserved,
.campsite-site.is-hovered .campsite-shape--reserved {
  fill: var(--camp-map-reserved-fill-hover);
  stroke: var(--camp-map-reserved-stroke-hover);
  stroke-width: 3;
  filter: drop-shadow(0 2px 6px rgba(200, 100, 90, 0.3));
}

.campsite-site:hover .campsite-shape--pending,
.campsite-site.is-hovered .campsite-shape--pending {
  fill: var(--camp-map-pending-fill-hover);
  stroke: var(--camp-map-pending-stroke-hover);
  stroke-width: 3;
  filter: drop-shadow(0 2px 6px rgba(190, 150, 60, 0.3));
}

.campsite-site:hover .campsite-shape--unknown,
.campsite-site.is-hovered .campsite-shape--unknown {
  fill: var(--camp-map-unknown-fill-hover);
  stroke: var(--camp-map-unknown-stroke-hover);
  stroke-width: 3;
  filter: drop-shadow(0 2px 6px rgba(100, 110, 130, 0.25));
}

.campsite-site:focus .campsite-shape--available,
.campsite-site:focus .campsite-shape--reserved,
.campsite-site:focus .campsite-shape--pending,
.campsite-site:focus .campsite-shape--unknown {
  stroke: #5b8fd4;
  stroke-width: 3;
}

.campsite-label {
  font-size: 13px;
  font-weight: 700;
  text-anchor: middle;
  font-family: var(--font-sans);
  pointer-events: none;
}

.campsite-label--available {
  fill: var(--camp-map-available-label);
}

.campsite-label--reserved {
  fill: var(--camp-map-reserved-label);
}

.campsite-label--pending {
  fill: var(--camp-map-pending-label);
}

.campsite-label--unknown {
  fill: var(--camp-map-unknown-label);
}

.map-facility {
  cursor: pointer;
  outline: none;
}

.facility-shape {
  fill: #d2b48c;
  stroke: #8b4513;
  stroke-width: 2;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.map-facility:hover .facility-shape,
.map-facility:focus .facility-shape {
  fill: #e8d4b8;
  stroke: #6b3a12;
  stroke-width: 3;
}

.facility-label {
  font-size: 11px;
  font-weight: 700;
  fill: #5c3d1e;
  text-anchor: middle;
  font-family: var(--font-sans);
  pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
  .map-container {
    height: 400px;
  }

  .campsite-label {
    font-size: 11px;
  }

  .facility-label {
    font-size: 9px;
  }

  .map-water-label {
    font-size: 11px;
  }
}

/* Status indicators */
.status-available {
  color: #28a745;
}

.status-reserved {
  color: #dc3545;
}

.status-pending {
  color: #ffc107;
}

/* Modal styling for campsite details */
.modal-content {
  border-radius: 15px;
  border: 3px solid #28a745;
}

.modal-header {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border-radius: 12px 12px 0 0;
}

.modal-title {
  font-family: var(--font-sans);
  font-weight: bold;
}

/* Campsite info cards */
.campsite-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid #e9ecef;
  border-radius: 10px;
}

.campsite-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.campsite-card .card-img-top {
  border-radius: 8px 8px 0 0;
}

/* Loading animation for map */
.map-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  background: #f8f9fa;
  border-radius: 8px;
}

.map-loading .spinner-border {
  color: #28a745;
}

/* Accessibility: focus ring is on inner shapes (see .campsite-site:focus / .map-facility:focus) */

