/**
 * Tomtekart – SVG plankart med interaktive tomter
 * Brukes sammen med to_tomtestatus
 */

/* ==============================
   Container
   ============================== */

.tomtekart {
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* SVG må være responsiv */
.tomtekart svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ==============================
   Grunnstil for alle tomter
   ============================== */

/* Alle SVG-elementer som representerer tomter */
.tomtekart svg [id^="tomt-"] {
  fill: rgba(0, 160, 0, 0.35); /* fallback = ledig */
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1.5;
  cursor: pointer;
  transition:
    fill 0.15s ease,
    fill-opacity 0.15s ease,
    stroke 0.15s ease,
    stroke-width 0.15s ease;
}

/* ==============================
   Statusfarger
   ============================== */

.tomtekart svg [id^="tomt-"].ledig {
  fill: rgba(0, 160, 0, 0.40) !important;
}

.tomtekart svg [id^="tomt-"].bebygd {
  fill: rgba(0, 90, 0, 0.40) !important;
}

.tomtekart svg [id^="tomt-"].reservert {
  fill: rgba(255, 170, 0, 0.45) !important;
}

.tomtekart svg [id^="tomt-"].solgt {
  fill: rgba(200, 0, 0, 0.45) !important;
  cursor: not-allowed;
}

/* ==============================
   Hover-effekter
   ============================== */

/* Kun tomter som kan klikkes */
.tomtekart svg [id^="tomt-"]:not(.solgt):hover {
  fill-opacity: 0.65;
  stroke-width: 2.5;
  filter: brightness(1.15) saturate(1.2);
}

/* ==============================
   Aktiv / valgt tomt (valgfritt)
   ============================== */

.tomtekart svg [id^="tomt-"].aktiv {
  stroke: #000;
  stroke-width: 3;
  fill-opacity: 0.7;
}

/* ==============================
   Tooltip (valgfritt)
   ============================== */

.tomte-tooltip {
  position: absolute;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  white-space: nowrap;
}

/* ==============================
   Touch / mobil
   ============================== */

@media (max-width: 768px) {
  .tomtekart svg [id^="tomt-"] {
    stroke-width: 1;
  }
}


/* Overlay bak popup */
.tomt-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.tomt-popup-overlay.hidden {
  display: none;
}

/* Selve popup-boksen */
.tomt-popup {
  background: #fff;
  padding: 20px 24px;
  max-width: 320px;
  width: 90%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  position: relative;
}

.tomt-popup h3 {
  margin: 0 0 10px;
}

.tomt-popup-body p {
  margin: 6px 0;
}

.tomt-popup-link {
  display: inline-block;
  margin-top: 12px;
  font-weight: 600;
  color: #1b5cff;
  text-decoration: none;
}

.tomt-popup-link:hover {
  text-decoration: underline;
}

/* Lukkeknapp */
.tomt-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

