/* =========================================================
   BB'S CYBER ELITE THEME - CORE (Inlined for Single File)
========================================================= */

@import url('/css/shared/font-standard.css') ;

:root {
  --bb-bg-deep: var(--theme-learning-surface-247);
  --bb-bg-surface: var(--theme-component-surface-31);
  --bb-panel: var(--theme-learning-surface-249);
  --bb-text-main: var(--theme-component-ink-18);
  --bb-text-muted: var(--theme-component-muted-13);
  --bb-kelly: var(--theme-component-primary-1);
  --bb-green: var(--theme-component-primary-100);
  --bb-cyan: var(--theme-component-info-16);
  --bb-error: var(--theme-component-error-1);
  --bb-red: var(--theme-component-error-27);
  --bb-gold: var(--theme-learning-warning-257);
  --bb-yellow: var(--theme-learning-warning-258);
  --bb-glow-primary: 0 0 20px var(--theme-component-primary-35);
  --bb-radius: 12px;
  --bb-shadow: 0 14px 50px var(--theme-learning-shadow-color-260);
  --font-tech: 'Ultra', Georgia, serif;
  --font-body: 'Geist', sans-serif;
  --font-code: 'JetBrains Mono', monospace;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bb-bg-deep);
  color: var(--bb-text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;

  /* Hide default cursor to use custom div cursor */
  cursor: none;
}

/* Force hide cursor on all interactive elements */

button, a, select, input, .lab-btn, .device, .drop-zone {
  cursor: none !important;
}

/* --- TACTICAL RETICLE SYSTEM (Updated from Site CSS) --- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 50px;
  height: 50px;
  border: 2px solid var(--bb-kelly);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2147483646;
  transition: width 0.2s, height 0.2s, border-color 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 4px var(--theme-learning-success-111);
  background-image: linear-gradient(90deg, var(--bb-kelly) 25%, transparent 25%, transparent 75%, var(--bb-kelly) 75%),
                    linear-gradient(180deg, var(--bb-kelly) 25%, transparent 25%, transparent 75%, var(--bb-kelly) 75%);
  background-position: center;
  background-size: 100% 2px, 2px 100%;
  background-repeat: no-repeat;
}

.cursor::before, .cursor::after {
  content: '';
  position: absolute;
  opacity: 0.8;
}

.cursor::before {
  width: 50%;
  height: 1px;
  border-top: 2px dotted var(--bb-kelly);
}

.cursor::after {
  height: 50%;
  width: 1px;
  border-left: 2px dotted var(--bb-kelly);
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background: var(--theme-catalog-surface-31);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2147483647;
  box-shadow: 0 0 4px var(--theme-component-border-7);
}

.cursor.active {
  width: 70px;
  height: 70px;
  border-color: var(--theme-component-border-7);
  box-shadow: 0 0 15px var(--bb-kelly);
  background-color: var(--theme-learning-success-bg-21);
}

/* Background Grid Animation */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--theme-learning-success-bg-21) 1px, transparent 1px), 
    linear-gradient(90deg, var(--theme-learning-success-bg-21) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

/* =========================================================
   MODULE 22 DASHBOARD STRUCTURE
========================================================= */

.bb-lab {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px 60px;
}

.bb-dashboard {
  background: var(--theme-learning-page-266);
  border: 1px solid var(--theme-learning-success-267);
  border-radius: var(--bb-radius);
  box-shadow: var(--bb-shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
  position: relative;
}

.bb-dash-head {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--theme-learning-success-bg-268);
  border-bottom: 1px solid var(--theme-learning-success-269);
}

.bb-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bb-titlewrap .bb-title {
  font-family: var(--font-tech);
  font-size: 1.4rem;
  text-transform: uppercase;
  color: var(--theme-component-ink-5);
  letter-spacing: 1px;
  margin: 0;
}

.bb-titlewrap .bb-subtitle {
  font-size: 15px;
  color: var(--bb-text-muted);
}

.bb-dash-body {
  padding: 24px;
}

/* Controls Bar */

.lab-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.scenario-select-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

#missionStatus {
  color: var(--bb-kelly);
  font-family: var(--font-tech);
  font-size: 14px;
}

