:root {
  --bg-dark: #0f1724;
  --bg-light: #f8fafc;
  --card-dark: #0b1220;
  --card-light: #ffffff;
  --text-dark: #e6eef8;
  --text-light: #1e293b;
  --muted-dark: #94a3b8;
  --muted-light: #64748b;
  --btn-border: rgba(255, 255, 255, 0.06);
}

/* Base layout */
body {
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 2rem;
  transition: background 0.3s, color 0.3s;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* Dark mode */
body.dark {
  background: linear-gradient(180deg, var(--bg-dark) 0%, #08122a 100%);
  color: var(--text-dark);
}

body.dark .card {
  background: var(--card-dark);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.6);
}

body.dark .btn {
  border-color: var(--btn-border);
  color: var(--muted-dark);
}

/* Light mode */
body.light {
  background: var(--bg-light);
  color: var(--text-light);
}

body.light .card {
  background: var(--card-light);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

body.light .btn {
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--muted-light);
}

/* Shared components */
.card {
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

pre {
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Roboto Mono, monospace;
  font-size: 0.95rem;
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.note, footer {
  color: var(--muted-dark);
  font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   Shell Syntax Theme (per page theme)
──────────────────────────────────────────────*/

/* Dark theme shell colors */
body.dark {
  --shell-comment: #6b7280;     /* gray */
  --shell-command: #38bdf8;     /* cyan-blue */
  --shell-variable: #facc15;    /* yellow */
  --shell-string: #a7f3d0;      /* mint-green */
  --shell-option: #f472b6;      /* pink */
  --shell-text: #e6eef8;
}

/* Light theme shell colors */
body.light {
  --shell-comment: #748398;     /* lighter gray */
  --shell-command: #2563eb;     /* blue */
  --shell-variable: #ca8a04;    /* gold */
  --shell-string: #047857;      /* green */
  --shell-option: #be185d;      /* magenta */
  --shell-text: #1e293b;
}

/* Apply syntax variables */
.language-shell {
  color: var(--shell-text);
}

.language-shell .comment {
  color: var(--shell-comment);
  font-style: italic;
}

.language-shell .command {
  color: var(--shell-command);
}

.language-shell .variable {
  color: var(--shell-variable);
}

.language-shell .string {
  color: var(--shell-string);
}

.language-shell .option {
  color: var(--shell-option);
}

/* ───────────────────────────────
   Code block hover + copy button
──────────────────────────────── */

.code-block {
  position: relative;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  transition: background 0.2s ease;
}

.code-block:hover {
  background: rgba(0, 0, 0, 0.25);
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s;
}

/* Show only on hover */
.code-block:hover .copy-btn {
  opacity: 1;
}

/* Dark theme button colors */
body.dark .copy-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

/* Light theme button colors */
body.light .copy-btn {
  background: rgba(0, 0, 0, 0.05);
  color: #334155;
}

/* Button hover states */
.copy-btn:hover {
  background: rgba(100, 116, 139, 0.3);
}
