/* ============================================
   IRON FORGE Design System
   Superpowers Guide - Vietnamese Documentation
   Theme: Red/Green/Violet = TDD Phases
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --red: #dc2626;
  --red-glow: rgba(220,38,38,0.15);
  --red-soft: rgba(220,38,38,0.08);
  --green: #16a34a;
  --green-glow: rgba(22,163,74,0.15);
  --green-soft: rgba(22,163,74,0.08);
  --violet: #7c3aed;
  --violet-glow: rgba(124,58,237,0.15);
  --violet-soft: rgba(124,58,237,0.08);
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface-hover: #22222e;
  --text: #e8e6e3;
  --text-muted: #6b7280;
  --border: rgba(220,38,38,0.12);
  --gold: #fbbf24;
  --font-heading: 'JetBrains Mono', monospace;
  --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: 260px; height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-title {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--red);
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.sidebar a {
  display: block;
  padding: 8px 20px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all 0.2s;
}
.sidebar a:hover, .sidebar a.active {
  color: var(--text);
  background: var(--red-soft);
  border-left-color: var(--red);
}

/* ---- OVERLAY ---- */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); z-index: 99;
}
.overlay.open { display: block; }

/* ---- AUTHOR BAR ---- */
.author-bar {
  position: fixed; top: 0; right: 0;
  writing-mode: vertical-rl;
  padding: 16px 10px;
  font-size: 13px; font-weight: 600;
  color: var(--gold);
  background: rgba(26,26,36,0.9);
  backdrop-filter: blur(10px);
  border-left: 1px solid rgba(251,191,36,0.2);
  border-bottom: 1px solid rgba(251,191,36,0.2);
  border-radius: 0 0 0 12px;
  z-index: 101;
  text-decoration: none;
  letter-spacing: 1px;
  transition: background 0.3s;
}
.author-bar:hover {
  background: rgba(251,191,36,0.1);
  color: #fcd34d;
}

/* ---- MAIN CONTENT ---- */
.main { margin-left: 260px; padding: 40px 48px 100px; max-width: 900px; }

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 60px 0 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.hero-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 11px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid var(--red-glow);
  padding: 4px 14px;
  border-radius: 20px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--red), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.stat {
  text-align: center;
  padding: 16px 24px;
  background: var(--surface);
  border-radius: 12px;
  border-top: 3px solid var(--red);
  min-width: 120px;
}
.stat-num {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--red);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.hero-meta {
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.hero-meta a {
  color: var(--violet);
  text-decoration: none;
}
.hero-meta a:hover { text-decoration: underline; }

/* ---- HEADINGS ---- */
h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text);
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--red-glow);
}
h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--red);
  margin: 28px 0 12px;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--violet);
  margin: 20px 0 8px;
}

/* ---- PARAGRAPHS & LISTS ---- */
p { margin-bottom: 14px; }
ul, ol { padding-left: 24px; margin-bottom: 14px; }
li { margin-bottom: 6px; }
strong { color: #f3f1ef; }

/* ---- SKILL CARDS ---- */
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: transform 0.2s, border-color 0.2s;
}
.skill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(220,38,38,0.3);
}
.skill-card.green { border-left-color: var(--green); }
.skill-card.violet { border-left-color: var(--violet); }
.skill-card h4 {
  font-family: var(--font-heading);
  font-size: 15px;
  margin: 0 0 8px;
}
.skill-card p { color: var(--text-muted); font-size: 14px; margin: 0; }

/* ---- CODE BLOCKS ---- */
.iron-law {
  background: var(--red-soft);
  border: 1px solid var(--red-glow);
  border-radius: 8px;
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--red);
  text-align: center;
  margin: 20px 0;
  letter-spacing: 0.5px;
}
code {
  font-family: var(--font-heading);
  font-size: 13px;
  background: rgba(124,58,237,0.1);
  color: var(--violet);
  padding: 2px 6px;
  border-radius: 4px;
}
pre {
  background: #12121a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 13px;
}
pre code { background: none; padding: 0; color: var(--green); }

/* ---- TAG BADGES ---- */
.tag {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-right: 6px;
  vertical-align: middle;
}
.tag-red { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-glow); }
.tag-green { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-glow); }
.tag-violet { background: var(--violet-soft); color: var(--violet); border: 1px solid var(--violet-glow); }

/* ---- TABLES ---- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}
th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--red);
  font-family: var(--font-heading);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--red-glow);
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
tr:hover td { background: var(--red-soft); }

/* ---- BLOCKQUOTES ---- */
blockquote {
  border-left: 3px solid var(--violet);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--violet-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ---- WORKFLOW STEP ---- */
.workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.step-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  background: var(--red-soft);
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  flex-shrink: 0;
}
.step-content h4 { margin-top: 0; }
.step-content p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ---- TDD PHASE CARDS ---- */
.tdd-phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.tdd-phase {
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}
.tdd-phase.red {
  background: var(--red-soft);
  border: 1px solid var(--red-glow);
}
.tdd-phase.green {
  background: var(--green-soft);
  border: 1px solid var(--green-glow);
}
.tdd-phase.refactor {
  background: var(--violet-soft);
  border: 1px solid var(--violet-glow);
}
.tdd-phase h4 { margin: 0 0 8px; font-size: 16px; }
.tdd-phase.red h4 { color: var(--red); }
.tdd-phase.green h4 { color: var(--green); }
.tdd-phase.refactor h4 { color: var(--violet); }
.tdd-phase p { font-size: 13px; color: var(--text-muted); margin: 0; }

/* ---- HAMBURGER ---- */
.hamburger {
  display: none;
  position: fixed; top: 12px; left: 12px;
  z-index: 102;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--red);
  font-size: 22px;
  width: 44px; height: 44px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center; justify-content: center;
}

/* ---- JUMP TO TOP ---- */
#jump-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  background: var(--red);
  color: #fff;
  border: none; border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 90;
  opacity: 0.8;
  transition: opacity 0.3s, transform 0.3s;
}
#jump-top:hover { opacity: 1; transform: scale(1.1); }

/* ---- MOBILE ---- */
@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .main { margin-left: 0; padding: 60px 16px 100px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 12px; }
  .stat { min-width: 90px; padding: 12px 16px; }
  .stat-num { font-size: 22px; }
  .author-bar {
    position: fixed; top: 0; left: 0; right: 0;
    writing-mode: horizontal-tb;
    text-align: center;
    padding: 8px;
    border-radius: 0;
    border-left: none;
    border-bottom: 1px solid rgba(251,191,36,0.2);
    font-size: 12px;
    z-index: 98;
  }
  .tdd-phases { grid-template-columns: 1fr; }
  h2 { font-size: 1.3rem; }
  table { font-size: 12px; }
  th, td { padding: 8px 10px; }
  #jump-top { bottom: 20px; right: 16px; }
}
