@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;700&display=swap');

/* ================================================================
   ANZEE NEXUS OS — "STARK TACTILE" DESIGN SYSTEM
   Neo-Tactile depth + Iron Man dark steel palette
   NO holographic glass — solid dark steel with neumorphic depth
================================================================ */

:root {
  /* ── Iron Man Steel Palette ── */
  --iron-base:    #030c1a;     /* Deepest background */
  --iron-bg:      #060f1e;     /* Panel background (solid, NOT glass) */
  --iron-bg2:     #0a1828;     /* Elevated panel surface */
  --iron-bg3:     #0f2035;     /* Input/inset surface */
  --iron-border:  #0f2a40;     /* Structural border */

  /* ── Arc Reactor Colors ── */
  --arc:          #00b8d9;     /* Primary blue (same as Iron Man HUD) */
  --arc-hot:      #40d8f8;     /* Bright/highlight */
  --arc-dim:      #005070;     /* Muted/inactive */
  --arc-orange:   #ff6b35;     /* Iron Man suit accent */
  --arc-red:      #ff2244;     /* Danger / Stark warning */

  /* ── Text ── */
  --text-hi:      #a8d8f0;     /* High contrast */
  --text-mid:     #4a7a9b;     /* Secondary */
  --text-lo:      #1a3a55;     /* Dim labels */

  /* ── Stark Tactile Shadows (dark neumorphic, NOT white) ── */
  --shadow-out:   5px 5px 14px rgba(0,0,0,0.85),
                 -2px -2px 8px rgba(0,120,200,0.06);
  --shadow-in:    inset 4px 4px 10px rgba(0,0,0,0.85),
                  inset -2px -2px 6px rgba(0,100,180,0.06);
  --shadow-glow:  0 0 18px rgba(0,184,217,0.35);
  --shadow-card:  0 4px 24px rgba(0,0,0,0.8), 0 1px 0 rgba(0,120,200,0.1);

  /* ── Element Radii ── */
  --r-pill:  50px;
  --r-card:  14px;
  --r-inner: 8px;
  --r-btn:   50px;
}

/* ================================================================
   RESET + BASE
================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--iron-base);
  color: var(--text-hi);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  height: 100vh; width: 100vw;
  -webkit-font-smoothing: antialiased;
}

/* ================================================================
   IRON MAN BACKGROUND LAYERS
================================================================ */

/* Deep grid floor */
#bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,184,217,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,184,217,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 0%, transparent 100%);
}

/* Hex grid overlay */
.hex-grid {
  position: fixed; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='104'%3E%3Cpath d='M30 0 L60 17.3 L60 86.6 L30 104 L0 86.6 L0 17.3Z' fill='none' stroke='rgba(0,184,217,0.05)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 104px;
}

/* JARVIS scanning sweep line */
@keyframes scan-sweep {
  0%   { top: -1px; opacity: 1; }
  90%  { opacity: 0.15; }
  100% { top: 100vh; opacity: 0; }
}
.scan-line {
  position: fixed; left: 0; width: 100%; height: 1px;
  z-index: 9999; pointer-events: none;
  background: linear-gradient(90deg,
    transparent 0%, rgba(0,184,217,0.2) 15%,
    var(--arc) 50%, var(--arc-hot) 60%,
    rgba(0,184,217,0.2) 85%, transparent 100%);
  box-shadow: 0 0 20px var(--arc), 0 0 6px var(--arc-hot);
  animation: scan-sweep 8s linear infinite;
}

/* ================================================================
   ARC REACTOR RING ANIMATIONS
================================================================ */
@keyframes arc-spin  { to { transform: rotate(360deg); } }
@keyframes arc-rspin { to { transform: rotate(-360deg); } }
@keyframes arc-pulse {
  0%,100% { opacity: .5; }
  50%      { opacity: 1; }
}
@keyframes stark-flicker {
  0%,100% { opacity:1; } 92% { opacity:1; } 93% { opacity:.4; }
  96% { opacity:1; } 98% { opacity:.7; } 99% { opacity:1; }
}

.arc-ring {
  border-radius: 50%; border-style: solid; position: absolute;
  animation: arc-spin linear infinite;
}
.arc-ring.reverse { animation-name: arc-rspin; }
.arc-glow { animation: arc-pulse 2.5s ease-in-out infinite; }
.stark-flicker { animation: stark-flicker 9s ease-in-out infinite; }

/* ================================================================
   STARK TACTILE PANELS  (solid steel, NOT glass)
================================================================ */
.tech-panel {
  background: var(--iron-bg);
  border: 1px solid var(--iron-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.tech-panel:hover {
  border-color: var(--arc-dim);
  box-shadow: var(--shadow-card), 0 0 20px rgba(0,184,217,0.08);
}

/* Top accent line */
.tech-panel::before {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--arc), transparent);
  opacity: .5;
}

