/* ═══════════════════════════════════════════════════════
   LESSON.CSS — Estilos compartilhados de todas as aulas
   SO2 · cesarazevedo.github.io/so2
   ═══════════════════════════════════════════════════════ */

/* ── VARIÁVEIS ── */
:root {
    --primary:   #667eea;
    --secondary: #764ba2;
    --bg-light:  #f4f7fe;
    --text-dark: #2d3748;
}

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

/* ── BASE ── */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
}

/* ── TOP BAR ── */
.top-bar {
    background: white;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background .3s;
}
.back-btn:hover { background: rgba(102,126,234,.08); }

.page-badge {
    font-size: .8em;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(102,126,234,.12);
    color: var(--primary);
    font-weight: 600;
}

/* ── SLIDE TOGGLE BUTTON ── */
/* (.slide-toggle defined in slide-mode.css — this is the inline variant) */
.slide-toggle-btn {
    margin-left: auto;
    padding: 8px 18px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    font-size: .9em;
    border-radius: 8px;
    cursor: pointer;
    transition: all .3s;
}
.slide-toggle-btn:hover { background: var(--primary); color: white; }

/* ── LAYOUT ── */
.content-wrapper { max-width: 800px; margin: 40px auto; padding: 0 30px; }

/* Hero — estilo 1 (h1 + .subtitle) */
.lesson-hero {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,.05);
    margin-bottom: 30px;
    border-top: 4px solid var(--primary);
}
.lesson-hero h1 { font-size: 2em; margin-bottom: 10px; color: var(--primary); }
.lesson-hero .subtitle { font-size: 1.05em; color: #718096; }

/* Hero — estilo 2 (.hero-badge + .hero-title + .hero-sub) */
.hero-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .75em;
    font-weight: 700;
    letter-spacing: .04em;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.hero-title { font-size: 2em; color: var(--primary); margin-bottom: 8px; }
.hero-sub   { font-size: 1.05em; color: #718096; }

/* ── CONTENT CARD ── */
.content-card {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 5px 15px rgba(0,0,0,.05);
    margin-bottom: 25px;
}
.content-card h2,
.card-title {
    font-size: 1.4em;
    color: var(--primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.content-card h3 { font-size: 1.05em; color: #5a67d8; margin: 20px 0 10px; }
.content-card p  { margin-bottom: 15px; text-align: justify; }
ul, ol { margin: 10px 0 15px 25px; }
li { margin-bottom: 8px; }

/* ── CAIXAS ── */
.highlight-box {
    background: linear-gradient(135deg,rgba(102,126,234,.05),rgba(118,75,162,.06));
    border-left: 4px solid var(--primary);
    padding: 20px 25px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}
.highlight-box p { margin-bottom: 0; font-style: italic; }

.alert-box {
    background: #fff8e1;
    border-left: 4px solid #f59e0b;
    padding: 18px 22px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}
.alert-box p { margin: 0; color: #78350f; font-size: .93em; }

.tip-box {
    background: #f0fdf4;
    border-left: 4px solid #16a34a;
    padding: 18px 22px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
}
.tip-box p { margin: 0; color: #14532d; font-size: .93em; }

/* ── TERMINAIS — estilo 1 (.terminal + .terminal-bar) ── */
.terminal {
    background: #1a202c;
    border-radius: 12px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.terminal-bar {
    background: #2d3748;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red    { background: #fc8181; }
.term-dot.yellow { background: #f6e05e; }
.term-dot.green  { background: #68d391; }
.term-title {
    font-size: .75em;
    color: #718096;
    margin-left: 8px;
    font-family: 'Consolas', monospace;
}

/* ── TERMINAIS — estilo 2 (.terminal-block + .terminal-header) ── */
.terminal-block {
    background: #1a202c;
    border-radius: 12px;
    overflow: hidden;
    margin: 16px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.terminal-header {
    background: #2d3748;
    padding: 8px 16px;
    font-size: .78em;
    color: #a0aec0;
    font-family: 'Consolas', monospace;
}

/* ── CORPO DO TERMINAL (compartilhado) ── */
.terminal-body {
    padding: 20px 24px;
    font-family: 'Courier New','Consolas',monospace;
    font-size: .92em;
    line-height: 2;
    color: #a0aec0;
    white-space: pre-wrap;
}

/* ── CORES DO TERMINAL ── */
.t-prompt  { color: #63b3ed; }
.t-root    { color: #fc8181; }
.t-cmd     { color: #38ef7d; }
.t-flag    { color: #f6e05e; }
.t-path    { color: #fc8181; }
.t-arg     { color: #90cdf4; }
.t-out     { color: #a0aec0; }
.t-comment { color: #4a5568; font-style: italic; }
.t-kw      { color: #f687b3; font-weight: bold; }
.t-str     { color: #68d391; }
.t-string  { color: #68d391; }
.t-var     { color: #fbd38d; }
.t-section { color: #f687b3; font-weight: bold; }
.t-tag     { color: #63b3ed; }
.t-attr    { color: #fbd38d; }
.t-rtype   { color: #63b3ed; font-weight: bold; }
.t-shebang { color: #f687b3; }
.t-ok      { color: #38ef7d; font-weight: bold; }
.t-err     { color: #fc8181; font-weight: bold; }

/* YAML (Netplan) */
.yaml-key   { color: #63b3ed; }
.yaml-value { color: #68d391; }
.yaml-hl    { color: #fbd38d; font-weight: bold; }

/* ── TABELA ── */
.cmp-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: .88em; }
.cmp-table th {
    background: var(--primary);
    color: white;
    padding: 10px 14px;
    text-align: left;
}
.cmp-table th:first-child { border-radius: 6px 0 0 0; }
.cmp-table th:last-child  { border-radius: 0 6px 0 0; }
.cmp-table td { padding: 9px 14px; border-bottom: 1px solid #e5e7eb; }
.cmp-table tr:nth-child(even) td { background: #f8f7ff; }
.cmp-table td code {
    font-family: 'Consolas',monospace;
    background: #1e293b;
    color: #a78bfa;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: .88em;
}

/* ── GRID DE COMANDOS ── */
.cmd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(130px,1fr));
    gap: 12px;
    margin: 16px 0;
}
.cmd-card {
    background: #f8f7ff;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    border-top: 3px solid var(--primary);
}
/* estilo 1 — .cmd / strong / span */
.cmd-card .cmd {
    font-family: 'Consolas',monospace;
    font-size: .82em;
    color: var(--primary);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}
.cmd-card strong { display: block; font-size: .82em; color: #1e293b; margin-bottom: 4px; }
.cmd-card > span { font-size: .76em; color: #475569; }
/* estilo 2 — .cmd-name / .cmd-desc */
.cmd-card .cmd-name {
    font-family: 'Consolas',monospace;
    font-size: .85em;
    color: var(--primary);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}
.cmd-card .cmd-desc { font-size: .78em; color: #475569; line-height: 1.5; }

/* ── FLUXO DE PASSOS ── */
.flow-steps { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f8f7ff;
    border-radius: 10px;
    padding: 14px 18px;
}
.flow-num {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    font-size: .8em;
    font-weight: 700;
    flex-shrink: 0;
}
.flow-step p { margin: 0; font-size: .9em; }

/* ── PASSO BADGE ── */
.step-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: .85em;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

/* ── DORA CARDS ── */
.dora-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(160px,1fr));
    gap: 12px;
    margin: 16px 0;
}
.dora-card { border-radius: 12px; padding: 18px; text-align: center; }
.dora-card.d { background: #eff6ff; border-top: 3px solid #3b82f6; }
.dora-card.o { background: #fefce8; border-top: 3px solid #eab308; }
.dora-card.r { background: #f0fdf4; border-top: 3px solid #16a34a; }
.dora-card.a { background: #fdf4ff; border-top: 3px solid #a855f7; }
.dora-card .dora-letter { font-size: 2em; font-weight: 900; margin-bottom: 4px; }
.dora-card.d .dora-letter { color: #3b82f6; }
.dora-card.o .dora-letter { color: #eab308; }
.dora-card.r .dora-letter { color: #16a34a; }
.dora-card.a .dora-letter { color: #a855f7; }
.dora-card strong { display: block; font-size: .85em; margin-bottom: 6px; }
.dora-card p { font-size: .78em; color: #475569; margin: 0; text-align: center; }

/* ── COMPARAÇÃO ── */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.compare-box { border-radius: 12px; padding: 18px; }
.compare-box.green { background: #f0fdf4; border-top: 3px solid #16a34a; }
.compare-box.red   { background: #fff5f5; border-top: 3px solid #ef4444; }
.compare-box.blue  { background: #eff6ff; border-top: 3px solid #3b82f6; }
.compare-box h4 { font-size: .95em; margin-bottom: 10px; }
.compare-box.green h4 { color: #065f46; }
.compare-box.red   h4 { color: #7f1d1d; }
.compare-box.blue  h4 { color: #1e3a8a; }

/* ── DISTROS ── */
.distro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 14px 0 20px;
}
.distro-item {
    background: white;
    border-radius: 14px;
    padding: 18px 14px;
    text-align: center;
    border-top: 3px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: transform .2s, box-shadow .2s;
}
.distro-item:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(102,126,234,.18); }
.d-icon { font-size: 2em; margin-bottom: 8px; display: block; }
.distro-item strong { display: block; font-size: .93em; margin-bottom: 6px; color: var(--text-dark); }
.distro-item span { font-size: .82em; color: #64748b; line-height: 1.4; }
.distro-item.di-ubuntu { border-top-color: #f97316; }
.distro-item.di-mint   { border-top-color: #16a34a; }
.distro-item.di-zorin  { border-top-color: #3b82f6; }
.distro-item.di-redhat { border-top-color: #ef4444; }
.distro-item.di-debian { border-top-color: #6366f1; }
.distro-item.di-rocky  { border-top-color: #0d9488; }

/* ── STAT GRID ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}
.stat-item {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    padding: 22px 10px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 14px rgba(102,126,234,.3);
}
.s-num   { font-size: 2.1em; font-weight: 900; line-height: 1; margin-bottom: 6px; }
.s-label { font-size: .74em; opacity: .92; line-height: 1.4; }

/* ── VANTAGENS (grid 2 colunas) ── */
.vantagens-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.vant-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f8f7ff;
    border-radius: 12px;
    padding: 14px 16px;
}
.vi-icon { font-size: 1.4em; flex-shrink: 0; margin-top: 2px; }
.vant-item strong { display: block; font-size: .9em; margin-bottom: 3px; }
.vant-item span   { font-size: .82em; color: #64748b; line-height: 1.4; }

/* ── RAZÕES CLI ── */
.razoes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.razao-item {
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    border-radius: 0 12px 12px 0;
    padding: 14px 16px;
}
.ri-icon { font-size: 1.4em; display: block; margin-bottom: 6px; }
.razao-item strong { display: block; font-size: .9em; margin-bottom: 3px; color: #0c4a6e; }
.razao-item span   { font-size: .82em; color: #475569; line-height: 1.4; }

/* ── QUEM USA LINUX ── */
.uso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 14px 0;
}
.uso-item {
    background: #f8f7ff;
    border-radius: 12px;
    padding: 14px 10px;
    text-align: center;
    border-bottom: 3px solid var(--primary);
}
.ui-icon { font-size: 1.8em; display: block; margin-bottom: 6px; }
.uso-item strong { display: block; font-size: .85em; color: var(--text-dark); margin-bottom: 4px; }
.uso-item p { font-size: .78em; color: #64748b; margin: 0; line-height: 1.4; }

/* ── COMO BUSCAR AJUDA ── */
.ajuda-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.ajuda-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #f0fdf4;
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 3px solid #16a34a;
}
.ai-icon { font-size: 1.5em; flex-shrink: 0; }
.ajuda-item strong { display: block; font-size: .88em; color: #14532d; margin-bottom: 3px; font-family: 'Consolas', monospace; }
.ajuda-item span   { font-size: .82em; color: #475569; line-height: 1.4; }

/* ── 4 LIBERDADES GRID ── */
.liberdades-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 16px 0;
}
.lib-card {
    border-radius: 14px;
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
/* Número fantasma de fundo */
.lib-card::before {
    content: attr(data-num);
    position: absolute;
    right: 14px;
    bottom: 4px;
    font-size: 4em;
    font-weight: 900;
    opacity: .07;
    line-height: 1;
    pointer-events: none;
}
.lib-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: .82em;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.lib-card strong { display: block; font-size: .95em; margin-bottom: 5px; }
.lib-card p { font-size: .88em; color: #475569; margin: 0; line-height: 1.5; }

.lib-card.l0 { background: #eff6ff; border-top: 3px solid #3b82f6; }
.lib-card.l0 .lib-num { background: #3b82f6; }
.lib-card.l1 { background: #fdf4ff; border-top: 3px solid #a855f7; }
.lib-card.l1 .lib-num { background: #a855f7; }
.lib-card.l2 { background: #f0fdf4; border-top: 3px solid #16a34a; }
.lib-card.l2 .lib-num { background: #16a34a; }
.lib-card.l3 { background: #fff7ed; border-top: 3px solid #f97316; }
.lib-card.l3 .lib-num { background: #f97316; }

/* ── TIMELINE ── */
.timeline {
    position: relative;
    margin: 20px 0;
}
.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    position: relative;
}
/* Linha vertical conectando os itens */
.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 27px;
    top: 34px;
    bottom: -20px;
    width: 2px;
    background: linear-gradient(to bottom, rgba(102,126,234,.5), rgba(118,75,162,.15));
}
.timeline-year {
    width: 56px;
    text-align: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: .75em;
    font-weight: 700;
    padding: 7px 4px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(102,126,234,.35);
    position: relative;
    z-index: 1;
    letter-spacing: .02em;
}
.timeline-content {
    flex: 1;
    background: #f8f7ff;
    border-radius: 12px;
    padding: 12px 18px;
    font-size: .92em;
    line-height: 1.65;
    border-left: 3px solid rgba(102,126,234,.35);
}
/* Item em destaque (ex: 1991 — criação do kernel) */
.timeline-item.tl-destaque .timeline-year {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    box-shadow: 0 3px 12px rgba(245,158,11,.45);
    font-size: .72em;
}
.timeline-item.tl-destaque .timeline-content {
    background: #fffbeb;
    border-left-color: #f59e0b;
    box-shadow: 0 2px 10px rgba(245,158,11,.12);
}
/* Último item "Hoje" */
.timeline-item.tl-hoje .timeline-year {
    background: linear-gradient(135deg, #10b981, #3b82f6);
    box-shadow: 0 3px 12px rgba(16,185,129,.35);
}
.timeline-item.tl-hoje .timeline-content {
    background: #ecfdf5;
    border-left-color: #10b981;
}

/* ── NAV FOOTER ── */
.nav-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-bottom: 40px;
}
.nav-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: all .3s;
}
.nav-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
    .content-wrapper { padding: 0 15px; }
    .lesson-hero, .content-card { padding: 25px; }
    .lesson-hero h1,
    .hero-title { font-size: 1.5em; }
    .compare-grid { grid-template-columns: 1fr; }
    .dora-grid { grid-template-columns: 1fr 1fr; }
    .liberdades-grid { grid-template-columns: 1fr; }
    .distro-grid     { grid-template-columns: 1fr 1fr; }
    .stat-grid       { grid-template-columns: repeat(2, 1fr); }
    .vantagens-grid  { grid-template-columns: 1fr; }
    .razoes-grid     { grid-template-columns: 1fr; }
    .ajuda-grid      { grid-template-columns: 1fr; }
}
