:root {
  --bg-color: #050505;
  --panel-bg: rgba(10, 20, 30, 0.85);
  --primary: #00ff41; /* Classic Terminal Green */
  --secondary: #008F11; /* Darker Green */
  --accent: #ff4500; /* Alert Orange/Red */
  --cyan: #00f3ff; /* Cyber Blue */
  --grid-color: rgba(0, 255, 65, 0.1);
  --text-main: #e0e0e0;
  
  --font-mono: 'Courier New', Courier, monospace;
  --font-display: 'Arial Black', sans-serif;
  
  --scan-line-color: rgba(0, 255, 0, 0.1);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text-main);
  font-family: var(--font-mono);
  overflow-x: hidden;
  min-height: 100vh;
}

/* CRT Scanline Effect Overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    rgba(0,0,0,0.2) 50%,
    rgba(0,0,0,0.2)
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 100;
}

.scanlines::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  z-index: 2;
  background-size: 100% 2px, 3px 100%;
  pointer-events: none;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 2px solid var(--secondary);
  background: rgba(0, 20, 0, 0.9);
  position: relative;
  z-index: 10;
}

.nav::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30%; /* Partial underline */
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.nav-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 5px var(--primary);
}

.system-status {
  font-size: 0.8rem;
  color: var(--cyan);
  display: flex;
  gap: 1rem;
}

.blink {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hud-panel {
  background: var(--panel-bg);
  border: 1px solid var(--secondary);
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.1);
  padding: 2rem;
  width: 100%;
  max-width: 900px;
  position: relative;
  margin-top: 1rem;
}

/* Corner brackets */
.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  transition: all 0.3s ease;
}

.top-left { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.top-right { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.bottom-left { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.bottom-right { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.hud-header {
  border-bottom: 1px dashed var(--secondary);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.subject-name {
  font-size: 2.5rem;
  color: var(--primary);
  margin: 0;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 3px;
  text-shadow: 0 0 10px var(--secondary);
}

.warning-text {
  color: var(--accent);
  font-weight: bold;
  margin-top: 0.5rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Image Scanner Area */
.scanner-frame {
  position: relative;
  width: 100%;
  max-width: 600px; /* Constrain image width */
  margin: 0 auto 2rem auto;
  border: 1px solid var(--secondary);
  overflow: hidden;
  background: #000;
}

.scanner-img {
  width: 100%;
  height: auto;
  display: block;
  /* Green tint filter removed to show face clearly, but adding scanline effect */
  /* filter: contrast(1.2) sepia(0.2) hue-rotate(90deg) saturate(0.5); */
  opacity: 0.9;
}

.wide-mode {
  transform: scaleX(1.3);
  transform-origin: center;
}

.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(0, 255, 0, 0.1) 1px, transparent 1px);
  background-size: 100% 4px;
  pointer-events: none;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}

.target-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  border: 1px solid rgba(0, 255, 255, 0.3);
  pointer-events: none;
}

.target-reticle::before, .target-reticle::after {
  content: '';
  position: absolute;
  background: var(--cyan);
}
.target-reticle::before { top: 50%; left: -10px; width: 20px; height: 1px; }
.target-reticle::after { left: 50%; top: -10px; width: 1px; height: 20px; }

.scanning-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  opacity: 0.7;
  animation: scan 3s infinite linear;
}

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

/* Stats */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.data-module {
  background: rgba(0, 20, 0, 0.5);
  border: 1px solid var(--secondary);
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.data-label {
  font-size: 0.7rem;
  color: var(--secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.data-value {
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: bold;
}

.data-value.critical {
  color: var(--accent);
  text-shadow: 0 0 5px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Action Button */
.action-btn {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  padding: 1rem 3rem;
  margin-top: 2rem;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 2px;
  transition: all 0.2s;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.action-btn:hover {
  background: var(--accent);
  color: black;
  box-shadow: 0 0 20px var(--accent);
}

.action-btn::before {
  content: ">> ";
}

/* Face Focus */
.face-focus {
  position: absolute;
  top: 25%;
  left: 45%;
  width: 80px;
  height: 80px;
  border: 1px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--cyan);
  opacity: 0.6;
}

/* Loading/Code Scramble */
.code-stream {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--secondary);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  opacity: 0.5;
  height: 200px;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .hud-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .subject-name {
    font-size: 1.8rem;
  }
  .data-grid {
    grid-template-columns: 1fr;
  }
  .code-stream {
      display: none;
  }
}
