/* Shared AR view styles — pairs with modules/ar-view.mjs.
   Host apps link this as ../ar_preview/modules/ar-view.css.
   All DOM carrying these classes is injected by the module. */

.ar-mode {
  /* visible past the frame edges when calibration is zoomed out */
  background: #000;
}

.ar-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  z-index: 1;
}

/* the host's render canvas must paint above the video (transparent clear) */
.ar-mode .ar-app-canvas {
  position: relative;
  z-index: 2;
}

/* module-owned 2d overlay (draw-callback mode) */
.ar-overlay-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.ar-enter-btn,
.ar-bar {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 4;
}
.ar-bar {
  display: flex;
  gap: 0.5rem;
}
.ar-enter-btn,
.ar-bar button {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(20, 20, 24, 0.72);
  color: #fff;
  cursor: pointer;
}
.ar-enter-btn {
  background: var(--t-accent, #e04080);
  border-color: transparent;
}
.ar-enter-btn:hover { filter: brightness(1.1); }
.ar-bar button:hover { background: rgba(50, 50, 58, 0.85); }

.ar-calibration {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
}
.ar-cal-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.ar-cal-quad {
  fill: rgba(255, 60, 60, 0.10);
  stroke: #ff3c3c;
  stroke-width: 0.004;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.ar-cal-handle {
  position: absolute;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px; /* center the circle on the corner point */
  border-radius: 50%;
  background: rgba(255, 60, 60, 0.85);
  border: 2px solid #fff;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.ar-cal-handle:active { cursor: grabbing; }

.ar-cal-actions {
  position: absolute;
  bottom: 3.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: rgba(20, 20, 24, 0.8);
  color: #fff;
  max-width: min(92%, 620px);
  flex-wrap: wrap;
  justify-content: center;
}
.ar-cal-actions {
  cursor: grab;
  touch-action: none;   /* draggable — see makeCalActionsDraggable */
  user-select: none;
}
.ar-cal-grip {
  opacity: 0.55;
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -1px;
}
.ar-cal-instruction { font-size: 0.78rem; }
.ar-cal-actions button {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
}
.ar-cal-save { background: var(--t-accent, #e04080); color: #fff; }
.ar-cal-cancel { background: rgba(255, 255, 255, 0.18); color: #fff; }

.ar-cal-table {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
}
.ar-cal-table input {
  width: 3.6em;
  padding: 0.2rem 0.3rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.75rem;
}

.ar-cal-zoom {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.ar-cal-zoom-pct {
  font-size: 0.75rem;
  min-width: 2.6em;
  text-align: center;
  opacity: 0.85;
}
.ar-cal-actions .ar-cal-zoom-out,
.ar-cal-actions .ar-cal-zoom-in {
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
}
