/* Chassis Preview Box Styles - 3x8 SFF and 4x3 LFF Server Enclosure */

.chassis-preview-container {
  background: #111520;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 1px solid #232a3d;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(22, 27, 42, 0.15);
  color: #e2e8f0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

/* Server Rack Ears and Faceplate Wrapper */
.server-rack-chassis {
  display: flex;
  align-items: stretch;
  background: #181d2c;
  border: 2px solid #2e374f;
  border-radius: var(--radius-base);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Rack Mount Ears */
.rack-ear {
  width: 28px;
  background: linear-gradient(180deg, #252c40 0%, #1a2030 100%);
  border-right: 1px solid #333d59;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  flex-shrink: 0;
}

.rack-ear.ear-right {
  border-right: none;
  border-left: 1px solid #333d59;
}

.rack-bolt-hole {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0f131d;
  border: 1px solid #4a5578;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
}

.rack-ear-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: #64748b;
  letter-spacing: 0.1em;
}

/* Enclosure Main Center Bay */
.chassis-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background: radial-gradient(circle at 50% 0%, #1f273d 0%, #141926 100%);
  box-sizing: border-box;
}

/* Chassis Header Bar */
.chassis-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid #2a344d;
  width: 100%;
  box-sizing: border-box;
}

.chassis-model-tag {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chassis-model-tag strong {
  color: #f1f5f9;
}

/* Chassis HUD Stats Chips (Moved from header to bay simulator) */
.chassis-hud-stats {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.chassis-hud-stats .stat-chip {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: var(--radius-base);
  padding: 3px 8px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chassis-hud-stats .stat-chip-label {
  color: #94a3b8;
  font-weight: 500;
}

.chassis-hud-stats .stat-chip-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: #93c5fd;
}

.chassis-leds {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.chassis-led-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: #64748b;
}

.hardware-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #334155;
}

.hardware-led.led-power {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.hardware-led.led-uid {
  background: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
}

.hardware-led.led-health {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Quick Actions in Chassis */
.chassis-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

/* ============================================================
   BOX CAGES: SFF Mode (3x 8-Bay Boxes) & LFF Mode (4x 3-Bay Boxes)
   ============================================================ */
.drive-cages-wrapper {
  display: grid;
  gap: var(--space-md);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* SFF Layout: 3 boxes horizontally */
.drive-cages-wrapper.mode-sff {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1024px) {
  .drive-cages-wrapper.mode-sff {
    grid-template-columns: 1fr;
  }
}

/* LFF Layout: 4 boxes horizontally */
.drive-cages-wrapper.mode-lff {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
}

@media (max-width: 1100px) {
  .drive-cages-wrapper.mode-lff {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .drive-cages-wrapper.mode-lff {
    grid-template-columns: 1fr;
  }
}

/* Individual Box / Cage Container */
.drive-box-cage {
  background: #131724;
  border: 1px solid #28334d;
  border-radius: var(--radius-base);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.box-cage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 4px;
  border-bottom: 1px solid #1f273d;
}

.box-cage-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #7e8ba8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.box-cage-count {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: #4e5d7c;
}

/* Bay Grid inside Box */
/* SFF: 8 vertical bays side-by-side */
.bays-grid-sff {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  min-height: 170px;
}

/* LFF: 3 horizontal bays stacked vertically */
.bays-grid-lff {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  min-height: 170px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
   DRIVE BAY SLOTS
   ============================================================ */
.drive-bay-slot {
  position: relative;
  border-radius: var(--radius-base);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

/* Empty Bay Slot */
.drive-bay-slot.empty-bay {
  border: 1px dashed #2f3a55;
  background: rgba(22, 28, 44, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #4a5775;
  padding: 4px;
}

.drive-bay-slot.empty-bay:hover {
  border-color: #455fab;
  background: rgba(69, 95, 171, 0.15);
  color: #93c5fd;
  transform: translateY(-1px);
}

.empty-bay-num {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
}

.empty-bay-icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.empty-bay-text {
  font-size: 0.5625rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
}

/* Populated Drive Bay */
.drive-bay-slot.populated-bay {
  background: #1c2336;
  border: 1px solid #3b4768;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.drive-bay-slot.populated-bay:hover {
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
  transform: translateY(-1px);
}

/* Hot Spare Drive styling */
.drive-bay-slot.populated-bay.is-hot-spare {
  border-color: #f59e0b;
  background: #231e15;
}

/* SFF Specific Bay Layout (Vertical Drive) */
.bays-grid-sff .drive-bay-slot {
  height: 100%;
}

.bays-grid-sff .populated-bay .bay-main-content {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 4px 0;
}

/* LFF Specific Bay Layout (Horizontal 3.5" Drive) */
.bays-grid-lff .drive-bay-slot {
  height: 52px;
  padding: 0 8px;
  min-width: 0;
  box-sizing: border-box;
}

/* Populated Drive Bay in LFF */
.bays-grid-lff .populated-bay {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.bays-grid-lff .populated-bay .bay-top-header {
  width: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.bays-grid-lff .populated-bay .bay-index {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #94a3b8;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}

.bays-grid-lff .populated-bay .bay-status-led {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.bays-grid-lff .populated-bay .bay-main-content {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.bays-grid-lff .populated-bay .drive-label-text {
  font-family: var(--font-headline);
  font-size: 0.75rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  letter-spacing: 0.01em;
}

.bays-grid-lff .populated-bay .drive-type-chip {
  flex-shrink: 0;
  font-size: 0.5625rem;
  line-height: 1;
  padding: 2px 4px;
}

.bays-grid-lff .populated-bay .caddy-adapter-tag {
  flex-shrink: 0;
  font-size: 0.5rem;
  line-height: 1;
  padding: 2px 3px;
}

.bays-grid-lff .populated-bay .bay-actions-group {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

/* Empty Bay in LFF */
.bays-grid-lff .empty-bay {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  gap: 6px;
  min-width: 0;
  box-sizing: border-box;
}

.bays-grid-lff .empty-bay .empty-bay-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #4a5775;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.bays-grid-lff .empty-bay .empty-bay-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

.bays-grid-lff .empty-bay .empty-bay-text {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  line-height: 1;
  transition: color 0.15s ease;
}

.bays-grid-lff .empty-bay:hover .empty-bay-num {
  color: #93c5fd;
}

.bays-grid-lff .empty-bay:hover .empty-bay-text {
  color: #bfdbfe;
}

.bays-grid-lff .empty-bay:hover .empty-bay-icon {
  opacity: 1;
  color: #93c5fd;
}

@media (max-width: 1280px) {
  .bays-grid-lff .populated-bay .drive-label-text {
    font-size: 0.6875rem;
  }
}

/* Drive Bay Elements */
.bay-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.bay-index {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: #718096;
  font-weight: 700;
}

.bay-status-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 4px #10b981;
}

.bay-status-led.spare-led {
  background: #f59e0b;
  box-shadow: 0 0 4px #f59e0b;
}

.drive-label-text {
  font-family: var(--font-headline);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
}

.drive-type-chip {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 700;
  text-transform: uppercase;
}

.drive-type-chip.chip-ssd {
  background: rgba(37, 99, 235, 0.3);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.3);
}

.drive-type-chip.chip-hdd {
  background: rgba(71, 85, 105, 0.4);
  color: #cbd5e1;
  border: 1px solid rgba(203, 213, 225, 0.2);
}

.caddy-adapter-tag {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  background: #2d3748;
  color: #e2e8f0;
  padding: 1px 3px;
  border-radius: 2px;
  border: 1px solid #4a5568;
}

/* Bay Action Hover Overlay Buttons */
.bay-actions-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.bays-grid-sff .bay-actions-group {
  flex-direction: column;
  margin-top: 2px;
}

.bay-action-btn {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 2px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.1s ease;
}

.bay-action-btn:hover {
  background: #334155;
  color: #ffffff;
}

.bay-action-btn.btn-remove:hover {
  background: #7f1d1d;
  color: #fecaca;
  border-color: #ef4444;
}

.bay-action-btn.btn-spare:hover {
  background: #78350f;
  color: #fde68a;
  border-color: #f59e0b;
}

.bay-action-btn.active-spare {
  background: #f59e0b;
  color: #1c1917;
  border-color: #f59e0b;
}

.bay-action-btn svg {
  width: 10px;
  height: 10px;
}
