:root {
  /* Color Palette - Earthy High-Tech */
  --bg-dark: #0a0f0d;
  --bg-card: #141c18;
  --accent-primary: #00ff88; /* Cyber Lime */
  --accent-secondary: #00d4ff; /* Tech Blue */
  --text-main: #e0f2f1;
  --text-muted: #88a096;
  --border-color: rgba(0, 255, 136, 0.2);
  --glass-bg: rgba(20, 28, 24, 0.8);
  
  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  
  /* Typography */
  --font-display: 'Syncopate', sans-serif;
  --font-body: 'Outfit', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 255, 136, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 40%);
}

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

header {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
}

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

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 2px;
  color: var(--accent-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-primary);
}

/* Page Hero */
.hero {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: var(--space-sm);
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.2rem;
}

/* Diagram Section */
.diagram-section {
  margin-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

.diagram-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

/* Architecture Specific Styles */
.arch-grid {
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: var(--space-lg);
  padding: var(--space-md);
  position: relative;
}

.layer {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.layer-label {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
  color: var(--accent-primary);
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 2px;
  opacity: 0.5;
}

.node {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 8px;
  padding: var(--space-sm) var(--space-md);
  min-width: 160px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
  position: relative;
}

.node:hover {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.node.ai {
  border-color: var(--accent-secondary);
}

.node.ai:hover {
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.node h3 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.node p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Flow Arrows using pseudo-elements and SVG */
.flow-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* UI Elements */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.badge-green { background: rgba(0, 255, 136, 0.1); color: var(--accent-primary); border: 1px solid var(--accent-primary); }
.badge-blue { background: rgba(0, 212, 255, 0.1); color: var(--accent-secondary); border: 1px solid var(--accent-secondary); }

/* Sidebar Controls */
.diagram-controls {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  justify-content: center;
}

.btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.3s ease;
  text-decoration: none;
  font-size: 0.8rem;
}

.btn:hover, .btn.active {
  background: var(--accent-primary);
  color: var(--bg-dark);
}

/* Footer */
footer {
  margin-top: var(--space-xl);
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Utility */
.placeholder-icon {
  width: 24px;
  height: 24px;
  margin: 0 auto 8px;
  opacity: 0.7;
}

/* Workflow Styles */
.workflow-timeline {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}
.workflow-timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
    opacity: 0.3;
}
.flow-step {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 1;
}
.step-num {
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-primary);
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}
.step-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 8px;
    flex-grow: 1;
}
.step-content h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--accent-primary);
}
.step-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.flow-branch {
    padding-left: 62px;
    display: flex;
    gap: 15px;
    margin-top: -10px;
    margin-bottom: 10px;
}
.branch-card {
    background: rgba(0, 212, 255, 0.05);
    border: 1px dashed var(--accent-secondary);
    padding: 10px;
    border-radius: 6px;
    flex: 1;
    font-size: 0.8rem;
}

/* Logistics Styles */
.pricing-model {
    display: grid;
    grid-template-columns: 1fr auto 1.2fr;
    gap: 40px;
    align-items: center;
    padding: 40px;
}
.inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.input-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.input-block h4 { font-size: 0.7rem; color: var(--accent-secondary); text-transform: uppercase; margin-top: 8px; }
.input-block.wide { grid-column: span 2; }

.engine-block {
    background: linear-gradient(135deg, var(--bg-card), #1a2521);
    border: 2px solid var(--accent-primary);
    padding: 40px 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
    position: relative;
}
.engine-block::after {
    content: 'f(x)';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--accent-primary);
    color: var(--bg-dark);
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
}
.formula {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    margin-top: 15px;
    color: var(--text-muted);
    background: rgba(0,0,0,0.3);
    padding: 10px;
    border-radius: 4px;
}
.output-block {
    background: var(--accent-primary);
    color: var(--bg-dark);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}
