/* ==========================================================================
   XOBIX METROLOGY - CORE FUTURISTIC STYLING
   Precision Custom Metrology Machines (USA)
   ========================================================================== */

:root {
  --bg-deep: #030712;
  --bg-void: #010409;
  --bg-surface: #070d1e;
  --bg-card: rgba(8, 16, 36, 0.72);
  --bg-card-hover: rgba(14, 28, 64, 0.85);
  
  --cyan-laser: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.45);
  --cyan-subtle: rgba(0, 240, 255, 0.12);
  --blue-neon: #0077ff;
  --blue-electric: #2563eb;
  --blue-cobalt: #1e40af;
  --blue-plasma: #38bdf8;
  
  --hud-green: #10b981;
  --hud-amber: #f59e0b;
  --hud-crimson: #ef4444;

  --border-subtle: rgba(0, 240, 255, 0.18);
  --border-bright: rgba(0, 240, 255, 0.55);

  --font-display: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan-laser), var(--blue-neon));
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-laser);
  box-shadow: 0 0 10px var(--cyan-laser);
}

/* Base resets & typography */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  background-color: var(--bg-deep);
  color: #e2e8f0;
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
  selection-background-color: var(--cyan-laser);
  selection-color: var(--bg-deep);
}

::selection {
  background: var(--cyan-laser);
  color: #030712;
}

/* Typography Helpers */
.font-display { font-family: var(--font-display); }
.font-heading { font-family: var(--font-heading); }
.font-mono { font-family: var(--font-mono); }

/* Futuristic Grid Background Texture */
.bg-metrology-grid {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
}

.bg-metrology-dots {
  background-image: radial-gradient(rgba(0, 240, 255, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Neon Glows & Gradients */
.glow-cyan {
  text-shadow: 0 0 10px var(--cyan-glow), 0 0 20px rgba(0, 240, 255, 0.3);
}

.glow-blue {
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.box-glow-cyan {
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.25), inset 0 0 15px rgba(0, 240, 255, 0.08);
}

.box-glow-cyan-sm {
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.box-glow-intense {
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.4), 0 0 80px rgba(0, 119, 255, 0.25);
}

/* Glassmorphism Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  position: relative;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-panel:hover {
  border-color: var(--border-bright);
  box-shadow: 0 10px 30px rgba(0, 240, 255, 0.12);
}

/* Metrology Corner Brackets (HUD style) */
.hud-corner {
  position: relative;
}
.hud-corner::before,
.hud-corner::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--cyan-laser);
  pointer-events: none;
  transition: all 0.3s ease;
}
.hud-corner::before {
  top: 0;
  left: 0;
  border-top: 2px solid var(--cyan-laser);
  border-left: 2px solid var(--cyan-laser);
}
.hud-corner::after {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid var(--cyan-laser);
  border-right: 2px solid var(--cyan-laser);
}
.hud-corner:hover::before,
.hud-corner:hover::after {
  width: 14px;
  height: 14px;
  box-shadow: 0 0 8px var(--cyan-laser);
}

/* Full four corner brackets */
.hud-frame {
  position: relative;
}
.hud-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 240, 255, 0.15);
  pointer-events: none;
}
.corner-tl, .corner-tr, .corner-bl, .corner-br {
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  border-color: var(--cyan-laser);
}
.corner-tl { top: 0; left: 0; border-top: 2px solid var(--cyan-laser); border-left: 2px solid var(--cyan-laser); }
.corner-tr { top: 0; right: 0; border-top: 2px solid var(--cyan-laser); border-right: 2px solid var(--cyan-laser); }
.corner-bl { bottom: 0; left: 0; border-bottom: 2px solid var(--cyan-laser); border-left: 2px solid var(--cyan-laser); }
.corner-br { bottom: 0; right: 0; border-bottom: 2px solid var(--cyan-laser); border-right: 2px solid var(--cyan-laser); }

/* Scanning Laser Animation line */
.scan-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-laser), #ffffff, var(--cyan-laser), transparent);
  box-shadow: 0 0 15px var(--cyan-laser), 0 0 30px var(--cyan-laser);
  animation: laserScan 3.5s ease-in-out infinite alternate;
  pointer-events: none;
  opacity: 0.85;
}

@keyframes laserScan {
  0% { top: 5%; opacity: 0.2; }
  25% { opacity: 0.9; }
  75% { opacity: 0.9; }
  100% { top: 92%; opacity: 0.2; }
}

/* Pulse Beacon */
.status-beacon {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--cyan-laser);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan-laser);
}
.status-beacon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--cyan-laser);
  animation: beaconPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes beaconPulse {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Futuristic Buttons */
.btn-futuristic {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #030712;
  background: linear-gradient(135deg, #00f0ff 0%, #00a2ff 100%);
  border: none;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}

.btn-futuristic::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: 0.5s;
}

.btn-futuristic:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.65), 0 0 15px #00f0ff;
  filter: brightness(1.1);
}

.btn-futuristic:hover::before {
  left: 100%;
}

.btn-secondary-futuristic {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-laser);
  background: rgba(8, 20, 48, 0.6);
  border: 1px solid var(--border-bright);
  backdrop-filter: blur(10px);
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary-futuristic:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-laser);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35);
  transform: translateY(-2px);
  color: #ffffff;
}

/* HUD Metric Badges */
.hud-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--cyan-laser);
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Animated Gradient Text */
.text-gradient-fluid {
  background: linear-gradient(135deg, #ffffff 10%, #60a5fa 45%, #00f0ff 85%, #0077ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-cyan {
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 50%, #1e40af 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Circular Reticle Radar Animation */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spinSlow 20s linear infinite;
}

@keyframes reverseSpin {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
.animate-spin-reverse {
  animation: reverseSpin 15s linear infinite;
}

/* Floating animation */
@keyframes floatGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
.animate-float {
  animation: floatGentle 5s ease-in-out infinite;
}

/* Heatmap tolerance indicators */
.heat-nominal { background-color: #10b981; }
.heat-warn { background-color: #3b82f6; }
.heat-critical { background-color: #ef4444; }

/* Interactive Range Slider (Cybernetic style) */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(0, 240, 255, 0.15);
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background: var(--cyan-laser);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-laser);
  border: 2px solid #030712;
  transition: transform 0.15s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
