/* hsmGraphic.css — 1U rackmount HSM appliance graphic */

#hsm-graphic {
  flex-shrink: 0;
  z-index: 10;
  background: var(--bg-page);
  padding: 4px 20px 0;
}

.hsm-chassis {
  background: #2a2a2a;
  border-radius: 3px;
  padding: 0;
  margin: 0 0 12px 0;
  font-family: 'Courier New', monospace;
  position: relative;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}

/* Rack-mount strip along top */
.hsm-rack-strip {
  height: 6px;
  background: #222;
  border-bottom: 1px solid #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}
.hsm-rack-strip::before,
.hsm-rack-strip::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #444;
  flex-shrink: 0;
}

/* Main face layout */
.hsm-face {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 14px;
  min-height: 52px;
}

/* Model plate */
.hsm-model-plate {
  flex-shrink: 0;
  width: 120px;
}
.hsm-model-label {
  font-size: 9px;
  color: #999;
  letter-spacing: 1px;
  line-height: 1.2;
}
.hsm-model-name {
  font-size: 11px;
  color: #ccc;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

/* LCD display */
.hsm-lcd {
  flex: 1;
  min-width: 0;
  background: #1a2a1a;
  border: 1px solid #2a3a2a;
  border-radius: 2px;
  padding: 6px 10px;
  overflow: hidden;
}
.hsm-lcd-line1 {
  font-size: 13px;
  color: #4dff88;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hsm-lcd-line2 {
  font-size: 11px;
  color: #2ab855;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hsm-lcd.lcd-error {
  background: #2a1a1a;
  border-color: #3a2a2a;
}
.hsm-lcd.lcd-error .hsm-lcd-line1 {
  color: #ff4d4d;
}
.hsm-lcd.lcd-error .hsm-lcd-line2 {
  color: #cc3333;
}

/* LED indicators */
.hsm-leds {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hsm-led-row {
  display: flex;
  align-items: center;
  gap: 5px;
}
.hsm-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #333;
  flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
}
.hsm-led.on-green {
  background: #00cc44;
  box-shadow: 0 0 4px #00cc44;
}
.hsm-led.pulse-green {
  animation: hsm-led-pulse 2s ease-in-out infinite;
}
@keyframes hsm-led-pulse {
  0%, 100% { background: #00cc44; box-shadow: 0 0 4px #00cc44; }
  50% { background: #005518; box-shadow: 0 0 1px #005518; }
}
.hsm-led.on-amber {
  background: #cc8800;
  box-shadow: 0 0 4px #cc8800;
}
.hsm-led.on-red {
  background: #cc2222;
  box-shadow: 0 0 4px #cc2222;
}
.hsm-led-label {
  font-size: 8px;
  color: #aaa;
  letter-spacing: 0.5px;
  width: 22px;
}

/* Decorative buttons */
.hsm-buttons {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hsm-btn-deco {
  width: 14px;
  height: 10px;
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 1px;
}

/* Dark mode — lighter chassis so it stands out from dark page */
[data-theme="dark"] .hsm-chassis {
  background: #3a3a3a;
}
[data-theme="dark"] .hsm-rack-strip {
  background: #333;
  border-bottom-color: #4a4a4a;
}
[data-theme="dark"] .hsm-rack-strip::before,
[data-theme="dark"] .hsm-rack-strip::after {
  background: #2a2a2a;
  border-color: #555;
}
[data-theme="dark"] .hsm-btn-deco {
  background: #2a2a2a;
  border-color: #555;
}
[data-theme="dark"] .hsm-vents {
  background: repeating-linear-gradient(
    90deg,
    #333 0px, #333 3px,
    #3a3a3a 3px, #3a3a3a 5px
  );
  border-top-color: #2a2a2a;
}

/* Ventilation slots along bottom */
.hsm-vents {
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    #222 0px, #222 3px,
    #2a2a2a 3px, #2a2a2a 5px
  );
  border-top: 1px solid #1a1a1a;
}
