/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  --font-title: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;

  /* Color Palette */
  --bg-base: #060913;
  --bg-surface: #0c1020;
  --bg-surface-elevated: #141a32;
  --glass-bg: rgba(12, 16, 32, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.03);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --color-primary: #8b5cf6; /* Violet */
  --color-primary-glow: rgba(139, 92, 246, 0.35);
  --color-secondary: #06b6d4; /* Cyan */
  --color-secondary-glow: rgba(6, 182, 212, 0.35);
  
  --color-success: #10b981; /* Green */
  --color-success-glow: rgba(16, 185, 129, 0.2);
  --color-warning: #f59e0b; /* Yellow */
  --color-danger: #ef4444; /* Red */
  --color-danger-glow: rgba(239, 68, 68, 0.3);

  --gradient-main: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --gradient-dark: linear-gradient(180deg, #0b0f19 0%, #060913 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f97316 100%);

  /* Transitions & Shadows */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
}

/* ==========================================================================
   GLOBAL RESET & STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-base);
  background-image: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ==========================================================================
   PREMIUM GLASSMORPHISM UTILITIES
   ========================================================================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-premium);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.glass-card.inner-card {
  background: rgba(8, 12, 24, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 40px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 30px;
}

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

.logo-icon {
  background: var(--gradient-main);
  padding: 8px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--color-secondary-glow);
}

.logo-icon svg {
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  font-size: 20px;
  line-height: 1.1;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Tab Navigation */
.app-tabs {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  padding: 4px;
  border-radius: var(--border-radius-md);
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.tab-btn svg {
  width: 16px;
  height: 16px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 50px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-success);
}

/* Pulse Animations */
.pulse-green {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 var(--color-success-glow);
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Main Content Wrapper */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Tab panes switching */
.tab-pane {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.tab-pane.active {
  display: block;
}

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

/* ==========================================================================
   TAB 1: PRESENTATION SLIDES STYLING
   ========================================================================== */
.slides-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

.slides-sidebar h3 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.slide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.slide-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.slide-item.active {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
}

.slide-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-primary);
  opacity: 0.8;
}

.slide-title {
  font-size: 14px;
  font-weight: 500;
}

/* Slide Viewer Stage */
.slide-viewer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  background: linear-gradient(135deg, rgba(16, 20, 38, 0.75) 0%, rgba(10, 14, 28, 0.75) 100%);
}

.slide-stage {
  flex: 1;
}

.slide-content {
  display: none;
  animation: slideIn var(--transition-normal);
}

.slide-content.active {
  display: block;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.slide-header {
  margin-bottom: 25px;
}

.slide-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-secondary);
  font-weight: 600;
}

.slide-header h2 {
  font-size: 32px;
  margin-top: 4px;
}

.slide-lead {
  font-size: 18px;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* Grid Layouts inside slides */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 20px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: white;
}

.card-icon.purple { background: var(--color-primary); box-shadow: 0 0 10px rgba(139, 92, 246, 0.4); }
.card-icon.blue { background: var(--color-secondary); box-shadow: 0 0 10px rgba(6, 182, 212, 0.4); }

.feature-card h4 {
  font-size: 16px;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Info Callouts */
.info-callout {
  background: rgba(6, 182, 212, 0.08);
  border-left: 4px solid var(--color-secondary);
  padding: 16px;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.info-callout.success {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid var(--color-success);
}

.info-callout.success strong {
  color: var(--color-success);
}

/* Architecture slide */
.architecture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 20px;
}

.arch-box {
  padding: 15px 20px;
  display: flex;
  gap: 15px;
  background: rgba(255, 255, 255, 0.02);
}

.box-icon {
  color: var(--color-secondary);
  flex-shrink: 0;
}

.arch-box h5 {
  font-size: 15px;
  margin-bottom: 4px;
}

.arch-box p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Diagrams inside slides */
.diagram-placeholder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius-md);
  margin-bottom: 25px;
  border: 1px dashed var(--glass-border);
  height: 140px;
  position: relative;
}

.node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.node .icon-box {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--color-primary-glow);
}

