/* ==============================================================================
   PROJECT BLACK ROOSTER - MASTER TELEMETRY PORTAL STYLING
   ==============================================================================
   File: style.css
   Purpose: Premium dark slate-gray and indigo glassmorphic design system.
   Design: Modern NOC/SOC console look, high-contrast indicators, 60fps animations.
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ------------------------------------------------------------------------------
   1. CSS VARIABLES & DESIGN SYSTEM
   ------------------------------------------------------------------------------ */
:root {
  /* Colors */
  --bg-main: #07090e;
  --bg-card: rgba(19, 23, 35, 0.85);
  --bg-card-hover: rgba(28, 35, 53, 0.95);
  --bg-drawer: rgba(12, 15, 23, 0.98);
  --bg-control: rgba(19, 23, 35, 0.95);
  --border-color: rgba(99, 102, 241, 0.15);
  --border-color-hover: rgba(99, 102, 241, 0.35);
  --border-color-active: rgba(99, 102, 241, 0.6);
  
  /* Brand Accents */
  --color-primary: #6366f1;       /* Indigo */
  --color-primary-glow: rgba(99, 102, 241, 0.25);
  --color-accent: #38bdf8;        /* Electric Cyan */
  --color-accent-glow: rgba(56, 189, 248, 0.25);
  
  /* Status Colors */
  --color-nominal: #10b981;       /* Vibrant Emerald Green */
  --color-nominal-glow: rgba(16, 185, 129, 0.25);
  --color-warning: #f59e0b;       /* Soft Amber/Yellow */
  --color-warning-glow: rgba(245, 158, 11, 0.25);
  --color-critical: #ef4444;      /* Red */
  --color-critical-glow: rgba(239, 68, 68, 0.3);
  --color-security: #a855f7;      /* Purple */
  --color-security-glow: rgba(168, 85, 247, 0.35);
  
  /* Text Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-terminal: #4ade80;
  
  /* Fonts */
  --font-main: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
  
  /* Layout Constants */
  --header-height: 90px;
  --class-banner-height: 0px;
  --footer-height: 0px;
  --sidebar-width: 300px;
}

/* ------------------------------------------------------------------------------
   2. GLOBAL & SCROLLBAR STYLES
   ------------------------------------------------------------------------------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-main);
  font-family: var(--font-main);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  /* Set up space for fixed header/footer and banners */
  padding-top: calc(var(--header-height) + var(--class-banner-height));
  padding-bottom: var(--footer-height);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 180, 212, 0.04) 0px, transparent 50%);
  background-attachment: fixed;
}

/* Custom Webkit Scrollbars for Premium Look */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
}

.blink {
  animation: blink-anim 1.5s infinite alternate;
}

.pulse-red {
  animation: pulse-red-anim 1.5s infinite ease-in-out;
}

/* ------------------------------------------------------------------------------
   3. FIXED CLASSIFICATION & HEADER BANNERS
   ------------------------------------------------------------------------------ */
.class-banner {
  position: fixed;
  left: 0;
  width: 100%;
  height: var(--class-banner-height);
  background-color: #8b0000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.class-banner.top {
  top: 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.class-banner.bottom {
  bottom: 0;
  height: var(--footer-height);
  border-top: 1px solid rgba(255,255,255,0.2);
  justify-content: space-between;
  padding: 0 20px;
}

.main-header {
  position: fixed;
  top: var(--class-banner-height);
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(12, 14, 21, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 900;
}

.header-brand {
  display: flex;
  flex-direction: column;
}

.header-brand h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand h1::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--color-primary);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--color-primary);
}

.header-brand span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* Header Clocks & Status */
.header-right {
  display: flex;
  align-items: center;
  gap: 30px;
}

.header-clocks {
  display: flex;
  gap: 20px;
}

.clock-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.clock-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.global-status-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: all 0.3s ease;
}

.global-status-panel.degraded {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.global-status-panel.critical {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-nominal);
  box-shadow: 0 0 8px var(--color-nominal);
}

.global-status-panel.degraded .status-dot {
  background-color: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
  animation: blink-anim 1s infinite alternate;
}

.global-status-panel.critical .status-dot {
  background-color: var(--color-critical);
  box-shadow: 0 0 8px var(--color-critical);
  animation: blink-anim 0.5s infinite alternate;
}

