/* iViu Plot - main styles */

:root {
  --plot-bg: #1a1a2e;
}

body {
  height: 100vh;
  overflow: hidden;
}

/* Login */
.login-center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.form-signin {
  width: 100%;
  max-width: 380px;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

/* Sidebar */
.sidebar {
  width: 280px;
  min-width: 240px;
  flex-shrink: 0;
}

/* Sidebar tabs */
.sidebar-tabs .nav-link {
  font-size: 0.68rem;
  padding: 5px 3px;
  white-space: nowrap;
}

/* Tab content fills remaining height */
.sidebar-tab-content {
  display: flex;
  flex-direction: column;
}

.sidebar-pane {
  display: none;
  flex-direction: column;
  height: 100%;
}
.sidebar-pane.show.active {
  display: flex !important;
}

.sidebar-pane-body {
  min-height: 0;
}

.sidebar-pane-toolbar {
  min-height: 0;
}

.sidebar-pane-list {
  min-height: 0;
}

.sidebar-pane-status {
  font-size: 0.72rem;
}

/* Inline detail panel */
.detail-panel {
  padding: 6px 8px;
  font-size: 0.74rem;
  max-height: 45%;
  overflow-y: auto;
  flex-shrink: 0;
}

.detail-toolbar {
  padding-bottom: 4px;
}

.detail-table td {
  padding: 1px 3px;
  vertical-align: top;
  font-size: 0.72rem !important;
}
.detail-table td.font-monospace {
  font-size: 0.65rem !important;
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: normal !important;
}

.detail-table td.lbl {
  color: var(--bs-secondary-color);
  text-align: right;
  white-space: nowrap;
  width: 40%;
  padding-right: 6px;
}

/* Device pos-tech filter buttons */
.dev-pt-btn {
  font-size: 0.75rem;
  padding: 1px 6px;
  border: 1px solid var(--bs-border-color);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  opacity: 0.6;
}
.dev-pt-btn.active {
  opacity: 1;
  border-color: var(--bs-secondary-color);
  background: var(--bs-secondary-bg);
}

/* Canvas */
#plot-canvas {
  display: block;
  cursor: crosshair;
}

.plot-overlay-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bs-secondary-color);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Mode indicator overlay */
.mode-indicator {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  z-index: 10;
}

/* Tag list */
.tag-list {
  font-size: 0.78rem;
}

.tag-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

.tag-list-item:hover,
.tag-list-item.active {
  background: var(--bs-secondary-bg);
}

.device-list-item.active {
  background: var(--bs-secondary-bg);
}

.calpoint-item.active {
  background: var(--bs-secondary-bg);
}

.tag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Inline list icon shapes (AP diamond, Cal triangle) */
.list-icon-diamond {
  display: inline-block;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-radius: 1px;
  flex-shrink: 0;
}

.list-icon-triangle {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  flex-shrink: 0;
}

/* Cal point list */
.calpoint-list {
  font-size: 0.78rem;
}

.calpoint-item {
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

.calpoint-item:hover {
  background: var(--bs-secondary-bg);
}

/* Shared icon button */
.btn-icon {
  background: none;
  border: none;
  padding: 1px 4px;
  cursor: pointer;
  color: var(--bs-secondary-color);
  line-height: 1;
  border-radius: 3px;
  font-size: 0.75rem;
}

.btn-icon:hover {
  color: var(--bs-body-color);
  background: var(--bs-secondary-bg);
}

.btn-xs {
  font-size: 0.7rem;
  padding: 1px 5px;
}

/* Zoom controls overlay */
.canvas-zoom-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 10;
}

.canvas-zoom-controls .btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  opacity: 0.7;
}

.canvas-zoom-controls .btn:hover {
  opacity: 1;
}

.canvas-zoom-controls .btn.active {
  opacity: 1;
  color: #f90;
  border-color: #f90;
  background: rgba(255,153,0,0.15);
}

/* Coordinate readout — now lives inside #legend-bar on the right */
.coord-readout {
  margin-left: auto;
  color: rgba(255,255,255,0.70);
  font-size: 0.70rem;
  font-family: monospace;
  white-space: nowrap;
  pointer-events: none;
  min-width: 120px;
  text-align: right;
}

/* Ruler distance readout — displayed above legend bar */
.ruler-readout {
  position: absolute;
  bottom: 36px;
  right: 10px;
  background: rgba(0,0,0,0.72);
  color: #f90;
  border: 1px solid #f90;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: monospace;
  font-weight: bold;
  padding: 3px 10px;
  z-index: 11;
  pointer-events: none;
  white-space: nowrap;
}

/* Device list */
.device-list {
  font-size: 0.78rem;
}

.device-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

.device-list-item:hover {
  background: var(--bs-secondary-bg);
}

.device-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}



/* Persistent legend bar — also hosts coordinate readout on the right */
#legend-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  background: rgba(0,0,0,0.52);
  border-top: 1px solid rgba(255,255,255,0.12);
  z-index: 10;
  padding: 0 10px;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  color: rgba(255,255,255,0.88);
  font-size: 0.7rem;
  white-space: nowrap;
}

.legend-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.legend-diamond {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-radius: 1px;
}

.legend-triangle {
  width: 0;
  height: 0;
  background: none !important;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid;
}