.lab-select {
  background: var(--theme-component-page-45);
  border: 1px solid var(--bb-kelly);
  color: var(--bb-kelly);
  padding: 8px 12px;
  border-radius: 4px;
  font-family: var(--font-tech);
  font-size: 1rem;
  text-transform: uppercase;
  outline: none;
  max-width: 300px;
}

.lab-select option {
  background: var(--theme-component-page-22);
  color: var(--theme-component-ink-5);
}

.lab-btn {
  background: transparent;
  border: 1px solid var(--bb-kelly);
  color: var(--bb-kelly);
  padding: 8px 20px;
  font-family: var(--font-tech);
  text-transform: uppercase;
  font-weight: 700;
  transition: 0.2s;
  letter-spacing: 1px;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
}

.lab-btn:hover {
  background: var(--bb-kelly);
  color: var(--theme-component-on-primary-3);
  box-shadow: 0 0 15px var(--theme-learning-success-6);
}

.lab-btn.secondary {
  border-color: var(--bb-text-muted);
  color: var(--bb-text-muted);
}

.lab-btn.secondary:hover {
  border-color: var(--theme-component-border-7);
  color: var(--theme-component-ink-5);
  background: var(--theme-catalog-surface-541);
  box-shadow: none;
}

/* Progress Tracker */

.progress-tracker {
  font-family: var(--font-code);
  font-size: max(14px, 0.9rem);
  color: var(--bb-text-muted);
  border: 1px solid var(--theme-learning-success-307);
  padding: 6px 12px;
  border-radius: 4px;
  background: var(--theme-component-page-50);
}

.progress-val {
  color: var(--bb-kelly);
  font-weight: bold;
}

/* SCENARIO CONTEXT BOX */

.scenario-brief-box {
  background: var(--theme-learning-success-bg-21);
  border-left: 3px solid var(--bb-kelly);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
  font-size: max(14px, 0.95rem);
  color: var(--bb-text-main);
  line-height: 1.5;
}

.scenario-brief-box strong {
  color: var(--bb-kelly);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* =========================================================
   LAB WORKSPACE
========================================================= */

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  min-height: 500px;
}

/* Panels */

.lab-panel {
  background: var(--theme-component-page-47);
  border: 1px solid var(--theme-component-border-15);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.lab-panel.ups-panel {
  border-color: var(--theme-learning-success-111);
  background: radial-gradient(circle at top right, var(--theme-learning-success-bg-21), var(--theme-component-page-47));
}

.lab-panel.surge-panel {
  border-color: var(--theme-learning-info-283);
  background: radial-gradient(circle at top right, var(--theme-learning-info-bg-244), var(--theme-component-page-47));
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--theme-component-border-15);
}

.panel-title {
  font-family: var(--font-tech);
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--theme-component-ink-5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title i {
  font-size: max(14px, 0.9em);
}

/* Status LEDs */

.status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-learning-inset-135);
  box-shadow: 0 0 5px var(--theme-learning-shadow-color-14);
  transition: 0.3s;
}

.status-led.on-ok {
  background: var(--bb-kelly);
  box-shadow: 0 0 8px var(--bb-kelly);
}

.status-led.on-warn {
  background: var(--bb-gold);
  box-shadow: 0 0 8px var(--bb-gold);
}

.status-led.on-err {
  background: var(--bb-red);
  box-shadow: 0 0 8px var(--bb-red);
}

/* Drop Zones */

.drop-zone {
  flex-grow: 1;
  background: var(--theme-component-page-50);
  border: 2px dashed var(--theme-component-border-15);
  border-radius: 6px;
  padding: 10px;
  transition: 0.2s;
  min-height: 300px;
}

.drop-zone.drag-over {
  border-color: var(--bb-kelly);
  background: var(--theme-learning-success-bg-21);
}

/* Device Tiles */

