/* ============================================================
   line.css — Freehand Marker Drawing Tool + Road Overlay
   BellaVita Virtual Tour — Orange Theme
   ============================================================ */

/* ── Root overlay ─────────────────────────────────────────── */
#road-overlay-root {
  position: fixed;
  inset: 0;
  z-index: 800;
  pointer-events: none;
}

/* In draw mode the whole overlay captures mouse/touch */
#road-overlay-root.draw-mode {
  pointer-events: all;
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Ccircle cx='4' cy='24' r='3' fill='%23ff8c00' stroke='white' stroke-width='1.5'/%3E%3Cline x1='4' y1='24' x2='22' y2='4' stroke='%23ff8c00' stroke-width='2.5' stroke-linecap='round'/%3E%3Crect x='18' y='1' width='8' height='5' rx='1.5' fill='%23ff8c00' transform='rotate(45 22 4)'/%3E%3C/svg%3E")
      4 24,
    crosshair;
}

/* ── SVG canvas ───────────────────────────────────────────── */
#road-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   FREEHAND DRAWN PATH (while dragging)
════════════════════════════════════════════════════════════ */
#draw-live-path {
  fill: none;
  stroke: #ff8c00;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
  pointer-events: none;
  filter: url(#marker-blur);
}

/* ════════════════════════════════════════════════════════════
   FINAL ROAD POLYGON / PATH
════════════════════════════════════════════════════════════ */
#road-final-path {
  fill: rgba(255, 110, 0, 0.32);
  stroke: rgba(255, 150, 30, 0.9);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  pointer-events: all;
  cursor: pointer;
  transition:
    fill 0.2s ease,
    stroke 0.2s ease;
}
#road-final-path:hover {
  fill: rgba(255, 110, 0, 0.52);
  stroke: rgba(255, 210, 80, 1);
}

/* ── Road label ─────────────────────────────────────────── */
#road-poly-label {
  position: fixed;
  pointer-events: none;
  z-index: 810;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 10px rgba(255, 100, 0, 0.95),
    0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
#road-poly-label.visible {
  opacity: 1;
}

/* ── Hover tooltip ──────────────────────────────────────── */
#road-poly-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 820;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px 7px 12px;
  border-radius: 40px;
  background: rgba(18, 8, 0, 0.88);
  border: 1.5px solid rgba(255, 140, 0, 0.8);
  backdrop-filter: blur(8px);
  box-shadow:
    0 0 16px rgba(255, 110, 0, 0.45),
    0 0 30px rgba(255, 110, 0, 0.18);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #ffaa44;
  text-shadow: 0 0 8px rgba(255, 110, 0, 0.7);
  opacity: 0;
  transition: opacity 0.15s ease;
  transform: translate(-50%, calc(-100% - 14px));
}
#road-poly-tooltip.show {
  opacity: 1;
}

/* ════════════════════════════════════════════════════════════
   TOOLBAR
════════════════════════════════════════════════════════════ */
#road-draw-toolbar {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: none; /* shown only on target scene */
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(10, 5, 0, 0.88);
  border: 1px solid rgba(255, 140, 0, 0.4);
  border-radius: 50px;
  backdrop-filter: blur(14px);
  box-shadow:
    0 4px 28px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(255, 110, 0, 0.15);
  pointer-events: all;
  user-select: none;
  font-family: "Roboto Slab", Georgia, serif;
}
#road-draw-toolbar.scene-active {
  display: flex;
}

/* Draw button */
#btn-draw-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 40px;
  border: 1.5px solid rgba(255, 140, 0, 0.55);
  background: rgba(255, 110, 0, 0.1);
  color: #ffbb55;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.18s,
    border-color 0.18s,
    color 0.18s,
    box-shadow 0.18s;
  white-space: nowrap;
}
#btn-draw-toggle:hover {
  background: rgba(255, 110, 0, 0.25);
  border-color: #ff8c00;
  color: #fff;
}
#btn-draw-toggle.active {
  background: rgba(255, 110, 0, 0.38);
  border-color: #ffaa44;
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 110, 0, 0.5);
  animation: drawBtnPulse 2s ease-in-out infinite;
}
@keyframes drawBtnPulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(255, 110, 0, 0.5);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 110, 0, 0.85);
  }
}

#btn-draw-toggle .btn-icon {
  font-size: 15px;
  line-height: 1;
}

/* Divider */
.tb-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 140, 0, 0.2);
  flex-shrink: 0;
}

/* Icon buttons */
.tb-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 140, 0, 0.3);
  background: transparent;
  color: rgba(255, 170, 80, 0.7);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}
.tb-btn:hover {
  background: rgba(255, 110, 0, 0.22);
  border-color: #ff8c00;
  color: #fff;
}
.tb-btn:disabled {
  opacity: 0.28;
  cursor: default;
  pointer-events: none;
}
.tb-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hint pill */
#draw-hint {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  pointer-events: none;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 11px;
  color: rgba(255, 190, 100, 0.8);
  letter-spacing: 0.05em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  background: rgba(10, 5, 0, 0.65);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 140, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}
#draw-hint.visible {
  opacity: 1;
}

/* ════════════════════════════════════════════════════════════
   CODE OUTPUT PANEL
════════════════════════════════════════════════════════════ */
#road-code-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 950;
  pointer-events: all;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
#road-code-panel.open {
  transform: translateY(0);
}
.code-panel-inner {
  margin: 0 auto;
  max-width: 760px;
  background: rgba(10, 5, 0, 0.97);
  border: 1px solid rgba(255, 140, 0, 0.35);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  box-shadow:
    0 -8px 48px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(255, 110, 0, 0.1);
  overflow: hidden;
}
.code-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px 11px;
  border-bottom: 1px solid rgba(255, 140, 0, 0.15);
}
.code-panel-title {
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ffaa44;
}
.code-panel-actions {
  display: flex;
  gap: 8px;
}
.cp-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border-radius: 7px;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.cp-btn.copy-btn {
  border: 1px solid rgba(255, 140, 0, 0.5);
  background: rgba(255, 110, 0, 0.14);
  color: #ffaa44;
}
.cp-btn.copy-btn:hover {
  background: rgba(255, 110, 0, 0.3);
  color: #fff;
}
.cp-btn.copy-btn.copied {
  border-color: rgba(80, 220, 120, 0.6);
  background: rgba(40, 160, 80, 0.2);
  color: rgba(100, 230, 140, 0.9);
}
.cp-btn.close-btn {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: transparent;
  color: rgba(255, 255, 255, 0.38);
}
.cp-btn.close-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.8);
}
.cp-btn svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.code-panel-body {
  padding: 14px 20px 18px;
  max-height: 240px;
  overflow-y: auto;
}
#road-code-output {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 140, 0, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.65;
  color: #ffd090;
  resize: none;
  outline: none;
  box-sizing: border-box;
  min-height: 120px;
}
.code-panel-note {
  margin-top: 9px;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 11px;
  color: rgba(255, 170, 80, 0.5);
  line-height: 1.5;
}
.code-panel-body::-webkit-scrollbar {
  width: 4px;
}
.code-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 140, 0, 0.3);
  border-radius: 3px;
}