.output-block h2 { font-family: var(--font-display); font-size: 1.2rem; }
.output-price { font-size: 2.5rem; font-weight: 700; margin: 10px 0; }
.output-meta { font-size: 0.8rem; opacity: 0.8; }

/* Fraud Styles */
.fraud-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}
.fraud-layer {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.fraud-layer::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-secondary);
    border-radius: 2px 0 0 2px;
}
.fraud-layer.active { border-color: var(--accent-primary); }
.layer-info h4 { font-size: 0.8rem; color: var(--accent-secondary); letter-spacing: 1px; margin-bottom: 2px; }
.layer-info p { font-size: 1rem; font-weight: 700; }
.layer-status { font-size: 0.7rem; color: var(--accent-primary); background: rgba(0, 255, 136, 0.1); padding: 4px 8px; border-radius: 4px; }
.layer-status.warning { color: #ffcc00; border: 1px solid #ffcc00; background: transparent; }

.scoring-engine {
    margin-top: 40px;
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--accent-secondary);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}
.score-viz {
    height: 10px;
    background: #222;
    border-radius: 5px;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}
.score-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 75%;
    background: linear-gradient(90deg, #00ff88, #ffcc00, #ff4444);
}
.score-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); }
.threshold-grid { margin-top: 30px; display: flex; gap: 20px; justify-content: center; }
.threshold-card { padding: 10px 20px; border-radius: 4px; border: 1px solid var(--border-color); }
.threshold-card.success { background: rgba(0,255,136,0.1); border-color: var(--accent-primary); }
.threshold-card.alert { background: rgba(255,68,68,0.1); border-color: #ff4444; }
.threshold-label { font-size: 0.6rem; }
.threshold-value { font-weight: 700; }

/* Escrow Styles */
.escrow-flow {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 20px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}
.wallet-node {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}
.wallet-node.highlight {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}
.wallet-fee { font-size: 0.6rem; margin-top: 10px; border-top: 1px solid rgba(0,255,136,0.2); padding-top: 10px; }
.flow-arrows-v { display: flex; flex-direction: column; gap: 40px; padding: 0 20px; }
.arrow-path {
    position: relative;
    height: 2px;
    background: var(--text-muted);
    opacity: 0.3;
}
.arrow-path::after {
    content: '→';
    position: absolute;
    right: -10px;
    top: -12px;
    font-size: 1.2rem;
}
.label-tag {
    font-size: 0.7rem;
    background: var(--bg-dark);
    padding: 2px 8px;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}
.decision-wrapper { max-width: 400px; margin: 40px auto; text-align: center; }
.decision-box {
    border: 1px solid var(--accent-secondary);
    padding: 15px;
    background: rgba(0, 212, 255, 0.05);
}
.decision-options { display: flex; gap: 20px; justify-content: center; margin-top: 15px; }
.option-yes { color: var(--accent-primary); }
.option-no { color: #ff4444; }
.settlement-path { grid-column: 2 / 3; display: flex; flex-direction: column; align-items: center; }
.settlement-line { width: 2px; height: 60px; background-image: linear-gradient(var(--accent-primary) 33%, rgba(255,255,255,0) 0%); background-size: 2px 10px; background-repeat: repeat-y; }
.escrow-footer { margin-top: 40px; text-align: center; color: var(--text-muted); font-size: 0.8rem; }

/* Database Styles */
.erd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 40px;
}
.entity-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.entity-header {
    background: rgba(0, 255, 136, 0.1);
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}
.entity-header h4 { font-size: 0.8rem; letter-spacing: 1px; }
.entity-fields { padding: 10px 15px; }
.field {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.field span:last-child { color: var(--text-muted); }
.pk { color: var(--accent-secondary); font-weight: 700; }
.fk { color: var(--accent-primary); }
.relation-wrapper { display: flex; align-items: center; justify-content: center; flex-direction: column; }
.relation-line-text { text-align: center; font-size: 0.7rem; color: var(--accent-primary); margin: 10px 0; }
.relation-hr { height: 1px; width: 100%; background: var(--border-color); }