.status-text {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------------------
   4. LAYOUT & VIEWPORT GRID
   ------------------------------------------------------------------------------ */
.dashboard-viewport {
  max-width: 1720px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: padding-left 0.3s ease;
}

/* Three-Tier Grid */
.tier-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tier-title {
  font-size: 16px; /* up from 13px */
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 14px;
  background: var(--color-primary);
  border-radius: 1px;
}

/* Grid Layouts for Tiers */
.tier-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tier-grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.tier-grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}

.tier-grid-full {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (max-width: 1200px) {
  .tier-grid-3, .tier-grid-2-1, .tier-grid-1-2 {
    grid-template-columns: 1fr;
  }
  .gauges-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Glassmorphic Panel Cards */
.panel-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px; /* Generous padding */
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35); /* Soft premium drop shadow */
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.panel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.panel-card:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.panel-card:hover::before {
  opacity: 1;
}

.panel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 10px;
}

.panel-card-title {
  font-size: 16px; /* up from 14px */
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-card-subtitle {
  font-size: 12px; /* up from 10px */
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ------------------------------------------------------------------------------
   5. TIER 1 - PHYSICAL LAYOUT (GAUGES & L2)
   ------------------------------------------------------------------------------ */
.gauges-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.metro-gauge-group {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metro-gauge-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.metro-gauge-title span {
  font-family: var(--font-mono);
  font-size: 10px;
}

/* Optical Bar Gauge Row */
.optical-bar-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.optical-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

.optical-bar-label .val-span {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

.optical-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.optical-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
}

/* Color Ranges */
.optical-bar-fill.nominal {
  background: linear-gradient(90deg, var(--color-primary), var(--color-nominal));
  box-shadow: 0 0 4px var(--color-nominal);
}

.optical-bar-fill.warning {
  background: var(--color-warning);
  box-shadow: 0 0 4px var(--color-warning);
}

.optical-bar-fill.critical {
  background: var(--color-critical);
  box-shadow: 0 0 4px var(--color-critical);
}

/* LACP Physical Port Grid */
.lacp-grid-wrapper {
  overflow-x: auto;
  width: 100%;
  padding-bottom: 8px; /* Space for scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.25) rgba(255, 255, 255, 0.02);
}

.lacp-grid-wrapper::-webkit-scrollbar {
  height: 6px;
}

.lacp-grid-wrapper::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.lacp-grid-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 3px;
  box-shadow: inset 0 0 2px rgba(0, 240, 255, 0.1);
}

.lacp-grid-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.lacp-grid-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-width: 760px; /* Prevents LACP cards from shrinking and breaking layout */
}

.lacp-metro-box {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lacp-ports {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.lacp-port-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
}

.lacp-port-card.down {
  border-color: rgba(239, 68, 68, 0.15);
}

.lacp-port-name {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.lacp-indicator-block {
  width: 100%;
  height: 12px;
  border-radius: 3px;
  background-color: var(--color-critical);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.lacp-indicator-block.up {
  background-color: var(--color-nominal);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.lacp-port-details {
  font-size: 9px;
  color: var(--text-muted);
}

/* Canvas Area Charts for Drops & Errors */
.chart-wrapper {
  width: 100%;
  height: 140px;
  position: relative;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  overflow: hidden;
}

.chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ------------------------------------------------------------------------------
   6. TIER 2 - LOGICAL ROUTING & SANKEY
   ------------------------------------------------------------------------------ */
.bgp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  height: auto;
}
@media (max-width: 1400px) {
  .bgp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .bgp-grid {
    grid-template-columns: 1fr;
  }
  .gauges-container, .lacp-grid-container {
    grid-template-columns: 1fr;
  }
}

.bgp-session-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  transition: all 0.3s ease;
}

.bgp-session-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.bgp-session-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.bgp-session-info {
  display: flex;
  flex-direction: column;
}

.bgp-session-name {
  font-size: 15px; /* up from 13px */
  font-weight: 700;
  color: var(--text-primary);
}

.bgp-session-vlan {
  font-family: var(--font-mono);
  font-size: 12px; /* up from 10px */
  color: var(--text-muted);
}

.bgp-badge {
  font-size: 11px; /* up from 9px */
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.bgp-badge.up {
  background: rgba(16, 185, 129, 0.12);
  color: var(--color-nominal);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.bgp-badge.down {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-critical);
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: pulse-red-anim 1s infinite alternate;
}

.bgp-session-ips {
  font-family: var(--font-mono);
  font-size: 12px; /* up from 10px */
  color: var(--text-secondary);
  background: rgba(0,0,0,0.15);
  padding: 4px 6px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bgp-session-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-size: 12px; /* up from 10px */
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  padding-top: 6px;
}

.bgp-stat-item {
  display: flex;
  flex-direction: column;
}

.bgp-stat-label {
  color: var(--text-muted);
  font-size: 11px; /* up from 9px */
}

.bgp-stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}

/* Sankey Flow Diagram Container */
.sankey-container {
  width: 100%;
  height: 380px;
  position: relative;
  background: rgba(12, 14, 21, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
}

.sankey-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Sankey Node and Link Styles */
.sankey-node {
  fill: #1e293b;
  stroke: var(--border-color-hover);
  stroke-width: 1px;
  rx: 4px;
  ry: 4px;
}

.sankey-node.active {
  fill: rgba(30, 41, 59, 0.9);
  stroke: var(--color-primary);
}

.sankey-link {
  fill: none;
  stroke: var(--color-primary);
  stroke-opacity: 0.15;
  transition: stroke-opacity 0.3s ease, stroke 0.3s ease;
}

.sankey-link.active {
  stroke-opacity: 0.45;
}

.sankey-link:hover {
  stroke-opacity: 0.7;
}

.sankey-label {
  font-family: var(--font-main);
  font-size: 11px; /* up from 10px */
  font-weight: 700;
  fill: var(--text-secondary);
  text-anchor: middle;
}

.sankey-label.node-title {
  font-size: 13px; /* up from 11px */
  fill: var(--text-primary);
}

.sankey-label.node-val {
  font-family: var(--font-mono);
  font-size: 10px; /* up from 9px */
  fill: var(--color-accent);
}

/* Animated flowing dashes along the Sankey paths */
.sankey-dash {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-dasharray: 4 20;
  animation: flow-animation 4s linear infinite;
  opacity: 0;
  pointer-events: none;
}

.sankey-dash.active {
  opacity: 0.65;
}

@keyframes flow-animation {
  from {
    stroke-dashoffset: 200;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ------------------------------------------------------------------------------
   7. TIER 3 - CYBERSECURITY TERMINAL
   ------------------------------------------------------------------------------ */
.terminal-card {
  min-height: 280px;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 6px 6px 0 0;
  border: 1px solid rgba(255,255,255,0.02);
  border-bottom: none;
}

.terminal-header-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-header-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-security);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-security);
}

.terminal-controls {
  display: flex;
  gap: 10px;
}

.terminal-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.terminal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

.terminal-viewport {
  width: 100%;
  height: 220px;
  background-color: #05070b;
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 0 0 6px 6px;
  padding: 12px;
  overflow-y: auto;
  scroll-behavior: smooth;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Logging syntax highlighting */
.log-line {
  display: flex;
  gap: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.log-line:hover {
  background-color: rgba(255,255,255,0.02);
}

.log-time {
  color: var(--text-muted);
  flex-shrink: 0;
}

.log-src {
  color: var(--color-accent);
  font-weight: 700;
  flex-shrink: 0;
  width: 110px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.log-msg {
  color: #e2e8f0;
  word-break: break-all;
}

/* Line Coloring based on level */
.log-line.info .log-msg {
  color: #94a3b8;
}
.log-line.info .log-src {
  color: #06b6d4;
}

.log-line.warning {
  background-color: rgba(245, 158, 11, 0.03);
  border-left: 2px solid var(--color-warning);
}
.log-line.warning .log-msg {
  color: #fbd38d;
}
.log-line.warning .log-src {
  color: var(--color-warning);
}

.log-line.critical {
  background-color: rgba(239, 68, 68, 0.04);
  border-left: 2px solid var(--color-critical);
}
.log-line.critical .log-msg {
  color: #fca5a5;
  font-weight: 500;
}
.log-line.critical .log-src {
  color: var(--color-critical);
}

.log-line.security_info {
  background-color: rgba(168, 85, 247, 0.02);
}
.log-line.security_info .log-msg {
  color: #d8b4fe;
}
.log-line.security_info .log-src {
  color: var(--color-security);
}

.log-line.security_critical {
  background-color: rgba(168, 85, 247, 0.05);
  border-left: 3px solid var(--color-security);
  animation: security-alert-flash 2s infinite alternate;
}
.log-line.security_critical .log-msg {
  color: #f3e8ff;
  font-weight: 600;
}
.log-line.security_critical .log-src {
  color: var(--color-security);
  font-weight: 700;
}

@keyframes security-alert-flash {
  0% { background-color: rgba(168, 85, 247, 0.04); }
  100% { background-color: rgba(168, 85, 247, 0.12); }
}

/* ------------------------------------------------------------------------------
   8. INTERACTIVE METRIC INSPECTOR DRAWER
   ------------------------------------------------------------------------------ */
.inspector-drawer {
  position: fixed;
  top: calc(var(--header-height) + var(--class-banner-height));
  right: -450px; /* Hidden by default */
  width: 440px;
  height: calc(100vh - var(--header-height) - var(--class-banner-height) - var(--footer-height));
  background: var(--bg-drawer);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-left: 1px solid var(--border-color-hover);
  z-index: 800;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

.inspector-drawer.open {
  right: 0;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.drawer-value-box {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.02);
  border-radius: 6px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-api-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--color-accent);
  word-break: break-all;
}

.drawer-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sparkline-wrapper {
  width: 100%;
  height: 120px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.sparkline-canvas {
  width: 100%;
  height: 100%;
}

.sparkline-header {
  position: absolute;
  top: 6px;
  left: 10px;
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  pointer-events: none;
}

.json-payload-container {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.03);
  background: #040609;
}

.json-payload-header {
  background: rgba(255,255,255,0.02);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.json-payload-header span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.json-copy-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.json-copy-btn:hover {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.json-codeblock {
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #38bdf8; /* light cyan code */
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Sleek custom scrollbars for codeblocks and scroll containers */
.json-codeblock::-webkit-scrollbar,
.drawer-content::-webkit-scrollbar,
.terminal-viewport::-webkit-scrollbar,
.glossary-modal-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.json-codeblock::-webkit-scrollbar-track,
.drawer-content::-webkit-scrollbar-track,
.terminal-viewport::-webkit-scrollbar-track,
.glossary-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.json-codeblock::-webkit-scrollbar-thumb,
.drawer-content::-webkit-scrollbar-thumb,
.terminal-viewport::-webkit-scrollbar-thumb,
.glossary-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  transition: background 0.2s ease;
}

.json-codeblock::-webkit-scrollbar-thumb:hover,
.drawer-content::-webkit-scrollbar-thumb:hover,
.terminal-viewport::-webkit-scrollbar-thumb:hover,
.glossary-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* ------------------------------------------------------------------------------
   9. MOCK CONTROL PANEL (COLLAPSIBLE SIDEBAR)
   ------------------------------------------------------------------------------ */
.control-panel {
  position: fixed;
  top: calc(var(--header-height) + var(--class-banner-height));
  left: calc(-1 * var(--sidebar-width)); /* Hidden offscreen by default */
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height) - var(--class-banner-height) - var(--footer-height));
  background: var(--bg-control);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-right: 1px solid var(--border-color-hover);
  z-index: 850;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

.control-panel.open {
  left: 0;
}

.control-panel-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-panel-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-panel-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
  animation: blink-anim 1s infinite alternate;
}

.control-toggle-btn {
  position: absolute;
  top: 15px;
  right: -42px; /* Pulls out onto screen */
  width: 42px;
  height: 42px;
  background: var(--bg-control);
  border: 1px solid var(--border-color-hover);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 5px 0 15px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  z-index: 840;
}

.control-toggle-btn:hover {
  color: var(--color-accent);
  background: var(--bg-card-hover);
}

.control-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.02);
  border-radius: 8px;
  padding: 12px;
}

.control-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  padding-bottom: 4px;
}

/* Control Controls */
.control-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
}

.control-slider-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-accent);
}

.control-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
  cursor: pointer;
}

.control-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
  transition: all 0.1s ease;
}

