/* ================================================================
   DIÁRIO DE ESTUDOS — guia.css
   Estilos compartilhados por todos os guias/resumos
   ================================================================ */

:root {
  --bg: #0f1117;
  --card: #1a1d27;
  --card-hover: #222633;
  --accent-blue: #4a9eff;
  --accent-cyan: #00d4aa;
  --accent-orange: #ff8c42;
  --accent-pink: #ff6b9d;
  --accent-purple: #a78bfa;
  --accent-yellow: #fbbf24;
  --text: #e8e8ed;
  --text-muted: #8b8fa3;
  --border: #2a2e3d;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

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

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── HERO ────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 80px 0 60px;
  overflow: hidden;
  background: linear-gradient(135deg, #0f1117 0%, #1a1040 50%, #0f1117 100%);
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(74,158,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(167,139,250,0.06) 0%, transparent 50%);
  animation: heroFloat 20s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translate(0,0); }
  50%       { transform: translate(-3%, 2%); }
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(74,158,255,0.12);
  border: 1px solid rgba(74,158,255,0.25);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent-blue);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #4a9eff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { font-size: 18px; color: var(--text-muted); max-width: 700px; }

/* ── NAV STICKY ──────────────────────────────────────────────── */
.nav-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.nav-items {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.nav-items::-webkit-scrollbar { display: none; }
.nav-item {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--card); }
.nav-item.active {
  color: var(--accent-blue);
  background: rgba(74,158,255,0.1);
  border-color: rgba(74,158,255,0.2);
}

/* ── SECTIONS ────────────────────────────────────────────────── */
.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section:last-child { border-bottom: none; }

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.section-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.section-icon.blue   { background: rgba(74,158,255,0.15); }
.section-icon.cyan   { background: rgba(0,212,170,0.15); }
.section-icon.orange { background: rgba(255,140,66,0.15); }
.section-icon.pink   { background: rgba(255,107,157,0.15); }
.section-icon.purple { background: rgba(167,139,250,0.15); }
.section-icon.yellow { background: rgba(251,191,36,0.15); }

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 800;
}

/* ── CARDS ───────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}
.card:hover { border-color: rgba(74,158,255,0.3); }
.card-title {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── FORMULA BOXES ───────────────────────────────────────────── */
.formula-box {
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0;
  text-align: center;
  color: var(--accent-purple);
  position: relative;
  overflow-x: auto;
}
.formula-box .formula-label {
  position: absolute;
  top: -10px; left: 16px;
  background: var(--card);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-purple);
  font-family: 'Source Sans 3', sans-serif;
}

/* ── TIP BOXES ───────────────────────────────────────────────── */
.tip-box {
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.tip-box .tip-icon { flex-shrink: 0; font-size: 20px; margin-top: 2px; }
.tip-box.dica    { background: rgba(0,212,170,0.08);  border: 1px solid rgba(0,212,170,0.2); }
.tip-box.macete  { background: rgba(255,140,66,0.08); border: 1px solid rgba(255,140,66,0.2); }
.tip-box.cuidado { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.2); }
.tip-box.pensar  { background: rgba(74,158,255,0.08); border: 1px solid rgba(74,158,255,0.2); }
.tip-box strong { display: block; margin-bottom: 4px; }
.tip-box.dica strong    { color: var(--accent-cyan); }
.tip-box.macete strong  { color: var(--accent-orange); }
.tip-box.cuidado strong { color: var(--danger); }
.tip-box.pensar strong  { color: var(--accent-blue); }

/* ── STEP BY STEP ────────────────────────────────────────────── */
.steps { counter-reset: step; }
.step {
  position: relative;
  padding-left: 56px;
  margin-bottom: 24px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}
.step::after {
  content: '';
  position: absolute;
  left: 18px; top: 42px;
  width: 2px;
  height: calc(100% - 14px);
  background: var(--border);
}
.step:last-child::after { display: none; }
.step h4 { font-weight: 700; margin-bottom: 6px; color: var(--accent-blue); }

