/* Aula Programação – tema estilo GitHub (escuro, limpo, monospace para código) */
:root {
  --bg-page: #0d1117;
  --bg-sidebar: #161b22;
  --bg-content: #0d1117;
  --bg-code: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
  --sidebar-width: 260px;
  --header-height: 56px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-section {
  width: 100%;
  padding: 8px 20px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-section:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}

.nav-section::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s;
}

.nav-section[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.nav-sub {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}

.nav-sub.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-sub:not(.collapsed) {
  max-height: 70vh;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  padding: 6px 20px 6px 32px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}

/* Main content */
.content {
  flex: 1;
  padding: 32px 40px 48px;
  max-width: 900px;
  margin: 0 auto;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.content h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.content h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--text);
}

.content p {
  margin: 0 0 12px;
  color: var(--text);
}

.content ul,
.content ol {
  margin: 0 0 12px;
  padding-left: 24px;
}

/* Comando / definição list */
.cmd-list {
  margin: 12px 0 24px;
}

.cmd-list dt {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
}

.cmd-list dt:first-child {
  margin-top: 0;
}

.cmd-list dd {
  margin: 4px 0 0 0;
  padding-left: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Inline code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Code block */
pre {
  margin: 16px 0 24px;
  padding: 16px 20px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: 0.85rem;
  line-height: 1.5;
}

var {
  font-family: var(--font-mono);
  font-style: normal;
  color: var(--orange);
}

/* Bloco pergunta e resposta (Git fácil, etc.) */
.qa-block {
  margin: 24px 0;
  padding: 16px 20px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.qa-block h2,
.qa-block h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: var(--accent);
}

.qa-block .qa-answer {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.qa-block .qa-answer p {
  margin: 0 0 8px;
}

.qa-block pre {
  margin: 12px 0 0;
}

/* Caixa de exercício ao final do tópico */
.exercise-box {
  margin: 28px 0 0;
  padding: 20px 24px;
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.35);
  border-radius: 8px;
  border-left: 4px solid var(--green);
}

.exercise-box .exercise-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--green);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exercise-box p {
  margin: 0 0 8px;
  color: var(--text);
}

.exercise-box .exercise-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Exemplo de código Python (opcional, reaproveita pre) */
.code-example {
  margin: 16px 0 24px;
}

/* Responsivo: sidebar vira top bar ou colapsável */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 50vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: 24px 20px 40px;
  }
}