.control-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* BGP Flappers */
.flap-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.flap-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 8px 4px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.flap-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.flap-btn.active {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-critical);
  border-color: var(--color-critical);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
  animation: pulse-red-anim 1.5s infinite alternate;
}

/* Switch styling for POC and Security switches */
.control-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-switch-label {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
}

.switch-subtext {
  font-size: 9px;
  color: var(--text-muted);
  display: block;
}

.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .3s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

.btn-trigger-action {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4338ca 100%);
  border: none;
  color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.btn-trigger-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(99, 102, 241, 0.3);
}

.btn-trigger-action:active {
  transform: translateY(0);
}

.btn-trigger-action.security-btn {
  background: linear-gradient(135deg, var(--color-security) 0%, #7e22ce 100%);
  box-shadow: 0 4px 10px rgba(168, 85, 247, 0.2);
}

.btn-trigger-action.security-btn:hover {
  box-shadow: 0 6px 15px rgba(168, 85, 247, 0.3);
}

.btn-trigger-action.security-btn.active {
  background: #ef4444;
  box-shadow: 0 0 12px var(--color-critical);
  animation: pulse-red-anim 1.5s infinite alternate;
}

.btn-reset {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.15);
}

/* ------------------------------------------------------------------------------
   10. HIGH-VISIBILITY ALERT NOTIFICATION BANNERS
   ------------------------------------------------------------------------------ */