.device {
  background: var(--theme-learning-page-285);
  border: 1px solid var(--theme-learning-border-49);
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.1s, box-shadow 0.2s;
  user-select: none;
}

.device:hover {
  border-color: var(--bb-kelly);
  transform: translateX(2px);
  box-shadow: 0 0 15px var(--theme-learning-shadow-color-14);
}

.device:active {

  /* No standard cursor here, custom cursor handles visual */
}

.device-info {
  display: flex;
  flex-direction: column;
}

.device-name {
  font-weight: 600;
  font-size: max(14px, 0.9rem);
  color: var(--theme-component-ink-5);
}

.device-watts {
  font-family: var(--font-code);
  font-size: 14px;
  color: var(--bb-text-muted);
}

.shutdown-btn {
  display: none;

  /* Only visible in blackout */
  background: var(--bb-red);
  color: var(--theme-component-ink-5);
  border: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  font-weight: 800;
  animation: pulseBtn 0.5s infinite;
}

@keyframes pulseBtn {

  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

/* Load Meter */

.load-meter-container {
  margin-top: auto;
  padding-top: 15px;
}

.load-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-code);
  font-size: 14px;
  color: var(--bb-text-muted);
  margin-bottom: 4px;
}

.load-bar-bg {
  height: 8px;
  width: 100%;
  background: var(--theme-component-page-22);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--theme-component-border-15);
}

.load-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--bb-kelly);
  transition: width 0.3s ease, background 0.3s;
}

/* Connection Selectors */

.connection-select {
  width: 100%;
  margin-bottom: 10px;
  background: var(--theme-component-page-22);
  color: var(--bb-text-muted);
  border: 1px solid var(--theme-component-border-8);
  padding: 6px;
  font-size: 14px;
  border-radius: 4px;
  font-family: var(--font-code);
}

/* =========================================================
   BLACKOUT MODE UI
========================================================= */

#blackout-overlay {
  position: fixed;
  inset: 0;
  background: var(--theme-component-page-19);

  /* Darker opacity to hide background */
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

#blackout-overlay.active {
  display: flex;
}

.blackout-msg {
  color: var(--bb-red);
  font-family: var(--font-tech);
  font-size: 4rem;
  text-transform: uppercase;
  text-shadow: 0 0 20px var(--bb-red);
  margin-bottom: 20px;
  animation: flicker 0.15s infinite;
  text-align: center;
}

.blackout-timer {
  font-family: var(--font-code);
  font-size: 3rem;
  color: var(--theme-component-ink-5);
  border: 2px solid var(--theme-component-border-7);
  padding: 10px 30px;
  border-radius: 8px;
  margin-bottom: 30px;
}

/* New Container for cloned devices */

#blackout-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  background: var(--theme-learning-page-311);
  border: 1px solid var(--theme-learning-border-312);
  padding: 20px;
  border-radius: 8px;
}

.blackout-instructions {
  margin-top: 20px;
  color: var(--bb-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  text-align: center;
}

/* Confetti / Success Overlay */

#success-overlay {
  position: fixed;
  inset: 0;
  background: var(--theme-learning-page-313);
  z-index: 10000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#success-overlay.active {
  display: flex;
}

#matrix-success-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
  background: var(--theme-component-page-19);
  z-index: 2147483000;
}

/* =========================================================
   CUT SHEET (Tabs)
========================================================= */

.cut-sheet-wrap {
  margin-top: 30px;
  border-top: 1px solid var(--theme-component-border-15);
  padding-top: 20px;
  display: none;

  /* Hidden by default until ALL complete */
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {

  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--theme-catalog-surface-70);
  border: none;
  color: var(--bb-text-muted);
  padding: 8px 16px;
  font-family: var(--font-tech);
  text-transform: uppercase;
  cursor: pointer;
  font-size: max(14px, 0.9rem);
  border-radius: 4px;
  flex-grow: 1;
}

.tab-btn.active {
  background: var(--bb-kelly);
  color: var(--theme-component-on-primary-3);
  font-weight: 700;
}