/* Top-left corner bracket */
.tech-panel::after {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 12px; height: 12px;
  border-top: 1.5px solid var(--arc);
  border-left: 1.5px solid var(--arc);
  opacity: .7;
}

/* ================================================================
   STARK TACTILE BUTTONS  ← Neo-Tactile pillshape, Iron Man colors
================================================================ */

/* ── Default button ── */
.hud-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: var(--r-btn);
  background: var(--iron-bg2);
  border: 1px solid var(--iron-border);
  box-shadow: var(--shadow-out);
  color: var(--text-mid);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
  position: relative; overflow: hidden;
}

/* Hover → elevates, blue tint, brighter text */
.hud-btn:hover {
  background: var(--iron-bg3);
  border-color: var(--arc-dim);
  color: var(--arc);
  box-shadow: var(--shadow-out), 0 0 12px rgba(0,184,217,0.2);
  transform: translateY(-1px);
}

/* Press → depresses (neumorphic inset) */
.hud-btn:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-in);
  color: var(--arc-hot);
}

/* ── Primary / Active button (arc reactor filled) ── */
.hud-btn.primary, .hud-btn.active-btn {
  background: linear-gradient(135deg, #082840, #0d3555);
  border-color: var(--arc-dim);
  color: var(--arc);
  box-shadow: var(--shadow-glow), var(--shadow-out);
}
.hud-btn.primary:hover {
  background: linear-gradient(135deg, #0a3050, #1040680);
  color: var(--arc-hot);
  box-shadow: 0 0 28px rgba(0,184,217,0.45), var(--shadow-out);
}

/* ── Danger button ── */
.hud-btn.danger {
  background: #0f0a10;
  border-color: rgba(255,34,68,0.2);
  color: rgba(255,80,100,0.7);
}
.hud-btn.danger:hover {
  border-color: var(--arc-red);
  color: var(--arc-red);
  box-shadow: 0 0 14px rgba(255,34,68,0.3), var(--shadow-out);
}

/* ── Active / focused element ── */
.active-element {
  border-color: var(--arc) !important;
  box-shadow: var(--shadow-glow), var(--shadow-out) !important;
  color: var(--arc-hot) !important;
}

/* ================================================================
   DOCK BUTTONS (Iron Man circular taskbar icons)
================================================================ */
.dock-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--iron-bg2);
  border: 1px solid var(--iron-border);
  box-shadow: var(--shadow-out);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px;
  transition: all 0.18s ease;
  position: relative;
  text-decoration: none; color: var(--text-mid);
}
/* Inner ring detail */
.dock-btn::before {
  content: ''; position: absolute; inset: 4px;
  border-radius: 50%; border: 1px solid rgba(0,184,217,0.06);
}
.dock-btn:hover {
  border-color: var(--arc-dim);
  color: var(--arc);
  box-shadow: var(--shadow-glow), var(--shadow-out);
  transform: translateY(-2px);
}
.dock-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-in);
}
.dock-btn .tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--iron-bg2); border: 1px solid var(--iron-border);
  color: var(--arc); font-size: 7px; font-family: 'JetBrains Mono', monospace;
  padding: 3px 10px; white-space: nowrap;
  border-radius: var(--r-pill); opacity: 0; pointer-events: none;
  transition: opacity .15s; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: var(--shadow-out);
}
.dock-btn:hover .tooltip { opacity: 1; }

/* ================================================================
   HUD WINDOW TILES (Iron Man data panels)
================================================================ */
#nexus-viewport {
  position: fixed; inset: 0; overflow: hidden; z-index: 1;
}
#nexus-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  transform-origin: 0 0; will-change: transform;
}
#grid-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.nexus-window {
  transition: box-shadow .25s, border-color .25s, opacity .35s;
  user-select: none; min-width: 200px; min-height: 100px;
}
.win-header {
  background: linear-gradient(90deg, rgba(0,184,217,0.07) 0%, rgba(0,30,60,0.08) 100%);
  border-bottom: 1px solid var(--iron-border);
  cursor: move; padding: 7px 10px;
}
.win-content { background: rgba(3,8,22,0.6); }
.win-resize {
  position: absolute; bottom: 0; right: 0;
  width: 14px; height: 14px; cursor: nwse-resize; opacity: .25;
  transition: opacity .2s;
}
.win-resize:hover { opacity: 1; }
/* Bottom-right corner bracket */
.nexus-window .corner-br {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-bottom: 1.5px solid var(--arc); border-right: 1.5px solid var(--arc);
  opacity: .5;
}

