/* Powerline Panel Styles */

.vlp-pylons-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.vlp-pylons-toolbar {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.vlp-pylons-toolbar button {
  padding: 4px 8px;
  font-size: 12px;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 1 auto;
  min-width: 100px;
}

.vlp-pylons-toolbar button:hover {
  background: #45a049;
}

.vlp-inspection-counter {
  margin-left: auto;
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}

.vlp-pylon-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease;
}

.vlp-pylon-group.vlp-pylon-selected {
  background: rgba(33, 150, 243, 0.15);
}

.vlp-pylon-header {
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  color: #e0e0e0;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.vlp-pylon-header:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.vlp-pylon-header::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 2px;
  transition: transform 0.2s ease;
}

.vlp-pylon-header.expanded::before {
  transform: rotate(45deg);
}

/* Inspection status dot — default grey (not inspected) */
.vlp-pylon-header::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #757575;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

/* Green dot for inspected pylons */
.vlp-pylon-group.vlp-pylon-inspected .vlp-pylon-header::after {
  background: #4CAF50;
}

/* Red dot for pylons with anomalies (overrides inspected green) */
.vlp-pylon-group.vlp-pylon-has-anomalies .vlp-pylon-header::after {
  background: #e53935;
}

.vlp-pylon-name-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.vlp-pylon-sub {
  font-size: 10px;
  font-weight: 400;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.vlp-pylon-group.dragging {
  opacity: 0.5;
}

.vlp-pylon-header.drag-over {
  outline: 2px dashed #2196F3;
  background: rgba(33, 150, 243, 0.1);
}

.vlp-pylon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  color: #bdbdbd;
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: auto;
  flex-shrink: 0;
}

.vlp-pylon-badge-duplicate {
  background: #FF9800;
  color: #fff;
  font-weight: 700;
}

.vlp-pylon-nadir-badge {
  background: #2196F3;
  color: #fff;
  font-weight: 700;
}

.vlp-pylon-photos {
  padding: 0;
  display: none;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow-y: auto;
}

.vlp-pylon-group.expanded .vlp-pylon-photos {
  display: flex;
}

.vlp-pylon-photo-row {
  padding: 5px 8px 5px 24px;
  font-size: 12px;
  color: #b0b0b0;
  cursor: grab;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vlp-pylon-photo-row:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #d0d0d0;
}

.vlp-pylon-photo-row.is-nadir {
  background: rgba(33, 150, 243, 0.12);
  border-left-color: #2196F3;
  color: #64B5F6;
  font-weight: 500;
}

.vlp-pylon-photo-row.vlp-photo-selected {
  background: rgba(255, 214, 0, 0.15);
  border-left-color: #FFD600;
  color: #fff;
}

.vlp-pylon-photo-row.dragging {
  opacity: 0.5;
  background: rgba(76, 175, 80, 0.25);
  cursor: grabbing;
}

.vlp-useless-icon {
  color: #f44336;
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
}

/* Actions — hidden by default, shown only when expanded */
.vlp-pylon-actions {
  padding: 0 8px 6px 8px;
  display: none;
  gap: 4px;
  flex-wrap: wrap;
}

.vlp-pylon-group.expanded .vlp-pylon-actions {
  display: flex;
}

.vlp-pylon-actions button {
  padding: 3px 6px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  color: #b0b0b0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vlp-pylon-actions button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #e0e0e0;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Delete button — compact icon-only, discreet by default */
.vlp-btn-delete-pylon {
  flex: 0 0 auto !important;
  min-width: auto !important;
  padding: 3px 6px !important;
  color: #888 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.vlp-btn-delete-pylon:hover {
  color: #ef5350 !important;
  border-color: rgba(239, 83, 80, 0.4) !important;
  background: rgba(239, 83, 80, 0.12) !important;
}

.vlp-pylon-actions button.danger {
  color: #ef5350;
  border-color: rgba(239, 83, 80, 0.3);
}

.vlp-pylon-actions button.danger:hover {
  background: rgba(239, 83, 80, 0.15);
  border-color: rgba(239, 83, 80, 0.5);
}

/* Right panel — Inspected toggle button */
.vrp-inspected-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  margin: 4px 0 8px 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  transition: all 0.2s ease;
  user-select: none;
}

