:root {
  --background: #05080f;
  --sidebar-bg: #090e19;
  --copper: #b87333;
  --copper-dim: rgba(184, 115, 51, 0.25);
  --emerald: #10b981;
  --text-white: #ffffff;
  --text-slate: #94a3b8;
  --text-teal: #00c8ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: #e2e8f0;
  overflow: hidden;
  height: 100vh;
  position: relative;
}

/* ── CYBER GLOWING ORBS ── */
.hero-orbs {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
}

.orb-1 {
  width: 500px; height: 500px;
  background-color: var(--copper);
  top: -150px; left: -100px;
}

.orb-2 {
  width: 600px; height: 600px;
  background-color: var(--text-teal);
  bottom: -200px; right: -100px;
}

/* ── GRID PATTERN BACKDROP ── */
body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(30, 41, 59, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 41, 59, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  z-index: -2;
  pointer-events: none;
}

/* ── DASHBOARD LAYOUT ── */
.dashboard-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 10;
}

/* ── LEFT VIEWPORT SECTION ── */
.viewport-section {
  flex: 1;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 2px solid var(--copper);
  padding-bottom: 18px;
  margin-bottom: 25px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 8px rgba(184, 115, 51, 0.6));
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--text-white);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.brand-sub {
  font-size: 9px;
  color: var(--text-slate);
  letter-spacing: 1.5px;
  font-weight: bold;
}

/* Viewport Box (Video/Canvas Container) */
.viewport-container {
  flex: 1;
  background-color: #03060c;
  border: 1px solid var(--copper-dim);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 30px rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 480px;
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Live CSS Spectral Filters */
.feed-normal {
  filter: none;
}

.feed-swir {
  filter: hue-rotate(90deg) saturate(3.5) contrast(1.6) brightness(0.9);
}

.feed-thermal {
  filter: invert(1) hue-rotate(180deg) saturate(2.5) contrast(1.3);
}

#canvasOverlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* Warning overlay when webcam is off */
.warning-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 8, 18, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  padding: 30px;
  text-align: center;
}

.warning-overlay span {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 8px;
}

.warning-overlay p {
  font-size: 12px;
  color: var(--text-slate);
  max-width: 320px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.btn-primary {
  background-color: var(--copper);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #8c521f;
  box-shadow: 0 0 15px rgba(184, 115, 51, 0.4);
}

/* Badge overlay in camera */
.channel-badge {
  position: absolute;
  top: 15px; left: 15px;
  background: rgba(9, 14, 25, 0.85);
  border: 1px solid var(--copper-dim);
  border-radius: 4px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-teal);
  letter-spacing: 1px;
  z-index: 25;
}

/* Animated scan line */
.scan-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to bottom, rgba(184,115,51,0), var(--copper), rgba(184,115,51,0));
  box-shadow: 0 0 15px var(--copper);
  z-index: 30;
  display: none;
}

@keyframes scanEffect {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.scanning-active {
  display: block;
  animation: scanEffect 2s infinite linear;
}

/* Controls Grid */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.btn-scan {
  background-color: var(--copper);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 14px 28px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-scan:hover {
  background-color: #8c521f;
  box-shadow: 0 0 20px rgba(184, 115, 51, 0.5);
  transform: translateY(-2px);
}

.btn-scan.scanning-mode {
  background-color: var(--emerald);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.channel-group {
  display: flex;
  background: #090e19;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 4px;
  gap: 4px;
}

.btn-channel {
  background: transparent;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  color: var(--text-slate);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-channel.active {
  background-color: var(--copper-dim);
  color: var(--text-white);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Preset Options */
.presets-container {
  margin-top: 25px;
  background: rgba(9, 14, 25, 0.45);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 16px;
}

.presets-container h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  color: var(--text-slate);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-preset {
  background-color: #0b1120;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 8px 14px;
  color: var(--text-slate);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset:hover {
  border-color: var(--copper);
  color: var(--text-white);
}

.btn-preset.active {
  border-color: var(--copper);
  background-color: rgba(184, 115, 51, 0.1);
  color: var(--text-white);
}

/* ── RIGHT CONTROL PANEL ── */
.control-panel {
  width: 380px;
  background-color: var(--sidebar-bg);
  border-left: 1px solid rgba(30, 41, 59, 0.5);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  flex-shrink: 0;
}

.divider {
  border-top: 1px solid rgba(30, 41, 59, 0.5);
  margin: 18px 0;
}

/* Architect Card */
.architect-card {
  background: rgba(184, 115, 51, 0.05);
  border: 1px solid var(--copper-dim);
  border-radius: 6px;
  padding: 15px;
  position: relative;
}

.architect-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 3px; height: 100%;
  background-color: var(--copper);
}

.arch-lbl {
  font-size: 8px;
  font-weight: 700;
  color: var(--copper);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.arch-name {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-white);
  margin-top: 2px;
}

.arch-meta {
  font-size: 10px;
  color: var(--text-slate);
  margin-bottom: 10px;
}

.arch-purpose {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.5;
  text-align: justify;
}

.arch-purpose strong {
  color: var(--text-white);
}

/* Diagnostics */
.diagnostics-section h3, .chart-section h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-slate);
  letter-spacing: 1.5px;
  margin-bottom: 15px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metric-box {
  background: #05080f;
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 6px;
  padding: 12px 14px;
}

.m-lbl {
  display: block;
  font-size: 9px;
  color: var(--text-slate);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.m-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
}

#valMineral {
  color: var(--text-teal);
}

/* Composition Chart */
.chart-wrapper {
  height: 160px;
  position: relative;
}

/* Valuation Panel */
.valuation-section {
  background: #03060c;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 16px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.8);
}

.val-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.v-lbl {
  font-size: 8.5px;
  color: var(--text-slate);
  font-weight: bold;
  letter-spacing: 1px;
}

.v-status {
  font-size: 8px;
  font-weight: 800;
  color: var(--emerald);
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 6px;
  border-radius: 3px;
}

.val-price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 900;
  color: var(--text-white);
  display: block;
  line-height: 1.1;
}

.val-unit {
  font-size: 9.5px;
  color: var(--text-slate);
  margin-top: 3px;
  display: block;
}
