:root {
  --bg-primary: #0a0a0c;
  --bg-secondary: #16161a;
  --bg-accent: #1c1c22;
  --text-primary: #f0f0f2;
  --text-secondary: #94949e;
  --accent: #00f2ff;
  --accent-muted: rgba(0, 242, 255, 0.15);
  --danger: #ff4d4d;
  --success: #00ff88;
  --border: #2d2d35;
  --glass: rgba(255, 255, 255, 0.03);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  display: grid;
  grid-template-columns: 1fr 400px;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Main Viewport */
.viewport {
  position: relative;
  background: radial-gradient(circle at center, #1a1a20 0%, #0a0a0c 100%);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.video-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-feed {
  width: 90%;
  height: 80%;
  background: #000;
  border: 1px solid var(--border);
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

/* Simulated Scanline */
.scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  opacity: 0.5;
  animation: scan 4s linear infinite;
  z-index: 10;
}

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

/* OCR Bounding Boxes Simulation */
.ocr-box {
  position: absolute;
  border: 1px solid var(--accent);
  background: var(--accent-muted);
  pointer-events: none;
}

.ocr-box::after {
  content: attr(data-label);
  position: absolute;
  top: -18px;
  left: -1px;
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 0 4px;
  white-space: nowrap;
}

/* HUD / Interface Overlays */
.hud-top {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.status-badge {
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 1.5s infinite;
}

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

/* Side Panel */
.sidebar {
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 24px;
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* Terminal Styling */
.terminal-card {
  background: #000;
  border: 1px solid var(--border);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--success);
  min-height: 120px;
  border-radius: 4px;
  position: relative;
}

.terminal-line {
  margin-bottom: 4px;
}

.terminal-line.dim { color: #006633; }
.terminal-line.white { color: var(--text-primary); }

/* Captured Text Result */
.result-card {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-content {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
}

.ai-enhancement {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}

.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-muted);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  margin-bottom: 10px;
}

/* Controls */
.controls-bar {
  background: var(--bg-secondary);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  border-top: 1px solid var(--border);
}

.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #000;
  border: none;
  font-weight: 700;
}

.btn.primary:hover {
  background: #00d8e6;
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
}

.key-hint {
  font-size: 10px;
  opacity: 0.6;
  border: 1px solid currentColor;
  padding: 2px 5px;
  border-radius: 3px;
  margin-left: auto;
}

/* Icons */
.icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

/* Utility */
.flex-row { display: flex; align-items: center; gap: 8px; }
.mt-auto { margin-top: auto; }