.vrp-inspected-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.vrp-inspected-toggle.inspected {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.4);
  color: #4CAF50;
}

.vrp-inspected-toggle.inspected:hover {
  background: rgba(76, 175, 80, 0.25);
}

/* Right panel — annotation item */
.vrp-annotation-item {
  padding: 4px 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s;
  border-radius: 2px;
}

.vrp-annotation-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Colored dot — category or severity indicator */
.vrp-annotation-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vrp-annotation-cat {
  font-size: 10px;
  color: #aaa;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 90px;
  flex-shrink: 0;
}

.vrp-annotation-source {
  font-size: 10px;
  color: #666;
  margin-left: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
  flex-shrink: 0;
}

/* Selected pylon marker on Leaflet map */
.vlp-pylon-leaflet-marker.selected div {
  box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.7);
  transform: scale(1.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Pylon photo marker on Leaflet map */
.vlp-pylon-photo-marker {
  cursor: pointer;
}

/* Pylon illustration thumbnail (right panel, below toggle) */
.vrp-pylon-illustration-wrap {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vrp-pylon-illustration {
  text-align: center;
  min-height: 30px;
}

.vrp-pylon-illustration img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s, max-height 0.25s ease;
}

.vrp-pylon-illustration img:hover {
  opacity: 0.85;
}

/* Expanded panel: double illustration size */
.viewer-right-panel.expanded .vrp-pylon-illustration img {
  max-height: 320px;
}

/* Right panel photo drag */
.vrp-pylon-photo-item.dragging {
  opacity: 0.4;
}

.vrp-pylon-photo-item[draggable="true"]:hover .vrp-drag-handle {
  color: #aaa !important;
}

.vrp-useless-icon {
  color: #f44336;
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* ─── Pylon Export Status ─────────────────────────────────────── */

.vlp-export-status {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vlp-export-processing {
  color: #FFB74D;
}

.vlp-export-ready {
  color: #66BB6A;
}

.vlp-export-error {
  color: #ef5350;
}

.vlp-btn-export-download {
  background: #1976D2;
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s;
}

.vlp-btn-export-download:hover {
  background: #1565C0;
}

.vlp-btn-download-photos {
  background: #1976D2 !important;
  color: #fff !important;
}

.vlp-btn-download-photos:hover {
  background: #1565C0 !important;
}

.vlp-btn-download-photos:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ─── Span Tab ────────────────────────────────────────────────── */

.vlp-spans-content {
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.vlp-spans-toolbar {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.vlp-spans-toolbar button {
  padding: 4px 8px;
  font-size: 12px;
  background: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex: 0 1 auto;
  min-width: 80px;
}

.vlp-spans-toolbar button:hover {
  background: #45a049;
}

.vlp-span-stats {
  margin-left: auto;
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}

.vlp-span-list {
  flex: 1;
  overflow-y: auto;
}

.vlp-span-row {
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #e0e0e0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.vlp-span-row:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.vlp-span-row.vlp-span-selected {
  background: rgba(255, 214, 0, 0.15);
  color: #FFD600;
}

.vlp-span-icon {
  color: #FFD600;
  font-size: 11px;
  flex-shrink: 0;
}

.vlp-span-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vlp-span-length {
  font-size: 11px;
  color: #aaa;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.vlp-span-row.vlp-span-selected .vlp-span-length {
  color: #ffe082;
}

/* ─── Link Button Active State ────────────────────────────────── */

.vlp-btn-link-pylons,
.vlp-btn-link-pylons-tab {
  background: #546E7A !important;
  color: #fff !important;
  transition: all 0.2s ease !important;
}

.vlp-btn-link-pylons:hover,
.vlp-btn-link-pylons-tab:hover {
  background: #607D8B !important;
}

.vlp-btn-link-pylons.active,
.vlp-btn-link-pylons-tab.active {
  background: #FFD600 !important;
  color: #333 !important;
  box-shadow: 0 0 6px rgba(255, 214, 0, 0.4);
}

.vlp-btn-link-pylons.active:hover,
.vlp-btn-link-pylons-tab.active:hover {
  background: #FFEA00 !important;
}