.origin-node .icon-box {
  border-color: var(--color-danger);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.node.mini .icon-box {
  width: 38px;
  height: 38px;
}

.nodes-clients {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
}

.nodes-clients.mini {
  gap: 24px;
}

.node-client {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations for diagrams */
.flow-lines {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  margin: 0 15px;
}

.line.red-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 25px;
  background: var(--color-danger);
  border-radius: 5px;
  box-shadow: 0 0 8px var(--color-danger);
  animation: slide-flow 2s infinite linear;
}

.line.red-line:nth-child(2) { animation-delay: 0.6s; }
.line.red-line:nth-child(3) { animation-delay: 1.3s; }

@keyframes slide-flow {
  0% { left: 100%; }
  100% { left: 0%; }
}

.cdn-edges {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.edge-node .icon-box {
  border-color: var(--color-secondary);
  box-shadow: 0 0 12px var(--color-secondary-glow);
}

.origin-to-edges {
  flex: 1;
  position: relative;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  margin: 0 10px;
}

.dash-line.missed {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--color-danger);
  white-space: nowrap;
}

.edges-to-clients {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 100%;
  padding: 0 10px;
}

.edges-to-clients svg {
  width: 14px;
  color: var(--color-success);
}

/* Bullets List */
.bullets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bullet-item {
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.bullet-item svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.danger-icon { color: var(--color-danger); }
.success-icon { color: var(--color-success); }

/* ABR Detail list */
.abr-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 25px;
}

.abr-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.abr-steps li {
  font-size: 13px;
  position: relative;
  padding-left: 20px;
  color: var(--text-secondary);
}

.abr-steps li strong {
  color: var(--text-primary);
}

.abr-steps li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-secondary);
}

.manifest-tiers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.tier-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
}

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.hd { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.badge.md { background: rgba(6, 182, 212, 0.15); color: var(--color-secondary); }
.badge.sd { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }

.chunk-badge {
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.network-drop-alert {
  margin-top: 15px;
  padding: 10px;
  background: rgba(239, 68, 68, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.15);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.network-drop-alert svg {
  color: var(--color-danger);
  width: 16px;
}

/* Slide buttons footer */
.slide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--glass-border);
  padding-top: 15px;
  margin-top: 25px;
}

.slide-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.slide-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.slide-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.slide-progress-dots {
  display: flex;
  gap: 6px;
}

.progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.progress-dot.active {
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
}

/* ==========================================================================
   TAB 2: CDN & LOAD SIMULATOR STYLING
   ========================================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 30px;
}

.simulator-left, .simulator-right {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

/* Control Panel Card */
.control-panel-card {
  background: linear-gradient(135deg, rgba(20, 26, 50, 0.5) 0%, rgba(12, 16, 32, 0.5) 100%);
}

.panel-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.control-groups {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
}

/* Toggle Switch style */
.toggle-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  transition: .4s;
  border-radius: 34px;
}

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

input:checked + .slider {
  background-color: var(--color-secondary);
  box-shadow: 0 0 10px var(--color-secondary-glow);
  border-color: rgba(6, 182, 212, 0.3);
}

input:checked + .slider:before {
  transform: translateX(24px);
  background-color: white;
}

.toggle-status-text {
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 8px;
  text-transform: uppercase;
}

.text-cyan { color: var(--color-secondary); }
.text-purple { color: var(--color-primary); }
.text-green { color: var(--color-success); }
.text-yellow { color: var(--color-warning); }
.text-red { color: var(--color-danger); }

/* Slider & Presets style */
.slider-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}

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

.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: var(--bg-surface-elevated);
  outline: none;
  border: 1px solid var(--glass-border);
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 8px var(--color-primary);
  transition: transform 0.1s;
}

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

/* Slider Presets */
.slider-presets {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.preset-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

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

.preset-btn.active {
  color: var(--color-primary);
  background: rgba(139, 92, 246, 0.1);
  font-weight: 700;
}

/* Network Visualizer Map */
.network-visual-card {
  flex: 1;
  min-height: 380px;
  display: flex;
  flex-direction: column;
}

.visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-danger);
}

.visual-canvas-container {
  flex: 1;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.network-map {
  display: grid;
  grid-template-columns: 140px 1fr 140px 1fr 140px;
  height: 100%;
  min-height: 280px;
  position: relative;
}

.network-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  z-index: 2;
  position: relative;
}

