/* =============================================
   Git Mastery Course — Shared Styles
   Dark terminal theme, split-pane layout
   ============================================= */

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

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #21262d;
  --border:    #30363d;
  --text:      #c9d1d9;
  --muted:     #8b949e;
  --accent:    #4ade80;
  --accent2:   #6366f1;
  --warn:      #f59e0b;
  --danger:    #ef4444;
  --terminal:  #010409;
  --font-mono: 'Courier New', Courier, monospace;
  --font-ui:   system-ui, -apple-system, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Nav ---- */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.05rem;
}

.nav-logo svg { flex-shrink: 0; }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--surface2); }

/* ---- Main layout ---- */
.page-main { flex: 1; }

/* ---- Hero (landing) ---- */
.hero {
  padding: 4rem 2rem 3rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: Verdana, Geneva, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.12;
  color: #fff;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--accent); }

.hero p {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}

.hero-badges {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.badge.green { border-color: var(--accent); color: var(--accent); }

/* ---- Progress bar ---- */
.prog-bar-wrap {
  background: var(--surface2);
  border-radius: 8px;
  height: 8px;
  max-width: 400px;
  margin: 0 auto 0.5rem;
  position: relative;
  overflow: hidden;
}

.prog-bar-fill {
  background: var(--accent);
  height: 100%;
  border-radius: 8px;
  transition: width 0.4s ease;
}

.prog-bar-label {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---- Module grid ---- */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  padding: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
}

.module-card:hover {
  border-color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(99,102,241,0.15);
}

.module-card.done { border-color: var(--accent); }
.module-card.locked { opacity: 0.45; pointer-events: none; }

.module-card .mod-num {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.module-card h3 {
  font-size: 1rem;
  color: #fff;
  line-height: 1.3;
}

.module-card p {
  font-size: 0.85rem;
  color: var(--muted);
}

.module-card .mod-badge {
  margin-top: auto;
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  width: fit-content;
}

.module-card.done .mod-badge {
  background: rgba(74,222,128,0.1);
  color: var(--accent);
  border-color: var(--accent);
}

.mod-tick {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 1.1rem;
  color: var(--accent);
}

/* ---- Module page layout ---- */
.module-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.lesson-pane {
  overflow-y: auto;
  padding: 2rem 2.5rem;
  border-right: 1px solid var(--border);
}

.practice-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--terminal);
}

/* ---- Lesson pane ---- */
.lesson-pane h1 {
  font-family: Verdana, Geneva, sans-serif;
  font-size: 1.5rem;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 0.5rem;
}

.mod-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
}

.lesson-pane h2 {
  font-size: 1rem;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.lesson-pane h3 {
  font-size: 1rem;
  color: #e2e8f0;
  margin: 1.2rem 0 0.4rem;
}

.lesson-pane p { margin-bottom: 0.8rem; color: var(--text); font-size: 0.95rem; }

.lesson-pane ul, .lesson-pane ol {
  margin: 0.5rem 0 0.8rem 1.5rem;
  color: var(--text);
  font-size: 0.95rem;
}

.lesson-pane li { margin-bottom: 0.25rem; }

.lesson-pane code {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.lesson-pane pre {
  background: var(--terminal);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--accent);
}

.lesson-pane pre .muted { color: var(--muted); }
.lesson-pane pre .warn  { color: var(--warn); }

.callout {
  background: rgba(74,222,128,0.07);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  font-size: 0.9rem;
}

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

.callout.info {
  background: rgba(99,102,241,0.07);
  border-color: var(--accent2);
}

/* ---- Diagram area ---- */
.diagram-area {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  min-height: 100px;
  overflow-x: auto;
}

.graph-empty {
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* ---- Challenges ---- */
.challenges {
  margin-top: 1.5rem;
}

.challenges h2 {
  font-size: 0.75rem;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.challenge-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.9rem;
}

.challenge-item.done {
  border-color: var(--accent);
  background: rgba(74,222,128,0.07);
}

.ch-icon {
  font-size: 1rem;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 1.2rem;
  text-align: center;
}

.challenge-item.done .ch-icon { color: var(--accent); }

.ch-text { color: var(--muted); }
.challenge-item.done .ch-text { color: var(--text); }

/* ---- Success banner ---- */
.success-banner {
  display: none;
  background: rgba(74,222,128,0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  color: var(--accent);
  font-size: 0.9rem;
}

.success-banner.visible { display: block; }

/* ---- Module nav ---- */
.module-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: #0d1117;
  border-color: var(--accent);
}

.btn-primary:hover { background: #22c55e; border-color: #22c55e; }

.btn-ghost { color: var(--muted); background: transparent; }
.btn-ghost:hover { color: var(--text); background: var(--surface2); }

.btn:disabled, .btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---- Practice pane ---- */
.practice-header {
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.practice-header .dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red   { background: #ef4444; }
.dot-yellow{ background: #f59e0b; }
.dot-green { background: #4ade80; }

.terminal-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.5rem;
}

.terminal-output {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  color: #c9d1d9;
}

.terminal-line { white-space: pre-wrap; word-break: break-all; }
.terminal-cmd  { color: #e2e8f0; margin-top: 0.25rem; }
.terminal-output-line { color: var(--text); }
.terminal-info { color: var(--accent); }

.terminal-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  background: var(--terminal);
  border-top: 1px solid var(--border);
}

.terminal-prompt {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  caret-color: var(--accent);
}

.terminal-input::placeholder { color: var(--muted); opacity: 0.5; }

/* ---- ANSI colours ---- */
.ansi-red    { color: #ef4444; }
.ansi-green  { color: #4ade80; }
.ansi-yellow { color: #f59e0b; }
.ansi-cyan   { color: #22d3ee; }
.ansi-bold   { font-weight: bold; }

/* ---- Concept diagram boxes ---- */
.concept-flow {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.cf-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text);
  text-align: center;
}

.cf-box.hl { border-color: var(--accent2); color: var(--accent2); }
.cf-box.active { border-color: var(--accent); color: var(--accent); }

.cf-arrow { color: var(--muted); font-size: 1rem; }

/* ---- GitHub walkthrough steps ---- */
.steps { list-style: none; margin: 0; padding: 0; }

.steps li {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.step-num {
  background: var(--accent2);
  color: #fff;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-body { flex: 1; font-size: 0.9rem; padding-top: 0.1rem; }

/* ---- Footer ---- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: auto;
  font-size: 0.85rem;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-superpowers h4 {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.footer-superpowers ul { list-style: none; display: flex; gap: 1.2rem; flex-wrap: wrap; }

.footer-superpowers a {
  color: var(--accent2);
  text-decoration: none;
  font-size: 0.82rem;
}

.footer-superpowers a:hover { text-decoration: underline; }

.footer-copy {
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-copy a { color: var(--muted); }
.footer-copy a:hover { color: var(--text); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .module-page {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .lesson-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.25rem;
  }

  .practice-pane {
    height: 50vh;
  }

  .module-grid { padding: 1rem; gap: 0.75rem; }

  .hero { padding: 2.5rem 1rem 2rem; }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