.alert-notifications-container {
  position: fixed;
  bottom: calc(var(--footer-height) + 16px);
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 950;
  pointer-events: none; /* Let clicks pass through empty spaces */
}

.alert-banner {
  pointer-events: auto; /* Enable clicks on banners */
  width: 380px;
  background: rgba(15, 18, 28, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-critical);
  border-left: 5px solid var(--color-critical);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: slide-in-right 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
  overflow: hidden;
}

.alert-banner.warning {
  border-color: var(--color-warning);
  border-left-color: var(--color-warning);
}

.alert-banner.security {
  border-color: var(--color-security);
  border-left-color: var(--color-security);
  animation: security-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.alert-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-banner-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-critical);
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-banner.warning .alert-banner-title {
  color: var(--color-warning);
}

.alert-banner.security .alert-banner-title {
  color: var(--color-security);
}

.alert-banner-time {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.alert-banner-msg {
  font-size: 11px;
  color: #e2e8f0;
  line-height: 1.4;
}

.alert-banner-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.alert-banner-close:hover {
  color: var(--text-primary);
}

/* ------------------------------------------------------------------------------
   11. KEYFRAMES & ANIMATIONS
   ------------------------------------------------------------------------------ */
@keyframes blink-anim {
  0% { opacity: 1; }
  100% { opacity: 0.3; }
}

@keyframes pulse-red-anim {
  0% {
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
    background-color: rgba(239, 68, 68, 0.1);
  }
  100% {
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.6);
    background-color: rgba(239, 68, 68, 0.25);
  }
}

