/* ======================================================
   CORE-GUARDIAN SCIENTIFIC UI — ENHANCED & SCROLLABLE
====================================================== */

/* ---------- THEME VARIABLES ---------- */
:root {
  --bg-deep: #05070f;
  --bg-panel: rgba(14, 18, 38, 0.85);
  --bg-glass: rgba(20, 26, 56, 0.6);

  --neon-cyan: #4fdfff;
  --neon-blue: #00f2ff;
  --neon-green: #39ff14;
  --neon-yellow: #ffd166;
  --neon-red: #ff3131;

  --text-main: #e6ebff;
  --text-dim: #9aa4c7;

  --border-soft: 1px solid rgba(90, 120, 255, 0.18);
  --border-strong: 1px solid rgba(90, 160, 255, 0.4);

  --font-ui: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;
}

/* ---------- GLOBAL FIX (SCROLL ENABLED) ---------- */
html, body {
  height: auto;
  min-height: 100%;
  margin: 0;
  font-family: var(--font-ui);
  background: radial-gradient(circle at top, #0b0f2a 0%, var(--bg-deep) 70%);
  color: var(--text-main);
  overflow-y: auto;
}

/* ---------- MAIN LAYOUT ---------- */
.cyber-container {
  display: flex;
  min-height: 100vh;
  overflow-y: auto;
}

/* ---------- SIDEBAR ---------- */
.sidebar-scientific {
  width: 300px;
  background: linear-gradient(180deg, #05060f 0%, #0a0e24 100%);
  border-right: 2px solid #1e264a;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-scientific h2 {
  font-size: 1rem;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  color: var(--neon-cyan);
}

/* ---------- NAV BUTTONS ---------- */
.tab-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-btn {
  background: #0d1127;
  border: var(--border-soft);
  color: var(--text-dim);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  transition: all 0.25s ease;
}

.nav-btn:hover {
  background: #151b3d;
  color: white;
}

.nav-btn.active {
  background: #161b3d;
  border-left: 4px solid var(--neon-blue);
  color: white;
  box-shadow: inset 0 0 12px rgba(0, 242, 255, 0.15);
}

/* ---------- MAIN DASHBOARD ---------- */
.dashboard-viewport {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- TAB CONTENT ---------- */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- METRIC CARDS ---------- */
.sci-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.sci-card {
  background: var(--bg-panel);
  border: var(--border-soft);
  padding: 22px;
  border-top: 3px solid var(--neon-blue);
  border-radius: 6px;
  backdrop-filter: blur(6px);
}

.sci-card h4 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.value {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: bold;
  color: white;
}

/* ---------- GRAPH / VISUALIZER ---------- */
.primary-visualizer {
  background: var(--bg-panel);
  min-height: 380px;
  padding: 20px;
  border: var(--border-soft);
  border-radius: 6px;
}

/* ---------- SLIDERS ---------- */
input[type="range"] {
  width: 100%;
  accent-color: var(--neon-blue);
}

/* ---------- SCRAM BUTTON ---------- */
.scram-button-glow {
  width: 100%;
  padding: 18px;
  margin-top: 15px;
  background: transparent;
  border: 2px solid var(--neon-red);
  color: var(--neon-red);
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(255, 49, 49, 0.6);
  transition: all 0.25s ease;
}

.scram-button-glow:hover {
  background: rgba(255, 49, 49, 0.1);
  box-shadow: 0 0 20px rgba(255, 49, 49, 0.9);
}

/* ---------- AI CO-PILOT PANEL ---------- */
.ai-copilot-footer {
  margin-top: 25px;
  padding: 18px 20px;
  background: linear-gradient(
    90deg,
    rgba(0, 242, 255, 0.08) 0%,
    rgba(7, 8, 20, 1) 100%
  );
  border-left: 4px solid var(--neon-blue);
  border-radius: 4px;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.ai-status-light {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--neon-blue);
  box-shadow: 0 0 12px var(--neon-blue);
}

.ai-header h3 {
  font-size: 0.75rem;
  margin: 0;
  color: var(--neon-blue);
  letter-spacing: 1.5px;
}

.ai-text-output {
    font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;              /* 👈 FIX vertical spacing */
  letter-spacing: 0.6px;         /* 👈 FIX horizontal spacing */
  word-spacing: 2px;             /* 👈 FIX word separation */
  color: var(--neon-green);
  white-space: pre-wrap;   
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .cyber-container {
    flex-direction: column;
  }

  .sidebar-scientific {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
  }
}


/* ===== EMERGENCY LOCKDOWN POPUP ===== */
#emergencyPopup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.emergency-box {
  background: #120202;
  border: 2px solid #ff3131;
  padding: 30px 40px;
  width: 420px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.8);
  animation: pulseRed 1.5s infinite;
}

.emergency-box h2 {
  color: #ff3131;
  margin-bottom: 15px;
}

.call-log p {
  font-family: var(--font-mono);
  margin: 6px 0;
}

.ok {
  color: #39ff14;
  font-weight: bold;
}

.footer-note {
  margin-top: 15px;
  font-size: 0.8rem;
  color: #ffd166;
}

@keyframes pulseRed {
  0% { box-shadow: 0 0 20px rgba(255, 49, 49, 0.6); }
  50% { box-shadow: 0 0 45px rgba(255, 49, 49, 1); }
  100% { box-shadow: 0 0 20px rgba(255, 49, 49, 0.6); }
}

/* ======================================================
   PROFESSIONAL EMERGENCY OVERLAY (CSS OVERRIDE ONLY)
   Paste at END of style.css
====================================================== */

/* Darken & calm the background */
#emergencyPopup {
  background: rgba(6, 8, 18, 0.94) !important;
  backdrop-filter: blur(6px);
}

