/* ============================================================================
   Fastighetsväljare & Strömmad 3D-Jaktmarksbyggare (#jaktmark-selector-modal)
   ============================================================================ */
.jaktmark-selector-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(8, 12, 10, 0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.selector-shell {
  width: min(1420px, 98vw);
  height: min(910px, 95vh);
  background: #0d1310;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(180deg, rgba(22, 34, 27, 0.95) 0%, rgba(13, 19, 16, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.selector-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 2px;
}

.selector-header h1 {
  font-size: 17px;
  font-weight: 800;
  color: #f4f7f5;
  margin: 0;
}

.selector-subtitle {
  font-size: 11.5px;
  color: #a1b0a7;
  margin: 2px 0 0 0;
  max-width: 860px;
  line-height: 1.3;
}

.selector-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 440px;
}

.selector-map-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: #121c16;
}

.selector-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #1b2a20;
  cursor: grab;
  touch-action: none;
}

.selector-canvas-wrap:active {
  cursor: grabbing;
}

#selector-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.selector-map-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: rgba(11, 17, 14, 0.95);
  border: 1px solid rgba(255, 200, 60, 0.65);
  border-radius: 8px;
  padding: 6px 10px;
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.selector-map-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sel-map-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(13, 19, 16, 0.9);
  color: #f1f5f9;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sel-map-btn:hover {
  background: rgba(30, 44, 36, 0.95);
  border-color: #34d399;
}

.selector-map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(11, 17, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  padding: 6px 12px;
  font-size: 11px;
  color: #d1dbd5;
}

.selector-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.leg-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.leg-selected {
  background: rgba(250, 204, 21, 0.45);
  border: 2px solid #facc15;
}

.leg-circle {
  background: transparent;
  border: 2px dashed #38bdf8;
  border-radius: 50%;
}

/* Active Streamed Map Banner on 2D Canvas */
.selector-active-map-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 58px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(10, 16, 13, 0.90);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(52, 211, 153, 0.42);
  border-radius: 10px;
  padding: 6px 11px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.sel-active-map-toggles {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sel-fastighet-overlay-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  padding: 3px 9px;
  cursor: pointer;
  user-select: none;
}

.sel-fastighet-overlay-toggle input {
  accent-color: #10b981;
  cursor: pointer;
}

/* Right Panel inside Selector */
.selector-side-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #101713;
  min-height: 0;
  overflow-y: auto;
}

.selector-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selector-label {
  font-size: 11px;
  font-weight: 700;
  color: #9ca8a1;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.selector-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px 11px;
  color: #f4f7f5;
  font-size: 12.5px;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.selector-input {
  background-color: #101e15;
  color: #f4f7f5;
  color-scheme: dark;
  cursor: pointer;
}

select.selector-input option {
  background-color: #101e15;
  color: #f4f7f5;
  padding: 6px 10px;
}

.selector-input:focus {
  border-color: #34d399;
  background-color: #13251a;
}

.selector-input.input-error {
  border-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.selector-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sel-preset-btn {
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d7e2dc;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.sel-preset-btn:hover {
  background: rgba(52, 211, 153, 0.16);
  border-color: #34d399;
  color: #fff;
}

.sel-preset-btn.danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: #ef4444;
}

.selector-prop-list {
  flex: 1 1 180px;
  min-height: 110px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(7, 11, 9, 0.65);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sel-prop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sel-prop-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sel-prop-item.selected {
  background: rgba(250, 204, 21, 0.15);
  border-color: rgba(250, 204, 21, 0.65);
}

.sel-prop-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
}

.sel-prop-sub {
  font-size: 10.5px;
  color: #94a3b8;
}

.sel-prop-ha {
  font-size: 11.5px;
  font-weight: 800;
  color: #facc15;
  white-space: nowrap;
}

.selector-build-progress {
  background: rgba(15, 25, 20, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 10px 12px;
}

.sel-prog-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #e0f2fe;
}

.sel-prog-step {
  font-size: 11px;
  color: #7dd3fc;
}

.btn-save-magic {
  appearance: none;
  width: 100%;
  padding: 13px 16px;
  border-radius: 11px;
  border: 1px solid #fbbf24;
  background: linear-gradient(135deg, #10b981 0%, #059669 55%, #d97706 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn-save-magic:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.5);
}

.btn-save-magic:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* Live 3D Magic Build HUD Banner */
.magic-build-banner {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 48;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(11, 20, 15, 0.94);
  border: 1.5px solid #34d399;
  border-radius: 99px;
  padding: 10px 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 24px rgba(16, 185, 129, 0.35);
}

.magic-banner-icon {
  font-size: 22px;
}

.magic-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #ecfdf5;
}

.magic-banner-sub {
  font-size: 11.5px;
  color: #6ee7b7;
}

@media (max-width: 900px) {
  .jaktmark-selector-overlay {
    padding: 0;
  }
  .selector-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
  .selector-header {
    padding: 7px 12px;
    gap: 8px;
  }
  .selector-badge,
  .selector-subtitle {
    display: none;
  }
  .selector-header h1 {
    font-size: 14.5px;
  }
  #btn-cancel-selector {
    padding: 5px 10px;
    font-size: 11.5px;
  }
  .selector-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 60% 40%;
  }
  .selector-map-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .selector-map-legend {
    display: none;
  }
  .selector-side-panel {
    padding: 8px 11px;
    gap: 6px;
    overflow-y: auto;
  }
  .selector-prop-list {
    min-height: 64px;
    max-height: 92px;
  }
  .btn-save-magic {
    padding: 10px 12px;
    font-size: 13px;
  }
  .magic-build-banner {
    top: 66px;
    width: calc(100vw - 24px);
    padding: 8px 14px;
    border-radius: 16px;
  }
}


.sel-prog-bar-wrap {
  width: 100%;
  margin: 8px 0;
}
