/* ============================================
   AUTO-NEURAL-LINK — Shared Design System
   ============================================ */

:root {
  --bg-dark: #0a0e17;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e293b;
  --glow-blue: rgba(59, 130, 246, 0.15);
  --glow-cyan: rgba(6, 182, 212, 0.15);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* ---- NAV ---- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
}

nav .nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

nav .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

nav .logo .dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

nav .nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

nav .nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

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

nav .nav-links a.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

/* ---- LAYOUT ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 40px 60px;
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero .badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 500;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #f1f5f9, #3b82f6, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---- SECTION ---- */
section {
  margin-bottom: 60px;
}

section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

section h2 .num {
  font-size: 14px;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

section .section-desc {
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 16px;
}

section h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 30px 0 12px;
  color: var(--text-primary);
}

section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: justify;
}

/* ---- CARDS GRID ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.card .card-icon {
  font-size: 32px;
  margin-bottom: 16px;
  display: block;
}

.card h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text-primary);
}

.card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  text-align: left;
}

.card .card-tag {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.tag-blue { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.tag-cyan { background: rgba(6,182,212,0.12); color: var(--accent-cyan); }
.tag-green { background: rgba(16,185,129,0.12); color: var(--accent-green); }
.tag-orange { background: rgba(245,158,11,0.12); color: var(--accent-orange); }
.tag-purple { background: rgba(139,92,246,0.12); color: var(--accent-purple); }
.tag-red { background: rgba(239,68,68,0.12); color: var(--accent-red); }

/* ---- CALLOUTS ---- */
.callout {
  border-radius: 12px;
  padding: 20px 24px;
  margin: 20px 0;
  border-left: 4px solid;
}

.callout-info {
  background: rgba(59, 130, 246, 0.06);
  border-color: var(--accent-blue);
}

.callout-warn {
  background: rgba(245, 158, 11, 0.06);
  border-color: var(--accent-orange);
}

.callout-danger {
  background: rgba(239, 68, 68, 0.06);
  border-color: var(--accent-red);
}

.callout-success {
  background: rgba(16, 185, 129, 0.06);
  border-color: var(--accent-green);
}

.callout strong {
  color: var(--text-primary);
}

.callout p {
  margin: 0;
  font-size: 14px;
}

/* ---- TABLE ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

th {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  text-align: left;
}

td {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* ---- CODE ---- */
code {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  font-size: 13px;
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ---- LISTS ---- */
ul, ol {
  padding-left: 24px;
  margin: 12px 0;
}

li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 15px;
}

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

/* ---- ROADMAP ---- */
.roadmap {
  position: relative;
  padding-left: 30px;
  margin: 30px 0;
}

.roadmap::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-blue), var(--accent-cyan), var(--accent-green));
}

.roadmap-item {
  position: relative;
  margin-bottom: 28px;
}

.roadmap-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  background: var(--bg-dark);
}

.roadmap-item h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.roadmap-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- SCHEMA / FLOW ---- */
.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
}

.flow-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-left: 2px solid var(--border);
  padding-left: 24px;
  position: relative;
}

.flow-step::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.flow-step .step-num {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.flow-step .step-content h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.flow-step .step-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---- STATS BAR ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 30px 0;
}

.stat {
  text-align: center;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stat .stat-value {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- PIN MAP ---- */
.pin-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.pin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pin code {
  font-size: 12px;
  min-width: 90px;
}

.pin span {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

footer a {
  color: var(--accent-blue);
  text-decoration: none;
}

/* ---- MODE TOGGLE ---- */
.mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  margin-left: 16px;
  flex-shrink: 0;
}

.mode-toggle-track {
  position: relative;
  width: 52px;
  height: 28px;
  background: #1e293b;
  border-radius: 14px;
  border: 1px solid #334155;
  transition: all 0.3s ease;
}

.mode-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.mode-toggle.active .mode-toggle-track {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent-purple);
}

.mode-toggle.active .mode-toggle-thumb {
  left: 27px;
  background: var(--accent-purple);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.mode-toggle-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
  transition: color 0.3s ease;
}

.mode-toggle.active .mode-toggle-label {
  color: var(--accent-purple);
}

/* ---- DEV/USER MODE VISIBILITY ---- */
.dev-only {
  display: none !important;
}

body.dev-mode .dev-only {
  display: block !important;
}

body.dev-mode .dev-only.cards {
  display: grid !important;
}

body.dev-mode .dev-only.flow-steps {
  display: flex !important;
}

body.dev-mode .dev-only.stats {
  display: grid !important;
}

body.dev-mode .dev-only.pin-map {
  display: grid !important;
}

body.dev-mode .user-only {
  display: none !important;
}

/* ---- DEV SECTION STYLING ---- */
.dev-section {
  position: relative;
  border-left: 3px solid var(--accent-purple);
  padding-left: 24px;
  margin-top: 40px;
}

.dev-section::before {
  content: 'DEV';
  position: absolute;
  top: 0;
  left: -3px;
  background: var(--accent-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 0 6px 6px 0;
}

.dev-section h3 {
  margin-top: 24px;
}

.dev-section h3:first-child {
  margin-top: 8px;
}

/* Dev mode indicator on body */
body.dev-mode nav .nav-inner::after {
  content: '';
  display: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  nav { padding: 0 20px; }
  .container { padding: 80px 20px 40px; }
  .hero h1 { font-size: 32px; }
  .cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .mode-toggle-label { display: none; }
  .mode-toggle { margin-left: 8px; }
}
