/* ══════════════════════════════════════════════════════════════════
   Smart Scan EW — Premium Enterprise Light-Theme Design System
   UI/UX Redesign: Commercial Electronic Intelligence Platform
   Team HORIZON — SIH26055
   ══════════════════════════════════════════════════════════════════ */

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

:root {
  /* Enterprise Light Color System */
  --bg-app: #F6F9FC;
  --surface-main: #FFFFFF;
  --surface-secondary: #F8FBFD;
  --surface-tertiary: #F1F5F9;
  --border-subtle: #DCE7EF;
  --border-focus: #2684FF;
  
  /* Typography Colors */
  --text-primary: #102A43;
  --text-secondary: #627D98;
  --text-muted: #829AB1;
  
  /* Semantic Enterprise Accents */
  --accent-green: #00B894;
  --accent-green-light: #E6FBF5;
  --accent-green-border: #A3E9D7;
  
  --accent-cyan: #00A8CC;
  --accent-cyan-light: #E6F7FA;
  --accent-cyan-border: #99E2F0;
  
  --accent-blue: #2684FF;
  --accent-blue-light: #EBF3FF;
  --accent-blue-border: #B8D7FF;
  
  --accent-yellow: #F5B700;
  --accent-yellow-light: #FEF9E6;
  --accent-yellow-border: #FCE599;
  
  --accent-orange: #FF8A00;
  --accent-orange-light: #FFF4E6;
  --accent-orange-border: #FFD499;
  
  --accent-red: #E63946;
  --accent-red-light: #FDEDEE;
  --accent-red-border: #F7B0B5;
  
  --accent-purple: #7C4DFF;
  --accent-purple-light: #F2EDFF;
  --accent-purple-border: #CAB8FF;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 42, 67, 0.04);
  --shadow-sm: 0 1px 3px rgba(16, 42, 67, 0.06), 0 1px 2px rgba(16, 42, 67, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(16, 42, 67, 0.07), 0 2px 4px -1px rgba(16, 42, 67, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(16, 42, 67, 0.08), 0 4px 6px -2px rgba(16, 42, 67, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(16, 42, 67, 0.12), 0 10px 10px -5px rgba(16, 42, 67, 0.04);
  
  /* Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
}

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-app);
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography & Helpers ── */
.mono {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-feature-settings: "tnum";
}

.accent-mint { color: var(--accent-green) !important; }
.accent-gold { color: var(--accent-yellow) !important; }
.accent-crimson { color: var(--accent-red) !important; }
.accent-cyan { color: var(--accent-cyan) !important; }

/* ── Enterprise Clean Card ── */
.glass-card {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  border-color: #CBD5E1;
  box-shadow: var(--shadow-md);
}

/* ══════════════════════════════════════════════
   ENTERPRISE NAVBAR / HEADER
   ══════════════════════════════════════════════ */
.glass-navbar {
  background: var(--surface-main);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  position: sticky; top: 0; z-index: 100;
}

.navbar-inner {
  max-width: 1920px; margin: 0 auto;
  padding: 10px 24px;
  display: flex; align-items: center; justify-content: space-between;
}

.navbar-brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
  width: 38px; height: 38px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, #102A43, #243B53);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(16, 42, 67, 0.15);
}

.brand-icon svg {
  stroke: #FFFFFF;
}

.brand-text h1 {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; line-height: 1.2;
}

.brand-badge {
  font-size: 9.5px; font-weight: 700;
  background: var(--accent-blue-light);
  border: 1px solid var(--accent-blue-border);
  color: var(--accent-blue);
  padding: 2px 7px; border-radius: var(--radius-full);
  letter-spacing: 0.06em;
}

.brand-text p {
  font-size: 11px; color: var(--text-secondary);
  letter-spacing: 0.02em; margin-top: 1px;
}

.navbar-right { display: flex; align-items: center; gap: 12px; }

.btn-nav-action {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  font-family: inherit;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.btn-nav-action:hover {
  background: var(--surface-secondary);
  border-color: #CBD5E1;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.btn-nav-action.active {
  background: var(--accent-green-light);
  border-color: var(--accent-green-border);
  color: #065F46;
}

/* Status Badges */
.status-badge {
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  border: 1px solid;
}

.status-badge.idle {
  background: var(--surface-tertiary);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}

.status-badge.scanning {
  background: var(--accent-green-light);
  border-color: var(--accent-green-border);
  color: #047857;
}

.status-badge.paused {
  background: var(--accent-yellow-light);
  border-color: var(--accent-yellow-border);
  color: #B45309;
}

.status-dot { width: 6.5px; height: 6.5px; border-radius: 50%; }
.idle .status-dot { background: var(--text-muted); }
.scanning .status-dot {
  background: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
}
.paused .status-dot {
  background: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.2);
}

/* ══════════════════════════════════════════════
   ENTERPRISE CONTROL BAR
   ══════════════════════════════════════════════ */
.control-bar { padding: 12px 24px 6px; }

.control-inner {
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

.controls-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.control-divider {
  width: 1px; height: 24px; background: var(--border-subtle); margin: 0 4px;
}

/* Control Buttons */
.btn-control {
  padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.btn-start {
  color: #FFFFFF;
  background: var(--accent-blue);
  border-color: #1A73E8;
}
.btn-start:hover {
  background: #1A73E8;
  box-shadow: 0 2px 6px rgba(38, 132, 255, 0.35);
}

.btn-stop {
  color: #FFFFFF;
  background: var(--accent-red);
  border-color: #D32F2F;
}
.btn-stop:hover {
  background: #D32F2F;
  box-shadow: 0 2px 6px rgba(230, 57, 70, 0.35);
}

.btn-secondary {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-secondary);
  border-color: #CBD5E1;
}
.btn-secondary:disabled {
  opacity: 0.45; cursor: not-allowed;
  background: var(--surface-tertiary);
  border-color: var(--border-subtle);
}

/* Speed Selector */
.speed-selector {
  display: flex; border-radius: var(--radius-sm);
  background: var(--surface-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 2px;
}

.speed-chip {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  background: transparent; color: var(--text-secondary);
  border: none; border-radius: 4px; cursor: pointer;
  transition: all 0.15s ease;
}

.speed-chip:hover:not(.active) {
  color: var(--text-primary);
}

.speed-chip.active {
  background: var(--surface-main);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

/* Tactical Select Dropdowns */
.tactical-select {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px; font-weight: 600;
  font-family: inherit;
  color: var(--text-primary);
  outline: none; cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tactical-select:hover {
  border-color: #CBD5E1;
}

.tactical-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(38, 132, 255, 0.15);
}

.tactical-select option {
  background: var(--surface-main);
  color: var(--text-primary);
  padding: 6px;
}

/* ══════════════════════════════════════════════
   MAIN WORKSPACE LAYOUT
   ══════════════════════════════════════════════ */
.main-workspace {
  display: flex;
  gap: 16px;
  padding: 8px 24px;
  height: calc(100vh - 215px);
  min-height: 480px;
}

/* Waterfall Column */
.waterfall-panel {
  flex: 1.75;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

/* Side Column */
.side-panel {
  flex: 1.25;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gnn-panel {
  flex: 1.35;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

.logs-panel {
  flex: 0.85;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  min-height: 140px;
}

/* Panel Headers */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}

.panel-header h2 {
  font-size: 13px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: -0.01em;
}

.diamond { color: var(--accent-blue); font-size: 11px; }

.panel-actions { display: flex; align-items: center; gap: 6px; }

.legend-pill {
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent;
}

.legend-dot {
  width: 6px; height: 6px; border-radius: 50%;
}

.dot-red { background: var(--accent-red); }
.dot-green { background: var(--accent-green); }
.dot-yellow { background: var(--accent-yellow); }

.legend-pill.threat {
  background: var(--accent-red-light);
  border-color: var(--accent-red-border);
  color: #991B1B;
}

.legend-pill.tuner {
  background: var(--accent-green-light);
  border-color: var(--accent-green-border);
  color: #065F46;
}

.legend-pill.lock {
  background: var(--accent-yellow-light);
  border-color: var(--accent-yellow-border);
  color: #92400E;
}

/* Canvas Wrappers */
.canvas-wrapper {
  flex: 1; position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #09131D; /* Clean analytical dark scope frame for spectrogram */
}

.canvas-wrapper canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* GNN Specific Wrapper - Light Enterprise Surface */
#gnn-wrapper {
  background: var(--surface-secondary);
  background-image: radial-gradient(#DCE7EF 1px, transparent 1px);
  background-size: 16px 16px;
}

/* ══════════════════════════════════════════════
   INTERACTIVE NODE INSPECTOR HUD
   ══════════════════════════════════════════════ */
.node-inspector {
  position: absolute; bottom: 12px; right: 12px; z-index: 10;
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  box-shadow: var(--shadow-lg);
  pointer-events: none; opacity: 0; transition: opacity 0.15s ease;
  min-width: 200px;
}

.node-inspector.visible { opacity: 1; pointer-events: auto; }

.inspector-title {
  color: var(--text-primary); font-weight: 700;
  margin-bottom: 6px; border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px; font-size: 11.5px;
}

.inspector-row {
  display: flex; justify-content: space-between; gap: 16px;
  margin: 4px 0; color: var(--text-secondary);
}

.inspector-row span:last-child {
  color: var(--text-primary); font-weight: 600;
}

/* ══════════════════════════════════════════════
   THREAT INTELLIGENCE LOGS FEED
   ══════════════════════════════════════════════ */
.logs-container {
  flex: 1; overflow-y: auto;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  display: flex; flex-direction: column; gap: 5px; padding-right: 4px;
}

.log-entry {
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--surface-secondary);
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  line-height: 1.4; color: var(--text-primary);
}

.log-entry.threat {
  border-left-color: var(--accent-red);
  background: var(--accent-red-light);
  color: #7F1D1D;
}

.log-entry.lock {
  border-left-color: var(--accent-green);
  background: var(--accent-green-light);
  color: #065F46;
}

.log-entry.ai {
  border-left-color: var(--accent-blue);
  background: var(--accent-blue-light);
  color: #1E40AF;
}

.log-time {
  color: var(--text-muted); margin-right: 6px; font-weight: 500;
}

/* ══════════════════════════════════════════════
   METRICS STRIP (5 High-Visibility Cards)
   ══════════════════════════════════════════════ */
.metrics-strip { padding: 6px 24px 16px; }

.metrics-inner {
  padding: 12px 20px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}

.metric-item { display: flex; align-items: center; gap: 12px; }

.mini-ring { width: 40px; height: 40px; position: relative; flex-shrink: 0; }
.mini-ring svg { transform: rotate(-90deg); }
.mini-ring .track { stroke: #E2E8F0; fill: none; }
.mini-ring .fill { fill: none; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }

.metric-icon-box {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--surface-secondary);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.metric-icon-box svg {
  stroke: var(--text-secondary);
}

.metric-val-group { display: flex; flex-direction: column; }

.metric-val {
  font-size: 20px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; line-height: 1.15;
  color: var(--text-primary);
}

.metric-val.mint { color: #047857; }
.metric-val.lime { color: #00A8CC; }
.metric-val.gold { color: #B45309; }
.metric-val.cyan { color: #0084A3; }
.metric-val.white { color: var(--text-primary); }

.metric-lbl {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-secondary); font-weight: 600;
  margin-top: 2px;
}

/* ══════════════════════════════════════════════
   PRESENTATION / PITCH DECK MODAL
   ══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(16, 42, 67, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; z-index: 1000;
  padding: 24px;
}

.modal-overlay.active { display: flex; }

.pitch-modal-card {
  width: 100%; max-width: 1040px; max-height: 90vh;
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex; flex-direction: column; overflow: hidden;
}

.pitch-modal-header {
  padding: 14px 20px;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between;
}

.pitch-tabs { display: flex; gap: 6px; }

.pitch-tab-btn {
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all 0.15s ease;
}

.pitch-tab-btn:hover {
  color: var(--text-primary);
  border-color: #CBD5E1;
}

.pitch-tab-btn.active {
  background: var(--accent-blue-light);
  border-color: var(--accent-blue-border);
  color: var(--accent-blue);
  font-weight: 700;
}

.pitch-modal-body {
  padding: 28px; overflow-y: auto; flex: 1;
  background: var(--surface-main);
}

.pitch-slide { display: none; }
.pitch-slide.active { display: block; }

/* Slide Components */
.slide-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 20px; }

.slide-box {
  background: var(--surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 20px;
  transition: border-color 0.2s ease;
}

.slide-box:hover {
  border-color: #CBD5E1;
}

.slide-icon-wrapper {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--surface-main);
  border: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

.slide-box h4 {
  color: var(--text-primary); font-size: 14px; font-weight: 700;
  margin-bottom: 8px;
}

.slide-box p {
  color: var(--text-secondary); font-size: 12.5px; line-height: 1.5;
}

/* Benchmark Bars */
.benchmark-row { margin-bottom: 22px; }

.benchmark-label {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  margin-bottom: 8px; display: flex; justify-content: space-between;
}

.bar-track {
  height: 28px; background: var(--surface-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); overflow: hidden;
  display: flex; gap: 8px; padding: 2px;
}

.bar-fill-old {
  background: #94A3B8; color: #FFFFFF;
  font-size: 11px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  display: flex; align-items: center; padding-left: 10px; border-radius: 4px;
}

.bar-fill-new {
  background: var(--accent-green); color: #FFFFFF;
  font-size: 11px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  display: flex; align-items: center; padding-left: 10px; border-radius: 4px;
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface-secondary); }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ── Responsive Behavior ── */
@media (max-width: 1200px) {
  .main-workspace { flex-direction: column; height: auto; }
  .waterfall-panel, .gnn-panel { height: 420px; }
  .metrics-inner { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .navbar-inner { padding: 10px 16px; }
  .control-bar { padding: 10px 16px; }
  .main-workspace { padding: 6px 16px; }
  .metrics-strip { padding: 6px 16px 16px; }
  .metrics-inner { grid-template-columns: repeat(2, 1fr); }
  .control-inner { flex-direction: column; align-items: flex-start; }
  .slide-grid-3 { grid-template-columns: 1fr; }
}
