/* ==========================================================================
   CKV PO1 — Prototype 01: Network Constellation
   Theme: High-End Space Dark Mode & Glassmorphism
   Matthijs van der Elst — VWO 4 CKV
   ========================================================================== */

:root {
  --bg-space: #06080e;
  --bg-surface: rgba(12, 17, 29, 0.75);
  --bg-surface-elevated: rgba(18, 25, 42, 0.85);
  --bg-card: rgba(22, 31, 52, 0.6);
  --bg-card-hover: rgba(32, 45, 75, 0.8);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.25);
  --border-active: rgba(0, 240, 255, 0.6);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #00f0ff;
  --accent-cyan-dim: rgba(0, 240, 255, 0.15);
  --accent-violet: #a855f7;
  --accent-violet-dim: rgba(168, 85, 247, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-dim: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-dim: rgba(245, 158, 11, 0.15);
  
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.4);
  --glow-violet: 0 0 20px rgba(168, 85, 247, 0.4);
  
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --header-height: 72px;
  --footer-height: 42px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-space);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fullscreen Canvas */
#network-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
  cursor: crosshair;
  background: radial-gradient(circle at 50% 45%, #0e1526 0%, #080c16 55%, #04060a 100%);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}

.brand-logo-glow {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-violet));
  box-shadow: var(--glow-cyan);
  position: relative;
}

.brand-logo-glow::after {
  content: "MK";
  position: absolute;
  inset: 2px;
  background: #090e18;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

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

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.brand-sub {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 13px;
  margin-left: 4px;
}

/* Tabs */
.header-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}

.nav-tab .tab-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
}

.nav-tab .tab-pill {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  display: none; /* revealed on large screens or hover */
}

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

.nav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid var(--border-active);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.nav-tab.active .tab-index {
  color: var(--accent-cyan);
  font-weight: 700;
}

.nav-tab.active .tab-pill {
  display: inline-block;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-action {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-action:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  transform: translateY(-1px);
}

.btn-vision {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.15));
  border-color: rgba(245, 158, 11, 0.35);
  color: #fef08a;
}

.btn-vision:hover {
  border-color: #f59e0b;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(168, 85, 247, 0.25));
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.btn-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Canvas HUD Overlay
   ========================================================================== */

.canvas-hud {
  position: fixed;
  top: calc(var(--header-height) + 16px);
  left: 24px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  user-select: none;
}

.hud-item {
  background: rgba(10, 15, 26, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.hud-dot.pulsing {
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseGlow 2s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

.hud-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Collapsible Quick-List Drawer
   ========================================================================== */

.drawer {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: var(--footer-height);
  width: 390px;
  max-width: 90vw;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-left: 1px solid var(--border-subtle);
  z-index: 25;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
}

.drawer.collapsed {
  transform: translateX(100%);
  pointer-events: none;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.drawer-title-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.drawer-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.btn-icon-only {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.btn-icon-only:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.drawer-search-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.drawer-search-wrapper input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Custom Slim Scrollbars */
.drawer-list::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
  width: 6px;
}

.drawer-list::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.drawer-list::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.drawer-list::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.drawer-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.drawer-item:hover, .drawer-item:focus-visible {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateX(-3px);
  box-shadow: 0 4px 16px rgba(0, 240, 255, 0.15);
  outline: none;
}

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

.drawer-item-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.drawer-item-info {
  display: flex;
  flex-direction: column;
}

.drawer-item-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

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

.drawer-item-arrow {
  color: var(--text-muted);
  font-size: 14px;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.drawer-item:hover .drawer-item-arrow {
  color: var(--accent-cyan);
  transform: translateX(3px);
}

.drawer-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-tip kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Glassmorphism Detail Modal
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 240, 255, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPopIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(24px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: var(--accent-cyan);
  transform: rotate(90deg);
}

.modal-body {
  padding: 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Modal Content Blocks */
.modal-header-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-title-icon {
  font-size: 36px;
}

.modal-main-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
}

.modal-tagline {
  font-size: 15px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Sections */
.modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--accent-cyan);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.section-content {
  font-size: 15px;
  line-height: 1.7;
  color: #e2e8f0;
}

/* Callout Box for Critical Review / Quotes */
.callout-box {
  background: rgba(0, 240, 255, 0.05);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 20px;
}

.callout-box.amber {
  background: rgba(245, 158, 11, 0.07);
  border-left-color: var(--accent-amber);
}

.callout-box.violet {
  background: rgba(168, 85, 247, 0.07);
  border-left-color: var(--accent-violet);
}

/* Examples Grid */
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.example-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.example-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.example-name {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.example-city {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 2px 6px;
  border-radius: 4px;
}

.example-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Highlights List */
.highlights-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.highlights-list li {
  position: relative;
  padding-left: 22px;
  color: #e2e8f0;
  font-size: 14px;
}

.highlights-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent-cyan);
  font-size: 12px;
}

/* Tech Stack Badges */
.tech-stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.tech-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #cbd5e1;
}

.tech-badge:hover {
  border-color: var(--accent-cyan);
  color: #fff;
  background: var(--accent-cyan-dim);
}

/* Vision / Manifesto Styling */
.manifesto-quote {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid var(--border-active);
  border-radius: var(--radius-md);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.15);
}

/* ==========================================================================
   Footer & Status Bar
   ========================================================================== */

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-author {
  font-weight: 600;
  color: #fff;
}

.footer-desc {
  color: var(--text-muted);
}

.footer-shortcuts {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-shortcuts kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #e2e8f0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 900px) {
  .header-tabs .tab-pill {
    display: none !important;
  }
  .brand-sub {
    display: none;
  }
  .hud-item.hud-meta {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 14px;
    height: 64px;
  }
  
  :root {
    --header-height: 64px;
  }
  
  .brand-title {
    font-size: 14px;
  }
  
  .header-brand {
    gap: 8px;
  }
  
  .nav-tab {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .nav-tab .tab-index {
    display: none;
  }
  
  .btn-action .btn-label,
  .btn-action .btn-kbd {
    display: none;
  }
  
  .canvas-hud {
    top: calc(var(--header-height) + 10px);
    left: 14px;
    right: 14px;
  }
  
  .drawer {
    width: 100%;
    max-width: 100%;
  }
  
  .modal-card {
    max-height: 92vh;
    border-radius: var(--radius-md);
  }
  
  .modal-body {
    padding: 22px 18px;
    gap: 18px;
  }
  
  .modal-main-title {
    font-size: 20px;
  }
  
  .footer-desc {
    display: none;
  }
}
