/* ==========================================================================
   CipherVision: The Image Hacker - Gameplay Stylesheet
   Forensic inspector rig, canvas viewport, spectrum filters & CRT terminal
   ========================================================================== */

/* --------------------------------------------------------------------------
   Workspace Split Layout (Inspector Left | Terminal Right)
   -------------------------------------------------------------------------- */
.workspace-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: calc(100vh - 56px);
}

/* --------------------------------------------------------------------------
   Left Pane: Forensic Image Inspection Rig
   -------------------------------------------------------------------------- */
.inspector-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #05070a;
  position: relative;
  min-width: 0;
}

.inspector-header {
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(14, 20, 28, 0.95);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  font-size: 0.85rem;
  z-index: 10;
}

.pane-tag {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.tag-accent {
  color: var(--accent-cyan);
  margin-right: 6px;
  font-weight: 700;
}

.inspector-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

.inspector-meta .pipe {
  margin: 0 8px;
  opacity: 0.3;
}

/* --------------------------------------------------------------------------
   Canvas Inspection Viewport & Pan Rig
   -------------------------------------------------------------------------- */
.viewport-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  background: radial-gradient(circle at 50% 50%, #101622 0%, #070a0f 100%);
}

.crosshair-h, .crosshair-v {
  position: absolute;
  pointer-events: none;
  background: rgba(0, 240, 255, 0.18);
  z-index: 15;
}
.crosshair-h {
  width: 100%;
  height: 1px;
  top: 50%;
  left: 0;
}
.crosshair-v {
  height: 100%;
  width: 1px;
  left: 50%;
  top: 0;
}

.canvas-pan-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#sceneCanvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Hotspots Interactive Layer */
.hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hotspot-box {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border: 1px dashed rgba(0, 240, 255, 0.45);
  background: rgba(0, 240, 255, 0.06);
  transition: all 0.2s ease;
}

.hotspot-box:hover {
  border: 2px solid var(--accent-cyan);
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.6);
}

.hotspot-corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent-cyan);
  border-style: solid;
}
.hotspot-corner.tl { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.hotspot-corner.tr { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.hotspot-corner.bl { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.hotspot-corner.br { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

/* Interactive Magnifier Tooltip */
.magnifier-popup {
  position: absolute;
  bottom: 20px;
  left: 20px;
  max-width: 380px;
  background: rgba(10, 16, 24, 0.96);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.85), 0 0 15px rgba(0, 240, 255, 0.3);
  padding: 14px 18px;
  border-radius: 4px;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
  backdrop-filter: blur(8px);
}

.magnifier-popup.active {
  opacity: 1;
  transform: translateY(0);
}

.magnifier-header {
  font-family: var(--font-title);
  font-size: 0.88rem;
  color: var(--accent-cyan);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.magnifier-body {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* Floating Viewport Quick Tools */
.viewport-quick-tools {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

/* Filter & Spectrum Toolbar */
.inspector-toolbar {
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 16px;
  display: flex;
  align-items: center;
  background: rgba(10, 15, 22, 0.96);
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  z-index: 10;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  width: 100%;
  scrollbar-width: none;
}
.filter-controls::-webkit-scrollbar {
  display: none;
}

.filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1.2px;
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.filter-btn.active {
  background-color: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Right Pane: Cyber CRT Command Terminal
   -------------------------------------------------------------------------- */
.terminal-pane {
  width: clamp(360px, 28vw, 480px);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #06090d;
  position: relative;
  border-left: 1px solid var(--border-cyan);
  min-width: 320px;
  overflow: hidden;
}

.terminal-header {
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #090e15;
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}

.term-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.term-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.term-dot.green { background: #00ff7f; }
.term-dot.yellow { background: #ffb800; }
.term-dot.red { background: #ff3344; }

.term-name {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-left: 6px;
}

.term-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-amber);
  font-weight: 700;
}

/* Terminal Output Log Area */
.terminal-output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--accent-green);
  background: radial-gradient(circle at 50% 0%, #0b121c 0%, #05080c 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-output::-webkit-scrollbar {
  width: 6px;
}
.terminal-output::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.2);
  border-radius: 3px;
}

.terminal-line {
  word-break: break-word;
}
.terminal-line.cyan { color: var(--accent-cyan); }
.terminal-line.green { color: var(--accent-green); }
.terminal-line.amber { color: var(--accent-amber); }
.terminal-line.red { color: var(--accent-red); font-weight: 700; }
.terminal-line.dim { color: var(--text-dim); }

/* Tactical Intel Hint Subsystem */
.hint-subsystem {
  padding: 8px 14px;
  box-sizing: border-box;
  background: rgba(12, 18, 26, 0.96);
  border-top: 1px solid rgba(0, 240, 255, 0.1);
  border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.hint-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 10px;
}

.hint-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hint-title {
  font-family: var(--font-title);
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  white-space: nowrap;
}

.hint-status-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-green);
  white-space: nowrap;
}

.hint-trigger-btn {
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.hint-trigger-btn:hover:not(:disabled) {
  background: var(--accent-cyan);
  color: #000;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.6);
}

.hint-trigger-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--text-dim);
  color: var(--text-dim);
}

.hint-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.hint-progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.2s linear;
}

/* Command Line Input Prompt */
.terminal-input-bar {
  display: flex;
  align-items: center;
  height: 48px;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 14px;
  background: #090e15;
  border-top: 1px solid rgba(0, 240, 255, 0.15);
  gap: 8px;
  width: 100%;
}

.prompt-user {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.term-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #ffffff;
  caret-color: var(--accent-green);
  text-overflow: ellipsis;
}

.term-send-btn {
  background: rgba(0, 255, 127, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.term-send-btn:hover {
  background: var(--accent-green);
  color: #000;
  box-shadow: 0 0 12px rgba(0, 255, 127, 0.6);
}

/* Terminal Shake Animation on Input Rejection */
.terminal-pane.shake {
  animation: term-shake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes term-shake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-5px, 0, 0); }
  40%, 60% { transform: translate3d(5px, 0, 0); }
}

/* Victory Overlay Card */
.victory-card {
  text-align: center;
  padding: 40px;
  max-width: 550px;
}

.victory-icon {
  font-size: 3.5rem;
  color: var(--accent-green);
  margin-bottom: 16px;
  text-shadow: 0 0 20px var(--accent-green);
}

.victory-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  letter-spacing: 2px;
  color: var(--text-highlight);
  margin-bottom: 10px;
}

.victory-subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.victory-stats {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--accent-cyan);
  margin-bottom: 28px;
  line-height: 1.6;
}

.restart-btn {
  background: var(--accent-green);
  color: #000;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 255, 127, 0.5);
  transition: all 0.2s ease;
}

.restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 255, 127, 0.8);
}
