:root {
  --bg-color: #050505;
  --text-color: #e0e0e0;
  --accent-color: #ff3333; /* Kill red */
  --secondary-accent: #fcd53f; /* Bun yellow-ish */
  --grid-color: rgba(255, 255, 255, 0.05);
  --font-mono: "JetBrains Mono", monospace;
  --font-display: "Space Grotesk", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-mono);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* Background Effects */
.grid-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
  pointer-events: none;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnPjxmaWx0ZXIgaWQ9J24nPjxmZVR1cmJ1bGVuY2UgdHlwZT0nZnJhY3RhbE5vaXNlJyBiYXNlRnJlcXVlbmN5PScwLjYnIHN0aXRjaFRpbGVzPSdzdGl0Y2gnLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMTAwJScgaGVpZ2h0PScxMDAlJyBmaWxsPSd0cmFuc3BhcmVudCcvPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0ndXJsKCNuKScgb3BhY2l0eT0nMC4wNScvPjwvc3ZnPg==");
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--grid-color);
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -1px;
}

.blink {
  animation: blink 1s step-end infinite;
  color: var(--accent-color);
}

.version-badge {
  border: 1px solid var(--grid-color);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.02);
}

/* Hero */
.hero {
  padding-top: 4rem;
}

.glitch-text {
  font-family: var(--font-display);
  font-size: 5rem;
  line-height: 0.9;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
  mix-blend-mode: exclusion;
}

.glitch-text.sub {
  color: var(--accent-color);
}

.mission-statement {
  margin-top: 2rem;
  font-size: 1.2rem;
  max-width: 600px;
  color: #888;
}

.bun-text {
  color: var(--secondary-accent);
  font-weight: bold;
}

/* Install Block */
.install-block {
  margin-top: 3rem;
  display: inline-flex;
  border: 1px solid #333;
  background: #000;
}

.cmd-bar {
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.prompt {
  color: var(--accent-color);
}

.copy-btn {
  background: #333;
  border: none;
  color: #fff;
  padding: 0 1.5rem;
  font-family: var(--font-mono);
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--accent-color);
  color: #000;
}

