/* Blueprint Grid Background */
.grid-bg {
  background-color: #070d19;
  background-image:
    linear-gradient(to right, rgba(30, 41, 59, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 41, 59, 0.45) 1px, transparent 1px),
    linear-gradient(to right, rgba(51, 65, 85, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(51, 65, 85, 0.25) 1px, transparent 1px);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px;
}

/* Industrial Component Card */
.sim-comp {
  position: absolute;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #334155;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
  touch-action: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sim-comp.energized {
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.sim-comp.selected {
  border-color: #38bdf8;
}

/* Terminal / Pin Nodes (Enlarged hit-target for touch devices) */
.pin-node {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 4px;
  border-radius: 4px;
  background: #0f172a;
  border: 1.5px solid #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  color: #e2e8f0;
  cursor: crosshair;
  transition: transform 0.1s ease, background-color 0.1s ease;
}

.pin-node:hover,
.pin-node:active {
  transform: scale(1.15);
  border-color: #38bdf8;
  background: #0284c7;
  color: #ffffff;
}

.pin-node.pin-selected {
  background: #f59e0b;
  border-color: #fef08a;
  color: #000;
  transform: scale(1.2);
}

.pin-node.live-24v {
  border-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
}

.pin-node.live-ac {
  border-color: #f97316;
  box-shadow: 0 0 6px rgba(249, 115, 22, 0.7);
}

/* Animated 3-Phase Motor Rotor */
@keyframes spinRotor {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.rotor-spin-fwd {
  animation: spinRotor 0.55s linear infinite;
}

.rotor-spin-rev {
  animation: spinRotor 0.55s linear infinite reverse;
}

/* Wire SVG Styling */
.wire-path {
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: stroke;
  cursor: pointer;
}

.wire-path:hover {
  stroke-width: 4.5;
  filter: drop-shadow(0 0 4px #38bdf8);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #090d16;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 3px;
}