@keyframes slide-in-right {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes security-slide-in {
  from {
    transform: translateX(120%);
    opacity: 0;
    box-shadow: 0 0 0 var(--color-security-glow);
  }
  to {
    transform: translateX(0);
    opacity: 1;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  }
}

/* Alert Ticker Scrolling Header */
.alert-ticker-container {
  flex-grow: 1;
  margin: 0 30px;
  overflow: hidden;
  position: relative;
  height: 28px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.alert-ticker-label {
  background: #271c2b;
  color: var(--color-security);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 0 8px;
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-color);
  z-index: 2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.alert-ticker-label.active-alerts {
  background: #3c191a;
  color: var(--color-critical);
  animation: blink-anim 1s infinite alternate;
}

.alert-ticker-content {
  display: flex;
  gap: 50px;
  padding-left: 20px;
  white-space: nowrap;
  animation: ticker-animation 25s linear infinite;
  z-index: 1;
}

.alert-ticker-content:hover {
  animation-play-state: paused;
}

.ticker-item {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-item.critical {
  color: #fca5a5;
}

.ticker-item.critical::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-critical);
  box-shadow: 0 0 6px var(--color-critical);
}

.ticker-item.warning {
  color: #fbd38d;
}

.ticker-item.warning::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-warning);
  box-shadow: 0 0 6px var(--color-warning);
}

@keyframes ticker-animation {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* ==============================================================================
   12. HERO METRICS & DATA TABLE ADDITIONAL STYLES
   ============================================================================== */
.hero-metrics-section {
  margin-bottom: 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .hero-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-card {
  background: linear-gradient(135deg, rgba(19, 23, 35, 0.85) 0%, rgba(26, 32, 47, 0.85) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-hover);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, rgba(26, 32, 47, 0.95) 0%, rgba(32, 40, 58, 0.95) 100%);
}

.hero-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-card-icon svg {
  width: 22px;
  height: 22px;
}

.hero-card:hover .hero-card-icon {
  background: rgba(99, 102, 241, 0.2);
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.hero-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-card-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-card-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: color 0.3s ease;
}

.hero-card-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

/* Data Table Styling */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  vertical-align: middle;
  transition: background-color 0.2s ease;
}

.data-table tbody tr {
  transition: all 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}

.data-table tbody tr.row-degraded {
  background: rgba(239, 68, 68, 0.02);
}

.data-table tbody tr.row-degraded:hover {
  background: rgba(239, 68, 68, 0.04);
}