.node-title {
  position: absolute;
  top: 0;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* Clients block grid */
.clients-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  margin-top: 15px;
}

.client-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 7px;
  color: transparent;
  transition: all 0.3s ease;
}

.client-dot.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--color-primary);
  box-shadow: 0 0 6px var(--color-primary-glow);
  color: var(--color-primary);
}

.client-dot.active.sending {
  background: var(--color-primary);
}

.client-dot.warning {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--color-warning);
}

.client-dot.danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--color-danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

/* Pathway column */
.pathways-col, .pathways-col-2 {
  z-index: 1;
  position: relative;
  width: 100%;
}

/* Node styles */
.network-node {
  background: var(--bg-surface);
  border: 2px solid var(--glass-border);
  padding: 12px;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
  text-align: center;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.network-node .node-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.network-node .node-label {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.network-node .sub-label {
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* Edge node container stacking */
.edge-nodes-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
  margin-top: 15px;
}

/* Specific node glow status */
.cdn-node {
  border-color: rgba(6, 182, 212, 0.3);
}

.cdn-node.active {
  border-color: var(--color-secondary);
  box-shadow: 0 0 15px var(--color-secondary-glow);
}

.cdn-node.active .node-icon {
  color: var(--color-secondary);
  background: rgba(6, 182, 212, 0.1);
}

/* Origin Node */
.origin-server-node {
  border-color: var(--color-primary);
  margin-top: 15px;
  position: relative;
}

.origin-server-node.active {
  box-shadow: 0 0 15px var(--color-primary-glow);
}

.origin-server-node.active .node-icon {
  color: var(--color-primary);
}

.origin-server-node.overloaded {
  border-color: var(--color-warning);
  animation: jitter 0.15s infinite;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.origin-server-node.overloaded .node-icon {
  color: var(--color-warning);
}

.origin-server-node.crashed {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6) !important;
  background: rgba(40, 8, 8, 0.8) !important;
  animation: shake 0.3s infinite;
}

.origin-server-node.crashed .node-icon {
  color: var(--color-danger) !important;
  background: rgba(239, 68, 68, 0.2) !important;
}

.origin-server-node.crashed .node-label {
  color: var(--color-danger);
}

/* Crash Flame Overlay */
.crash-flames {
  position: absolute;
  font-size: 32px;
  top: -24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  animation: float-flame 1s infinite alternate;
}

.origin-server-node.crashed .crash-flames {
  opacity: 1;
}

@keyframes float-flame {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-5px) scale(1.1); }
}

@keyframes jitter {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -1.5px) rotate(-0.5deg); }
  30% { transform: translate(-1.5px, 0px) rotate(0.5deg); }
  50% { transform: translate(1px, 1.5px) rotate(0deg); }
  70% { transform: translate(-1px, 1px) rotate(-0.5deg); }
  90% { transform: translate(1.5px, -1px) rotate(0.5deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Animated SVG Flow Overlay */
.flow-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flow-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 1.5;
}

.flow-pulse {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 8, 40;
  animation: pulse-move 1.5s infinite linear;
}

.flow-pulse.to-cdn {
  stroke: var(--color-secondary);
}

.flow-pulse.to-origin-miss {
  stroke: var(--color-danger);
  animation-duration: 2.2s;
}

.flow-pulse.direct {
  stroke: var(--color-primary);
  animation-duration: 1s;
}

@keyframes pulse-move {
  to {
    stroke-dashoffset: -120;
  }
}

/* Banner Alert */
#crashed-banner {
  background: var(--color-danger);
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  animation: blink 0.8s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Analytics section (Right Col) */
.chart-container {
  height: 180px;
  position: relative;
  margin-top: 15px;
}

.mini-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.mini-metric {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
}

.mini-metric .m-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.mini-metric .m-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* HTTP Header Console styling */
.header-inspector-card {
  flex: 1;
}

.http-headers-display {
  background: #040710;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-line {
  display: flex;
  gap: 8px;
}

.h-key {
  color: var(--text-secondary);
  font-weight: 500;
}

.h-val {
  color: #c9d1d9;
}

.highlighted-line {
  background: rgba(139, 92, 246, 0.1);
  border-left: 2px solid var(--color-primary);
  padding-left: 6px;
  margin: 2px 0;
}

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

.header-explanation {
  margin-top: 15px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   TAB 3: ABR PLAYER STYLING
   ========================================================================== */
.player-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 30px;
}

.player-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.live-dot-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-danger);
  box-shadow: 0 0 6px var(--color-danger);
  animation: live-blink 1.2s infinite alternate;
}

