/* ------------------------------------------------------------
   GLOBAL
------------------------------------------------------------ */
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #222;
}

header {
  padding: 1rem 2rem;
  background: #1f2933;
  color: #f9fafb;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

/* ------------------------------------------------------------
   LAYOUT
------------------------------------------------------------ */
main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
}

.map-container {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  overflow: auto;
}

#burial-map {
  border: 1px solid #ddd;
  background: #fafafa;
}

/* ------------------------------------------------------------
   LEGEND (BOTTOM)
------------------------------------------------------------ */
.bottom-legends {
  margin-top: 10px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid #ccc;
  border-radius: 6px;
  max-width: 500px;
}

.legend-row {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-box {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #999;
}

.legend-box.available {
  background: #d1fae5;
  border-color: #10b981;
}

.legend-box.reserved {
  background: #fef3c7;
  border-color: #f59e0b;
}

.legend-box.occupied {
  background: #fee2e2;
  border-color: #ef4444;
}

.legend-box.not-available {
  background: #e5e7eb;
  border-color: #6b7280;
}

.legend-box.future {
  background: #c7d2fe;   /* soft indigo */
  border-color: #6366f1; /* indigo border */
}

/* ------------------------------------------------------------
   MAP SPACES
------------------------------------------------------------ */
.space {
  stroke: #4b5563;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.15s, stroke 0.15s;
}

.space.available {
  fill: #d1fae5;
}

.space.reserved {
  fill: #fef3c7;
}

.space.occupied {
  fill: #fee2e2;
}

.space.not-available {
  fill: #e5e7eb;
  stroke: #6b7280;
}

.space.future {
  fill: #c7d2fe;            /* soft indigo */
  stroke: #6366f1;          /* indigo border */
  stroke-width: 2;
  stroke-dasharray: 4 2;    /* subtle dashed border */
}

.space:hover {
  stroke-width: 2;
  stroke: #111827;
}

.space.selected {
  stroke-width: 3;
  stroke: #2563eb;
}

.space.highlight {
  stroke: #ffcc00;
  stroke-width: 4px;
  fill: #fff3b0 !important;
}

/* ------------------------------------------------------------
   PLOT LABELS & BORDERS
------------------------------------------------------------ */
.plot-border {
  fill: none;
  stroke: #111;
  stroke-width: 2;
}

.plot-label {
  font-size: 14px;
  font-weight: bold;
  text-anchor: middle;
  fill: #111;
}

.space-label {
  font-size: 12px;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #111;
  pointer-events: none;
}

/* ------------------------------------------------------------
   TOOLTIP
------------------------------------------------------------ */
.tooltip {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 2000;
  max-width: 220px;
}

.tooltip.hidden {
  display: none;
}

.tooltip-close {
  position: absolute;
  top: 4px;
  right: 6px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* ------------------------------------------------------------
   MOBILE
------------------------------------------------------------ */
@media (max-width: 600px) {
  #searchInput {
    width: 100%;
    font-size: 15px;
  }

  .map-container {
    padding: 0.5rem;
  }

  .bottom-legends {
    max-width: 100%;
  }

  .legend-row {
    flex-wrap: wrap;
    gap: 12px;
  }
}