.spoke-name-cell {
  font-weight: 600;
  color: var(--text-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-nominal);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-critical);
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: blink-anim 1.5s infinite alternate;
}

.bfd-badge {
  display: inline-flex;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.bfd-badge.active {
  background: rgba(56, 189, 248, 0.1);
  color: var(--color-accent);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.bfd-badge.inactive {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-critical);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Icon and Card Micro-Animations */
.card-title-icon {
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-right: 4px;
}

.panel-card:hover .card-title-icon {
  transform: rotate(12deg) scale(1.1);
}



.lacp-port-card {
  border-radius: 8px; /* Smooth rounded LACP blocks */
}

/* ==============================================================================
   9. HEADER ACTION BUTTONS & GLOSSARY MODAL
   ============================================================================= */
.header-action-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(79, 70, 229, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
  margin-right: 16px;
}

.header-action-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(79, 70, 229, 0.15));
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}

.header-action-btn:active {
  transform: translateY(0);
}

/* Glossary Modal Container */
.glossary-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 10, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.glossary-modal.open {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Content Box */
.glossary-modal-content {
  width: 90vw;
  max-width: 1200px;
  height: 85vh;
  background: rgba(20, 24, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-slide-up 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-slide-up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Modal Header */
.glossary-modal-header {
  padding: 20px 28px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.glossary-header-brand h2 {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.05em;
  margin: 0;
}

.glossary-header-brand span {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.glossary-header-tag {
  background: rgba(185, 28, 28, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(185, 28, 28, 0.3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.glossary-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.glossary-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* Modal Body */
.glossary-modal-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Controls Area */
.glossary-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: rgba(0, 0, 0, 0.15);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.glossary-search-wrapper {
  position: relative;
  width: 100%;
}

.glossary-search-wrapper .search-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.glossary-search {
  width: 100%;
  background: rgba(8, 10, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 12px 16px 12px 42px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  transition: all 0.25s ease;
}

.glossary-search:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
  background: rgba(8, 10, 16, 0.8);
}

.glossary-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.glossary-filter-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.glossary-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.glossary-filter-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--color-accent);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}

.glossary-results-info {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 4px;
}

/* Glossary Grid & Cards */
.glossary-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 20px;
}

@media (min-width: 900px) {
  .glossary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.glossary-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.glossary-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Card Tier Indicator Bars */
.glossary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
}

.glossary-card.tier1::before { background: var(--color-primary); }
.glossary-card.tier2::before { background: var(--color-accent); }
.glossary-card.tier3::before { background: var(--color-security); }

.glossary-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.glossary-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glossary-card-title h3 {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.glossary-card-title span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--color-accent);
  word-break: break-all;
  display: inline-block;
}

.glossary-card.tier1 .glossary-card-title span { color: #818cf8; }
.glossary-card.tier2 .glossary-card-title span { color: var(--color-accent); }
.glossary-card.tier3 .glossary-card-title span { color: #c084fc; }

.glossary-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.glossary-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.glossary-badge.tier {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glossary-badge.type {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

.glossary-badge.unit {
  background: rgba(255, 255, 255, 0.05);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.15);
}

.glossary-card-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

.glossary-card-usecase {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.glossary-card-usecase span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.glossary-card-usecase p {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.glossary-card-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.glossary-card-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.glossary-card-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}



/* ------------------------------------------------------------------------------
   9. LINEAGE-VALUE INTERACTIVE STYLING
   ------------------------------------------------------------------------------ */
.lineage-value {
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease-in-out;
  border-bottom: 1px dotted rgba(0, 240, 255, 0.4);
  display: inline-block;
}

.lineage-value:hover {
  color: var(--color-nominal) !important;
  border-bottom: 1px solid var(--color-nominal);
  background: rgba(0, 240, 255, 0.08);
  padding: 0 4px;
  margin: 0 -4px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

/* Ensure specific badge layouts are preserved when lineage-value is applied */
.bgp-badge.lineage-value {
  border-bottom: none;
}
.bgp-badge.lineage-value:hover {
  box-shadow: 0 0 10px currentColor;
  margin: 0;
  padding: 2px 8px;
}

.status-badge.lineage-value, .bfd-badge.lineage-value {
  border-bottom: none;
}
.status-badge.lineage-value:hover, .bfd-badge.lineage-value:hover {
  box-shadow: 0 0 10px currentColor;
  margin: 0;
  padding: 2px 6px;
}
