/* Union Events Map - Coverage Visualization Styles */

.coverage-layer {
  pointer-events: none;
}

/* WiFi coverage circle */
.wifi-coverage {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.4) 0%,
    rgba(59, 130, 246, 0.2) 50%,
    rgba(59, 130, 246, 0.05) 80%,
    transparent 100%
  );
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.wifi-coverage.overlap {
  background: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.4) 0%,
    rgba(168, 85, 247, 0.2) 50%,
    rgba(168, 85, 247, 0.05) 80%,
    transparent 100%
  );
  border-color: rgba(168, 85, 247, 0.3);
}

/* Camera FOV cone */
.camera-fov {
  position: absolute;
  transform-origin: center center;
  pointer-events: none;
}

.camera-fov svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.camera-fov .fov-cone {
  fill: url(#camera-gradient);
  stroke: rgba(34, 197, 94, 0.5);
  stroke-width: 1;
}

/* Camera rotation handle */
.rotation-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid white;
  border-radius: 50%;
  cursor: grab;
  transform: translate(-50%, -50%);
  z-index: 40;
  pointer-events: auto;
}

.rotation-handle:hover {
  transform: translate(-50%, -50%) scale(1.2);
}

.rotation-handle.dragging {
  cursor: grabbing;
}

/* Doorbell FOV cone (orange/amber) */
.doorbell-fov {
  position: absolute;
  transform-origin: center center;
  pointer-events: none;
}

.doorbell-fov svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Door access reader FOV cone (purple) */
.door-access-fov {
  position: absolute;
  transform-origin: center center;
  pointer-events: none;
}

.door-access-fov svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Coverage toggle states */
.coverage-layer.hidden .wifi-coverage,
.coverage-layer.hidden .camera-fov,
.coverage-layer.hidden .doorbell-fov,
.coverage-layer.hidden .door-access-fov {
  display: none;
}

/* Coverage legend indicators */
.coverage-legend {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 10px;
  z-index: 50;
  display: none;
}

.coverage-legend.visible {
  display: block;
}

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

.coverage-legend-item:last-child {
  margin-bottom: 0;
}

.coverage-legend-item .sample {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.coverage-legend-item .sample.wifi {
  background: radial-gradient(
    circle,
    rgba(59, 130, 246, 0.6) 0%,
    rgba(59, 130, 246, 0.1) 100%
  );
}

.coverage-legend-item .sample.camera {
  background: linear-gradient(
    to right,
    rgba(34, 197, 94, 0.6) 0%,
    rgba(34, 197, 94, 0.1) 100%
  );
}

/* Ruler tool */
.ruler-layer line {
  stroke: var(--warning);
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.ruler-layer circle {
  fill: var(--warning);
  stroke: white;
  stroke-width: 2;
}

.ruler-layer text {
  fill: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
}

/* Scale bar */
.scale-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 10px;
  z-index: 50;
  display: none;
}

.scale-bar.visible {
  display: block;
}

.scale-bar-line {
  height: 4px;
  background: var(--text);
  margin-bottom: 4px;
  border-radius: 2px;
}

.scale-bar-label {
  text-align: center;
  color: var(--text-muted);
}

/* Measurement display */
.measurement-tooltip {
  position: fixed;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11px;
  z-index: 200;
  pointer-events: none;
  white-space: nowrap;
}

.measurement-tooltip strong {
  color: var(--primary);
}

/* Coverage statistics overlay */
.coverage-stats {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  right: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 11px;
  z-index: 50;
  display: none;
  min-width: 180px;
}

.coverage-stats.visible {
  display: block;
}

.coverage-stats h4 {
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.coverage-stat {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.coverage-stat .label {
  color: var(--text-muted);
}

.coverage-stat .value {
  font-weight: 600;
}

.coverage-stat .value.good {
  color: var(--success);
}

.coverage-stat .value.warning {
  color: var(--warning);
}

.coverage-stat .value.bad {
  color: var(--danger);
}

/* SVG gradient definitions */
.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Device Down State - Red coverage */
.wifi-coverage.device-down {
  background: radial-gradient(
    circle,
    rgba(239, 68, 68, 0.4) 0%,
    rgba(239, 68, 68, 0.2) 50%,
    rgba(239, 68, 68, 0.05) 80%,
    transparent 100%
  );
  border-color: rgba(239, 68, 68, 0.3);
}

.camera-fov.device-down path {
  stroke: rgba(239, 68, 68, 0.6);
}