/* Main emergency container */
#emergencyPopup .emergency-box,
#emergencyPopup .emergency-box-pro {
  background: linear-gradient(180deg, #0b0e1c 0%, #05070f 100%) !important;
  border: 1px solid rgba(255, 90, 90, 0.35) !important;
  box-shadow:
    0 0 0 1px rgba(255, 90, 90, 0.12),
    0 25px 80px rgba(0, 0, 0, 0.95) !important;
  animation: none !important; /* remove childish pulsing */
  font-family: var(--font-mono);
}

/* Title styling */
#emergencyPopup h2 {
  color: #ff6b6b !important;
  font-size: 0.9rem !important;
  letter-spacing: 2px !important;
  font-weight: 600;
  text-transform: uppercase;
}

/* Remove emoji influence visually */
#emergencyPopup h2::before,
#emergencyPopup p::before {
  display: none !important;
}

/* Body text */
#emergencyPopup p {
  color: #d6dcff !important;
  font-size: 0.85rem !important;
  line-height: 1.6 !important;
}

/* Emergency service log section */
#emergencyPopup .call-log,
#emergencyPopup .dispatch-log {
  margin-top: 18px;
  background: rgba(12, 16, 40, 0.7);
  border: 1px solid rgba(120, 140, 255, 0.18);
}

/* Individual rows */
#emergencyPopup .call-log p,
#emergencyPopup .dispatch-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(120, 140, 255, 0.12);
}

#emergencyPopup .call-log p:last-child,
#emergencyPopup .dispatch-row:last-child {
  border-bottom: none;
}

/* CONFIRMED status — calm, not neon */
#emergencyPopup .ok,
#emergencyPopup .confirmed {
  color: #7dff9c !important;
  font-weight: 500;
  letter-spacing: 1px;
}

/* Footer note */
#emergencyPopup .footer-note {
  font-size: 0.72rem;
  color: #aab1ff !important;
  opacity: 0.85;
  margin-top: 16px;
}

/* Remove bright red glow everywhere */
#emergencyPopup * {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* =========================================
   DEMO EMERGENCY DISPATCH OVERLAY
========================================= */

#dispatchDemoOverlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(6px);
}

.dispatch-demo-box {
  width: 480px;
  background: linear-gradient(180deg, #0b0e1c 0%, #05070f 100%);
  border: 1px solid rgba(255, 90, 90, 0.35);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95);
  padding: 26px;
  font-family: monospace;
}

.dispatch-demo-title {
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #ff6b6b;
  margin-bottom: 18px;
  text-align: center;
}

.dispatch-demo-log {
  border: 1px solid rgba(120, 140, 255, 0.18);
  background: rgba(12, 16, 40, 0.7);
}

.dispatch-demo-log div {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.75rem;
  border-bottom: 1px solid rgba(120, 140, 255, 0.12);
}

.dispatch-demo-log div:last-child {
  border-bottom: none;
}

.dispatch-demo-log .ok {
  color: #7dff9c;
  letter-spacing: 1px;
}

.dispatch-demo-note {
  margin-top: 16px;
  font-size: 0.72rem;
  color: #aab1ff;
  text-align: center;
  opacity: 0.9;
}
