/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Full page */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

/* Control Bar */
#control-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background: rgba(60, 78, 100, 0.95);
  color: #eaeaea;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 10;
  transition: transform 0.25s ease;
  border-bottom: 1px solid #333;
}



/* Control sections */
.controls-left,
.controls-center,
.controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.controls-center {
  gap: 16px;
}

.title {
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Buttons */
button {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #eaeaea;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background: #3a3a3a;
}

/* Select */
select {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #eaeaea;
  padding: 4px 6px;
  border-radius: 4px;
}

/* Canvas container */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Canvas */
#sim-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#control-tab {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  color: #eaeaea;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 0 0 6px 6px;
  border: 1px solid #333;
  border-top: none;
  cursor: pointer;
  z-index: 11;
  display: none;
}


#control-tab.visible {
  display: block;
}

.hidden {
  display: none !important;
}




/* ================================
   GLOBAL RESET (safe)
================================ */
* {
  box-sizing: border-box;
}

/* ================================
   ADCS PANEL ROOT
================================ */
#adcs-panel {
  position: fixed;
  top: 80px;
  left: 20px;
  z-index: 1000;

  width: 280px;
  padding: 12px;

  background: rgba(8, 12, 16, 0.95);
  border: 1px solid #2a2f36;

  font-family: "Courier New", monospace;
  font-size: 12px;
  color: #d6dbe0;

  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
}

/* ================================
   HEADER
================================ */
.adcs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding-bottom: 6px;
  margin-bottom: 10px;

  border-bottom: 1px solid #2a2f36;
}

.adcs-title {
  font-size: 13px;
  letter-spacing: 1px;
  font-weight: bold;
}

.adcs-status {
  font-size: 11px;
  letter-spacing: 0.5px;
}

.adcs-status.nominal {
  color: #6ee27d;
}

/* ================================
   SECTIONS
================================ */
.adcs-section {
  margin-bottom: 14px;
}

.section-title {
  font-size: 10px;
  letter-spacing: 1px;
  color: #8aa1b4;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ================================
   ROWS
================================ */
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;

  margin-bottom: 6px;
}

.row label {
  font-size: 11px;
  opacity: 0.85;
}

.readout {
  font-size: 11px;
  min-width: 42px;
  text-align: right;
  color: #9fd3ff;
}

/* ================================
   TELEMETRY
================================ */
.telemetry-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;

  font-size: 11px;
}

.telemetry-row span:last-child {
  color: #9fd3ff;
}

/* ================================
   INPUTS
================================ */
#adcs-panel input[type="range"] {
  width: 100%;
  margin: 4px 0;

  background: transparent;
}

/* Chrome */
#adcs-panel input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: #2a2f36;
}

#adcs-panel input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  margin-top: -3.5px;

  background: #9fd3ff;
  border-radius: 50%;
  cursor: pointer;
}

/* Firefox */
#adcs-panel input[type="range"]::-moz-range-track {
  height: 3px;
  background: #2a2f36;
}

#adcs-panel input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;

  background: #9fd3ff;
  border-radius: 50%;
  cursor: pointer;
}

/* ================================
   SELECT DROPDOWNS
================================ */
#adcs-panel select {
  width: 100%;
  padding: 4px;

  background: #0d1218;
  color: #d6dbe0;

  border: 1px solid #2a2f36;
  font-family: inherit;
  font-size: 11px;
}

#adcs-panel select:focus {
  outline: none;
  border-color: #9fd3ff;
}

/* ================================
   STATUS COLORS (future use)
================================ */
.status-warning {
  color: #f0c674;
}

.status-error {
  color: #ff6b6b;
}
.battery {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.battery-label {
  font-size: 9px;
  opacity: 0.6;
}

.battery-bar {
  width: 60px;
  height: 6px;
  background: #1a1f26;
  border: 1px solid #2a2f36;
}

.battery-fill {
  height: 100%;
  background: #6ee27d;
}

.battery-readout {
  font-size: 10px;
  color: #9fd3ff;
}

.battery-fill.nominal {
  background: #6ee27d;
}

.battery-fill.warning {
  background: #f0c674;
}

.battery-fill.critical {
  background: #ff6b6b;
}


.graph-placeholder {
  height: 60px;
  background: #0d1218;
  border: 1px solid #2a2f36;
  margin-bottom: 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 10px;
  color: #556070;
  letter-spacing: 1px;
}
.rotation-visual {
  height: 80px;
  background: #0d1218;
  border: 1px solid #2a2f36;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 24px;
  color: #9fd3ff;

  margin-bottom: 6px;
}
.battery-charge {
  font-size: 9px;
  letter-spacing: 1px;
  margin-top: 2px;
  opacity: 0.8;
}

/* States */
.battery-charge.charging {
  color: #6ee27d;
}

.battery-charge.discharging {
  color: #8aa1b4;
}

.battery-charge.offline {
  color: #ff6b6b;
}

@keyframes blink-red {
  0%   { opacity: 1; }
  50%  { opacity: 0.2; }
  100% { opacity: 1; }
}

.blink-critical {
  color: #ff6b6b;
  animation: blink-red 1s infinite;
  font-weight: bold;
}

#adcs-status {
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  border-radius: 4px;
  text-align: center;
  transition: opacity 0.3s ease;
}

#adcs-status.error {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.15);
  border: 1px solid rgba(255, 107, 107, 0.35);
}

#adcs-status.success {
  color: #6ee27d;
  background: rgba(110, 226, 125, 0.15);
  border: 1px solid rgba(110, 226, 125, 0.35);
}

#adcs-status.locked {
  color: #6aa8ff;
  background: rgba(106, 168, 255, 0.15);
  border: 1px solid rgba(106, 168, 255, 0.35);
}


.adcs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
}

.adcs-grid-header {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-bottom: 4px;
}

.adcs-grid-values {
  font-size: 0.9rem;
  font-weight: 600;
}

/* semantic coloring */
#adcs-system-status.adcs-online {
  color: #6ee27d;
}

#adcs-system-status.adcs-offline {
  color: #ff6b6b;
}

#adcs-attitude-status.adcs-stable {
  color: #6ee27d;
}

#adcs-attitude-status.adcs-unstable {
  color: #f0c674;
}