.tab-content {
  background: var(--theme-component-page-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--theme-component-border-15);
  font-size: max(14px, 0.9rem);
  color: var(--bb-text-muted);
  line-height: 1.5;
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content h3 {
  color: var(--bb-cyan);
  margin-top: 0;
  font-family: var(--font-tech);
  text-transform: uppercase;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--theme-component-border-15);
  padding-bottom: 8px;
}

.tab-content h4 {
  color: var(--theme-component-ink-5);
  margin-bottom: 5px;
  margin-top: 20px;
  font-size: 1rem;
}

.tab-content strong {
  color: var(--bb-text-main);
}

.tab-content p {
  margin-top: 5px;
}

.tab-content ul {
  padding-left: 20px;
}

.tab-content li {
  margin-bottom: 5px;
}

/* Mission Debrief Modal */









@media (max-width: 900px) {

}

/* Responsive */

@media (max-width: 900px) {

  .lab-grid {
    grid-template-columns: 1fr;
  }

  .bb-dashboard {
    margin: 10px;
  }

  .tabs {
    flex-direction: column;
  }
}

@keyframes flicker {

  0% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.9;
  }
}

/* --- TACTICAL RETICLE HUD --- */

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 55px;
  height: 55px;
  border: 1px solid var(--bb-kelly);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2147483646;
  transition: width 0.3s, height 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--theme-learning-success-111);
  background-image: linear-gradient(90deg, var(--bb-kelly) 20%, transparent 20%, transparent 80%, var(--bb-kelly) 80%),
                        linear-gradient(180deg, var(--bb-kelly) 20%, transparent 20%, transparent 80%, var(--bb-kelly) 80%);
  background-position: center;
  background-size: 100% 1px, 1px 100%;
  background-repeat: no-repeat;
}

.cursor::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  border-top: 1px dotted var(--bb-kelly);
  opacity: 0.4;
}

.cursor::after {
  content: '';
  position: absolute;
  height: 100%;
  width: 1px;
  border-left: 1px dotted var(--bb-kelly);
  opacity: 0.4;
}

.cursor-coords {
  position: absolute;
  right: -85px;
  top: -15px;
  font-family: var(--font-code);
  font-size: 14px;
  color: var(--bb-kelly);
  line-height: 1.4;
  text-transform: uppercase;
  text-shadow: 0 0 5px var(--theme-learning-success-246);
}

.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 4px;
  height: 4px;
  background: var(--theme-catalog-surface-31);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 2147483647;
  pointer-events: none;
  box-shadow: 0 0 12px var(--theme-component-border-7);
}

.cursor.active {
  width: 85px;
  height: 85px;
  background: var(--theme-learning-success-bg-198);
  border-color: var(--theme-component-border-7);
}

/* Border geometry retained from the retired palette layer. */
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .bb-dashboard{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .bb-dash-head{border-bottom-width:1px;border-bottom-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .progress-tracker{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .lab-panel{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .panel-head{border-bottom-width:1px;border-bottom-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .drop-zone{border-width:2px;border-style:dashed;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .device{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .load-bar-bg{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .connection-select{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .blackout-timer{border-width:2px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] #blackout-workspace{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .cut-sheet-wrap{border-top-width:1px;border-top-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .tab-content{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .tab-content h3{border-bottom-width:1px;border-bottom-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .mission-debrief-modal{border-width:1px;border-style:solid;}
html.bb-page-ca43db1734[data-bb-theme="patriotic"] .debrief-card{border-width:1px;border-style:solid;}

/* Blackout test lives in the pinned lab header (Brett 10/29); it appears only after a valid configuration. */
.bb-page-header .bb-blackout-link { border-color: var(--bb-red, #e53935) !important; color: var(--bb-red, #e53935) !important; }
.bb-page-header .bb-blackout-link:hover, .bb-page-header .bb-blackout-link:focus-visible { background: var(--bb-red, #e53935) !important; color: #fff !important; }
.bb-page-header .bb-blackout-link[hidden] { display: none !important; }