/* ================================================================
   RADIAL HUD METERS (Stark Tactile style)
================================================================ */
.hud-meter {
  --v: 0;
  width: 44px; height: 44px; border-radius: 50%;
  background: conic-gradient(var(--arc) calc(var(--v) * 1%), var(--iron-bg3) 0);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-out), 0 0 10px rgba(0,184,217,0.15);
  position: relative;
}
.hud-meter::before {
  content: ''; position: absolute; inset: 7px;
  background: var(--iron-bg); border-radius: 50%;
  box-shadow: var(--shadow-in);
}
.hud-meter span { font-size: 8px; font-weight: 700; position: relative; z-index:1; color: var(--arc); }

/* ================================================================
   STATUS INDICATORS
================================================================ */
.status-indicator {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  animation: arc-pulse 2s ease-in-out infinite;
}
.status-online  { background: #00e676; box-shadow: 0 0 8px #00e676; }
.status-offline { background: var(--arc-red); box-shadow: 0 0 8px var(--arc-red); }
.status-pending { background: #ffb300; box-shadow: 0 0 8px #ffb300; }

/* ================================================================
   NEO-TACTILE TOGGLE SWITCH (Iron Man plasma style)
================================================================ */
.hud-toggle { position: relative; display: inline-block; width: 44px; height: 22px; }
.hud-toggle input { opacity: 0; width: 0; height: 0; }
.hud-toggle .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--iron-bg3); border: 1px solid var(--iron-border);
  border-radius: 22px; box-shadow: var(--shadow-in); transition: .25s;
}
.hud-toggle .slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; left: 3px; bottom: 3px;
  background: var(--arc-dim); border-radius: 50%;
  box-shadow: var(--shadow-out); transition: .25s;
}
.hud-toggle input:checked + .slider {
  background: #07253d; border-color: var(--arc-dim);
  box-shadow: var(--shadow-in), 0 0 12px rgba(0,184,217,0.2);
}
.hud-toggle input:checked + .slider::before {
  transform: translateX(22px);
  background: var(--arc); box-shadow: 0 0 10px var(--arc), var(--shadow-out);
}

/* ================================================================
   INPUT FIELDS (Stark Tactile inset)
================================================================ */
.hud-input {
  width: 100%;
  background: var(--iron-bg3);
  border: 1px solid var(--iron-border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-in);
  color: var(--text-hi);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; padding: 8px 16px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.hud-input:focus {
  border-color: var(--arc-dim);
  box-shadow: var(--shadow-in), 0 0 16px rgba(0,184,217,0.15);
  color: var(--arc-hot);
}
.hud-input::placeholder { color: var(--text-lo); }

/* ================================================================
   SCROLLBAR
================================================================ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--arc-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--arc); }

/* ================================================================
   TOOLTIP (pill shape, Stark colors)
================================================================ */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--iron-bg2); border: 1px solid var(--iron-border);
  color: var(--arc); font-size: 8px; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 12px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: all .12s; border-radius: var(--r-pill);
  box-shadow: var(--shadow-out);
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* ================================================================
   DATA STREAM / SCAN ANIMATION
================================================================ */
@keyframes data-stream { to { background-position: 0 80px; } }
.data-stream {
  background-image: repeating-linear-gradient(
    180deg, transparent 0, transparent 7px,
    rgba(0,184,217,0.03) 7, rgba(0,184,217,0.03) 8px
  );
  animation: data-stream 3s linear infinite;
}

/* ================================================================
   RIPPLE (Stark Tactile interaction feedback)
================================================================ */
@keyframes ripple { to { transform: scale(5); opacity: 0; } }
.ripple-effect {
  position: absolute; border-radius: 50%;
  width: 8px; height: 8px; margin: -4px;
  background: rgba(0,184,217,0.35);
  animation: ripple .5s ease-out forwards;
  pointer-events: none;
}

/* ================================================================
   SCROLLING TICKER (Stark Industries data bar)
================================================================ */
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.stark-ticker {
  display: inline-block;
  animation: ticker 22s linear infinite;
  font-size: 8px; color: var(--text-lo);
  letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap;
}

/* ================================================================
   FONT HELPERS
================================================================ */
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* Code block */
.code-block {
  background: var(--iron-bg3);
  border-left: 2px solid var(--arc-dim);
  border-radius: 0 var(--r-inner) var(--r-inner) 0;
  padding: 10px 14px; font-size: 11px; margin-top: 8px;
  box-shadow: var(--shadow-in);
}

/* Corner bracket decoration */
.corner-br {
  position: absolute; bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-bottom: 1.5px solid var(--arc);
  border-right:  1.5px solid var(--arc);
  opacity: .5;
}