/* Demo Terminal */
.terminal-window {
  background: #0e0e0e;
  border: 1px solid #333;
  border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.terminal-header {
  background: #1a1a1a;
  padding: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid #333;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.red {
  background: #ff5f56;
}
.yellow {
  background: #ffbd2e;
}
.green {
  background: #27c93f;
}

.title {
  margin-left: 1rem;
  font-size: 0.8rem;
  color: #666;
}

.terminal-body {
  padding: 1.5rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
}

.line {
  margin-bottom: 0.5rem;
}

.output {
  color: #888;
  padding-left: 1.2rem;
}

.output.success {
  color: var(--secondary-accent);
}

.cursor {
  animation: blink 1s step-end infinite;
  background: #fff;
  color: #000;
  padding: 0 4px;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  border-top: 1px solid var(--accent-color);
  padding-top: 1rem;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.feature-card p {
  color: #888;
  font-size: 0.9rem;
}

/* Footer */
.footer {
  border-top: 1px solid #333;
  padding-top: 2rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.footer-links a:hover {
  border-color: var(--accent-color);
}

.copyright {
  color: #555;
  font-size: 0.8rem;
}

/* Animations */
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Documentation Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid #333;
  padding: 2rem;
  overflow-y: auto;
  background: #050505;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.sidebar-nav a {
  color: #888;
  text-decoration: none;
  font-size: 0.9rem;
  display: block;
  padding: 0.5rem 0;
  transition:
    color 0.2s,
    padding-left 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--text-color);
  padding-left: 1rem;
  border-left-color: var(--accent-color);
}

.doc-content {
  padding: 4rem;
  max-width: 900px;
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.doc-content h1 {
  font-size: 3rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
}

.doc-content h2 {
  font-size: 2rem;
  margin-top: 4rem;
  color: var(--text-color);
}

.doc-content h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  color: #bbb;
}

.doc-content p,
.doc-content li {
  color: #bbb;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.doc-content ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.doc-content code {
  background: #1a1a1a;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--secondary-accent);
  font-size: 0.9em;
}

.doc-content pre {
  background: #0e0e0e;
  border: 1px solid #333;
  padding: 1.5rem;
  border-radius: 4px;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.doc-content pre code {
  background: transparent;
  padding: 0;
  color: #ddd;
}

/* Tables */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.doc-table th,
.doc-table td {
  border: 1px solid #333;
  padding: 1rem;
  text-align: left;
}

.doc-table th {
  background: #111;
  color: var(--accent-color);
  font-family: var(--font-display);
  text-transform: uppercase;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: #666;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent-color);
}

/* Prototype Badge */
.prototype-badge {
  padding: 0.4rem 0.6rem;
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  white-space: nowrap;
  width: fit-content;
}

/* App Dashboard Styles */
.app-body {
  overflow: hidden; /* App feels like a fixed viewport */
}

.app-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  background: #080808;
  border-right: 1px solid #333;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 2rem;
  z-index: 10;
}

.app-logo {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  border-bottom: 1px solid #333;
  padding-bottom: 1rem;
}

.logo-link {
  text-decoration: none;
  color: var(--text-color);
}

.system-status {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.status-item .label {
  font-size: 0.7rem;
  color: #666;
  letter-spacing: 1px;
}

.bar-container {
  height: 4px;
  background: #222;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--secondary-accent);
  transition: width 0.5s ease-out;
}

.status-item .value {
  font-size: 1rem;
  align-self: flex-end;
}

.filter-group h3,
.action-log h3 {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #aaa;
}

.checkbox-wrapper input {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1px solid #444;
  position: relative;
  display: inline-block;
}

.checkbox-wrapper input:checked + .checkmark {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.action-log {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid #222;
  padding-top: 1.5rem;
}

.log-container {
  overflow-y: auto;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.5rem;
}

.log-container::-webkit-scrollbar {
  width: 4px;
}
.log-container::-webkit-scrollbar-thumb {
  background: #333;
}

.log-entry {
  color: #666;
  animation: fadeIn 0.3s ease;
}

.log-entry .time {
  color: #444;
  margin-right: 0.5rem;
}

.log-entry.success {
  color: var(--secondary-accent);
}
.log-entry.warning {
  color: var(--accent-color);
}

/* Main Content */
.app-main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
}

.app-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(5, 5, 5, 0.9);
  backdrop-filter: blur(5px);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #111;
  border: 1px solid #333;
  padding: 0.8rem 1.2rem;
  width: 400px;
}

.search-bar input {
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  width: 100%;
  outline: none;
}

.global-actions {
  display: flex;
  gap: 1rem;
}

.btn-refresh,
.btn-kill-all {
  background: transparent;
  border: 1px solid #333;
  color: #888;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-refresh:hover {
  border-color: var(--secondary-accent);
  color: var(--secondary-accent);
}

.btn-kill-all:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #000;
}

/* Process Grid */
.process-grid {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  overflow-y: auto;
  height: 100%;
}

.process-card {
  background: #0a0a0a;
  border: 1px solid #333;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s,
    border-color 0.2s;
  animation: slideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.process-card:hover {
  border-color: #666;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card-header {
  padding: 1rem;
  border-bottom: 1px solid #222;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f0f0f;
}

.port-number {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--secondary-accent);
}

.protocol-tag {
  font-size: 0.7rem;
  border: 1px solid #444;
  padding: 2px 6px;
  color: #888;
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex-grow: 1;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.info-row .label {
  color: #555;
}

.info-row .value {
  color: #ddd;
}

.card-actions {
  padding: 1rem;
  border-top: 1px solid #222;
}

.btn-kill {
  width: 100%;
  background: transparent;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0.6rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: bold;
  text-transform: uppercase;
  transition: all 0.2s;
}

.btn-kill:hover {
  background: var(--accent-color);
  color: #000;
}

.card-status-line {
  height: 2px;
  background: var(--secondary-accent);
  width: 100%;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Interaction States */
.process-card.terminating {
  border-color: var(--accent-color);
  animation: shake 0.5s infinite;
}

.process-card.terminating .card-body {
  opacity: 0.5;
}

.process-card.killed {
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  transition: all 0.3s;
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

/* Prototype Badge */
.prototype-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--accent-color);
  color: #000;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 1px;
  z-index: 1000;
  box-shadow: 0 0 20px rgba(255, 51, 51, 0.3);
}

@media (max-width: 900px) {
  .app-container {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    display: none; /* Hide sidebar on small screens for this demo */
  }
}