@keyframes live-blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-premium);
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Buffering / Crash Overlay */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  z-index: 10;
  color: var(--text-primary);
  font-size: 14px;
}

.crash-overlay {
  background: rgba(20, 5, 5, 0.9);
  border: 2px solid var(--color-danger);
  border-radius: var(--border-radius-md);
}

.crash-alert-icon {
  width: 42px;
  height: 42px;
  color: var(--color-danger);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Bandwidth Controller Slider styling */
.bandwidth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bandwidth-header h4 {
  font-size: 15px;
}

.bandwidth-header .badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-success);
}

.slider-control-row {
  margin-top: 15px;
  padding: 0 10px;
}

.bw-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.bw-slider::-webkit-slider-thumb {
  background: var(--color-secondary);
  box-shadow: 0 0 8px var(--color-secondary-glow);
}

/* Right stats grid */
.player-right {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
}

.stat-box .s-label {
  font-size: 10px;
  color: var(--text-muted);
}

.stat-box .s-value {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

/* Console chunk logs styling */
.segment-logger-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

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

.clear-log-btn {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.log-console-container {
  flex: 1;
  background: #040710;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-md);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  overflow: hidden;
  margin-top: 12px;
  position: relative;
}

.log-console {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar styles */
.log-console::-webkit-scrollbar {
  width: 4px;
}
.log-console::-webkit-scrollbar-track {
  background: transparent;
}
.log-console::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
}

.log-entry {
  color: #c9d1d9;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-entry.system {
  color: var(--text-muted);
}

.log-entry.get {
  color: #a5d6ff;
}

.log-entry .time {
  color: #8b949e;
  margin-right: 6px;
}

.log-entry .badge-inline {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  margin: 0 4px;
}

.log-entry .badge-inline.hit { background: rgba(6, 182, 212, 0.2); color: var(--color-secondary); }
.log-entry .badge-inline.miss { background: rgba(239, 68, 68, 0.2); color: var(--color-danger); }
.log-entry .badge-inline.quality { background: rgba(245, 158, 11, 0.2); color: var(--color-warning); }

/* ==========================================================================
   FOOTER STYLING
   ========================================================================== */
.app-footer {
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVE DESIGN (DESKTOP PREFERENCE)
   ========================================================================== */
@media (max-width: 1200px) {
  .simulator-layout, .player-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   POC MODE & STREAM SOURCE STYLING
   ========================================================================== */
.poc-mode-switcher-container {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.poc-mode-switcher {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  padding: 3px;
  gap: 2px;
}

.poc-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.poc-mode-btn svg {
  width: 14px;
  height: 14px;
}

.poc-mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.poc-mode-btn.active {
  color: var(--text-primary);
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary-glow);
}

.poc-mode-btn.active#poc-real-btn {
  background: var(--color-secondary);
  box-shadow: 0 0 10px var(--color-secondary-glow);
}

/* Stream Source Card */
.stream-source-card {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08) 0%, rgba(12, 16, 32, 0.5) 100%);
  border-color: rgba(6, 182, 212, 0.2);
  margin-bottom: 20px;
}

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

.url-input-row {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.custom-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.custom-input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 8px var(--color-secondary-glow);
}

.apply-url-btn {
  background: var(--color-secondary);
  color: white;
  border: none;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  padding: 0 20px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.apply-url-btn:hover {
  background: #0891b2;
  box-shadow: 0 0 10px var(--color-secondary-glow);
}

.deploy-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.deploy-hint code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.deploy-hint svg {
  width: 14px;
  height: 14px;
  color: var(--color-secondary);
}

.player-main-card {
  background: var(--glass-bg);
}