/* ── EXERCISES ───────────────────────────────────────────────── */
.exercise {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
}
.exercise-header {
  padding: 20px 28px;
  background: linear-gradient(135deg, rgba(74,158,255,0.1), rgba(167,139,250,0.05));
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.exercise-header h3 {
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.exercise-header .tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tag.facil   { background: rgba(16,185,129,0.15); color: var(--success); }
.tag.medio   { background: rgba(245,158,11,0.15);  color: var(--warning); }
.tag.dificil { background: rgba(239,68,68,0.15);   color: var(--danger); }
.exercise-body   { padding: 28px; }
.exercise-toggle { font-size: 20px; transition: transform 0.3s; color: var(--text-muted); }
.collapsible-content { display: none; }

/* ── DIAGRAM / MIND MAP ──────────────────────────────────────── */
.diagram-container {
  background: rgba(15,17,23,0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 20px 0;
  text-align: center;
  overflow-x: auto;
}
.diagram-container svg { max-width: 100%; height: auto; }

.mm-map { font-size: 0.88rem; }
.mm-center-node {
  text-align: center;
  background: #1a1040;
  border: 2px solid #a78bfa;
  color: #a78bfa;
  font-weight: 800;
  font-size: 1rem;
  border-radius: 14px;
  padding: 12px 20px;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}
.mm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .mm-grid { grid-template-columns: repeat(4, 1fr); }
}
.mm-col { display: flex; flex-direction: column; gap: 8px; }
.mm-main-node {
  background: color-mix(in srgb, var(--mc) 12%, transparent);
  border: 1.5px solid var(--mc);
  border-radius: 12px;
  padding: 10px 12px;
}
.mm-children {
  padding-left: 10px;
  border-left: 2px solid var(--mc);
  margin-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mm-child-node {
  background: color-mix(in srgb, var(--mc) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--mc) 45%, transparent);
  border-radius: 10px;
  padding: 8px 10px;
}
.mm-node-title {
  display: block;
  font-weight: 700;
  color: var(--mc);
  font-size: 0.82rem;
  margin-bottom: 4px;
}
.mm-node-text  { display: block; color: var(--text-muted); font-size: 0.78rem; line-height: 1.4; }
.mm-node-formula { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 3px; }

/* ── TABLE ───────────────────────────────────────────────────── */
.info-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.info-table th {
  background: rgba(74,158,255,0.1);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--accent-blue);
  border-bottom: 2px solid var(--border);
}
.info-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.info-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ── HIGHLIGHTS ──────────────────────────────────────────────── */
.hl-blue   { color: var(--accent-blue);   font-weight: 600; }
.hl-cyan   { color: var(--accent-cyan);   font-weight: 600; }
.hl-orange { color: var(--accent-orange); font-weight: 600; }
.hl-pink   { color: var(--accent-pink);   font-weight: 600; }
.hl-purple { color: var(--accent-purple); font-weight: 600; }
.hl-yellow { color: var(--accent-yellow); font-weight: 600; }

code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(167,139,250,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-purple);
}

/* ── GRID / CHECKLIST ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

.checklist { list-style: none; }
.checklist li {
  padding: 8px 0 8px 28px;
  position: relative;
  border-bottom: 1px solid rgba(42,46,61,0.5);
}
.checklist li::before { content: '✓'; position: absolute; left: 0; color: var(--accent-cyan); font-weight: 800; }

/* ── SOLUTION STEPS ──────────────────────────────────────────── */
.sol-step {
  margin: 12px 0;
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--accent-blue);
  border-radius: 0 8px 8px 0;
}
.sol-step.result { border-left-color: var(--accent-cyan); background: rgba(0,212,170,0.05); }

/* ── MNEMONIC ────────────────────────────────────────────────── */
.mnemonic {
  background: linear-gradient(135deg, rgba(255,140,66,0.1), rgba(255,107,157,0.05));
  border: 1px dashed rgba(255,140,66,0.3);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0;
  text-align: center;
  font-size: 1.1rem;
}
.mnemonic .title {
  font-weight: 800;
  color: var(--accent-orange);
  margin-bottom: 8px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── KATEX ───────────────────────────────────────────────────── */
.katex { color: inherit; }
.eq { display: inline; }
.eq-block { display: block; overflow-x: auto; text-align: center; }
.eq-block .katex-display { margin: 0.3em 0; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .exercise-body { padding: 20px; }
}

html { scroll-behavior: smooth; }
