/* ==========================================================================
   Tema Beamer Warsaw para Reveal.js - Nomeação em Sistemas Distribuídos (DNS)
   Autor do conteúdo: Pedro Ximenes | UNICAP
   ========================================================================== */

:root {
  /* Paleta Beamer Warsaw Clássica (Light Mode) */
  --beamer-bg: #f8fafc;
  --beamer-card-bg: #ffffff;
  --beamer-text: #0f172a;
  --beamer-text-muted: #475569;
  --beamer-border: #cbd5e1;

  /* Warsaw Blues */
  --warsaw-dark: #0a192f;
  --warsaw-navy: #003366;
  --warsaw-mid: #1e3a8a;
  --warsaw-blue: #2563eb;
  --warsaw-light-blue: #e0e7ff;

  /* Warsaw Gradient */
  --warsaw-gradient: linear-gradient(135deg, #003366 0%, #1e3a8a 100%);
  --warsaw-header-grad: linear-gradient(90deg, #002244 0%, #003366 50%, #1e3a8a 100%);

  /* Blocos Beamer */
  --block-def-header: #003366;
  --block-def-bg: #f0f5fa;
  --block-def-border: #99b8db;
  --block-def-text: #0b2545;

  --block-ex-header: #1b5e20;
  --block-ex-bg: #f1f8f2;
  --block-ex-border: #81c784;
  --block-ex-text: #0d3810;

  --block-alt-header: #88181e;
  --block-alt-bg: #fdf2f2;
  --block-alt-border: #e57373;
  --block-alt-text: #4a0d10;

  /* Sombras e Bordas */
  --beamer-radius: 6px;
  --beamer-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --beamer-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.12), 0 4px 6px -4px rgba(0, 0, 0, 0.08);

  /* Dimensões */
  --header-height: 52px;
  --footer-height: 32px;
  --slide-title-height: 48px;

  /* Zoom de Fonte */
  --font-zoom: 1;
}

/* Modo Escuro (Dark Mode) */
body.dark-theme {
  --beamer-bg: #0b1320;
  --beamer-card-bg: #111d33;
  --beamer-text: #f1f5f9;
  --beamer-text-muted: #94a3b8;
  --beamer-border: #1e293b;

  --warsaw-dark: #050b14;
  --warsaw-navy: #0e2447;
  --warsaw-mid: #1d4ed8;
  --warsaw-gradient: linear-gradient(135deg, #0e2447 0%, #1e40af 100%);

  --block-def-header: #1e40af;
  --block-def-bg: #0f223d;
  --block-def-border: #2563eb;
  --block-def-text: #e2e8f0;

  --block-ex-header: #15803d;
  --block-ex-bg: #0c2d18;
  --block-ex-border: #22c55e;
  --block-ex-text: #e2e8f0;

  --block-alt-header: #991b1b;
  --block-alt-bg: #350f13;
  --block-alt-border: #ef4444;
  --block-alt-text: #e2e8f0;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: var(--beamer-bg);
  color: var(--beamer-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================================================
   Reveal.js Container & Proporção 4:3 (1024x768)
   ========================================================================== */
.reveal-viewport {
  background-color: var(--beamer-bg) !important;
}

.reveal {
  font-family: inherit;
  font-size: calc(20px * var(--font-zoom, 1));
  font-weight: normal;
  color: var(--beamer-text);
}

.reveal .slides {
  text-align: left;
}

/* Slides do Beamer: apenas o slide atual (.present) fica visível */
.reveal .slides section {
  padding: 0;
  height: 100%;
  box-sizing: border-box;
}

.reveal .slides section.present {
  display: flex !important;
  flex-direction: column;
}

.reveal .slides section:not(.present) {
  display: none !important;
}

/* Conteúdo interno do slide com scroll se necessário */
.slide-body {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
}

/* ==========================================================================
   Moldura Beamer Warsaw: Cabeçalho Superior Fixo (Headline)
   ========================================================================== */
#beamer-headline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  user-select: none;
}

/* Linha 1 do Cabeçalho: 4 Seções principais */
.headline-sections {
  background: var(--warsaw-dark);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.headline-nav {
  display: flex;
  height: 100%;
  gap: 4px;
}

.nav-section-item {
  display: flex;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
  color: #cbd5e1;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
  font-size: 12.5px;
  border-radius: 3px 3px 0 0;
}

.nav-section-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nav-section-item.active {
  background: var(--warsaw-mid);
  color: #ffffff;
  font-weight: 700;
}

.nav-section-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #60a5fa;
}

/* Controles de Utilidade no Cabeçalho */
.headline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Grupo de Zoom de Fonte [ A- | 100% | A+ ] */
.font-zoom-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
  height: 22px;
}

.font-zoom-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 0 7px;
  height: 100%;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.font-zoom-label {
  font-size: 11px;
  padding: 0 5px;
  color: #93c5fd;
  font-weight: 700;
  min-width: 36px;
  text-align: center;
  user-select: none;
  line-height: 22px;
  cursor: pointer;
  transition: background 0.15s;
}

.font-zoom-label:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Linha 2 do Cabeçalho: Subseção / Título do Slide */
.headline-subsections {
  background: var(--warsaw-navy);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  height: 24px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

#active-subsection-name {
  color: #93c5fd;
  margin-left: 6px;
  font-weight: 600;
}

/* ==========================================================================
   Banner de Título do Slide (Beamer Frametitle)
   ========================================================================== */
.slide-header {
  background: var(--warsaw-gradient);
  color: #ffffff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #3b82f6;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  margin-top: var(--header-height);
  flex-shrink: 0;
}

.slide-header h2 {
  margin: 0;
  font-size: calc(1.35rem * var(--font-zoom, 1));
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.slide-header .slide-tag {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.18);
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: normal;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Rodapé Beamer Warsaw (Footline)
   ========================================================================== */
#beamer-footline {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  z-index: 1000;
  display: grid;
  grid-template-columns: 2fr 3fr 1.2fr;
  font-size: 11.5px;
  line-height: var(--footer-height);
  color: #cbd5e1;
  user-select: none;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.15);
}

.footline-author {
  background: var(--warsaw-dark);
  padding: 0 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.footline-title {
  background: var(--warsaw-mid);
  color: #ffffff;
  padding: 0 16px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.footline-number {
  background: var(--warsaw-navy);
  padding: 0 16px;
  text-align: right;
  font-weight: 700;
  color: #93c5fd;
}

/* Espaçador para o rodapé */
.reveal .slides section {
  padding-bottom: var(--footer-height);
}

/* ==========================================================================
   Blocos Beamer Warsaw (Definition, Example, Alert)
   ========================================================================== */
.block {
  border-radius: var(--beamer-radius);
  overflow: hidden;
  box-shadow: var(--beamer-shadow);
  margin: 6px 0;
  border: 1px solid var(--block-def-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.block:hover {
  box-shadow: var(--beamer-shadow-lg);
}

.block-title {
  padding: 7px 14px;
  color: #ffffff;
  font-weight: 700;
  font-size: calc(0.95rem * var(--font-zoom, 1));
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.block-body {
  padding: 10px 16px;
  font-size: calc(0.92rem * var(--font-zoom, 1));
  line-height: 1.5;
  color: var(--beamer-text);
}

.block-body p {
  margin: 0 0 6px 0;
}

.block-body p:last-child {
  margin-bottom: 0;
}

/* Bloco Definição (Azul Marinho) */
.block-definition {
  border-color: var(--block-def-border);
}

.block-definition .block-title {
  background: var(--block-def-header);
}

.block-definition .block-body {
  background: var(--block-def-bg);
  color: var(--block-def-text);
}

/* Bloco Exemplo (Verde Floresta) */
.block-example {
  border-color: var(--block-ex-border);
}

.block-example .block-title {
  background: var(--block-ex-header);
}

.block-example .block-body {
  background: var(--block-ex-bg);
  color: var(--block-ex-text);
}

/* Bloco Alerta / Trade-off (Carmesim) */
.block-alert {
  border-color: var(--block-alt-border);
}

.block-alert .block-title {
  background: var(--block-alt-header);
}

.block-alert .block-body {
  background: var(--block-alt-bg);
  color: var(--block-alt-text);
}

/* ==========================================================================
   Listas e Tipografia Beamer
   ========================================================================== */
ul.beamer-list, ol.beamer-list {
  margin: 6px 0 10px 18px;
  padding: 0;
  font-size: calc(0.94rem * var(--font-zoom, 1));
  line-height: 1.55;
}

ul.beamer-list li {
  margin-bottom: 7px;
  position: relative;
  list-style: none;
  padding-left: 18px;
}

ul.beamer-list li::before {
  content: '▶';
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--warsaw-blue);
  font-size: 0.75rem;
}

ol.beamer-list li {
  margin-bottom: 7px;
  padding-left: 6px;
}

code, .code-pill {
  background: rgba(0, 51, 102, 0.08);
  color: var(--warsaw-navy);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: calc(0.88em * var(--font-zoom, 1));
  border: 1px solid rgba(0, 51, 102, 0.15);
}

/* Suporte KaTeX e Fórmulas Matemáticas */
.katex, .katex-display, .math, mjx-container {
  font-size: calc(1em * var(--font-zoom, 1)) !important;
}

body.dark-theme code, body.dark-theme .code-pill {
  background: rgba(147, 197, 253, 0.12);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.25);
}

/* ==========================================================================
   Layouts: Duas Colunas (two-cols)
   ========================================================================== */
.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
  width: 100%;
}

.two-cols.ratio-40-60 {
  grid-template-columns: 4fr 6fr;
}

.two-cols.ratio-60-40 {
  grid-template-columns: 6fr 4fr;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Imagens dos slides */
.slide-figure {
  background: var(--beamer-card-bg);
  border: 1px solid var(--beamer-border);
  border-radius: var(--beamer-radius);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--beamer-shadow);
}

.slide-figure img {
  max-width: 100%;
  max-height: 420px;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

.slide-figure.fit-height img {
  max-height: 320px;
}

.figure-caption {
  font-size: 0.8rem;
  color: var(--beamer-text-muted);
  margin-top: 6px;
  text-align: center;
  font-style: italic;
}

/* ==========================================================================
   Tabela Comparativa Beamer Warsaw (Global vs Adm vs Gerencial)
   ========================================================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--beamer-radius);
  box-shadow: var(--beamer-shadow);
  border: 1px solid var(--beamer-border);
  margin: 6px 0;
}

.beamer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(0.85rem * var(--font-zoom, 1));
  text-align: left;
}

.beamer-table th {
  background: var(--warsaw-navy);
  color: #ffffff;
  padding: 9px 12px;
  font-weight: 600;
  border: 1px solid #1e3a8a;
  letter-spacing: 0.2px;
}

.beamer-table td {
  padding: 7px 12px;
  border: 1px solid var(--beamer-border);
  background: var(--beamer-card-bg);
}

.beamer-table tr:nth-child(even) td {
  background: rgba(0, 51, 102, 0.03);
}

body.dark-theme .beamer-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}

.beamer-table .layer-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 0.76rem;
}

.tag-global { background: #dbeafe; color: #1e40af; }
.tag-adm { background: #e0e7ff; color: #3730a3; }
.tag-gerencial { background: #dcfce7; color: #166534; }

body.dark-theme .tag-global { background: #1e3a8a; color: #bfdbfe; }
body.dark-theme .tag-adm { background: #312e81; color: #c7d2fe; }
body.dark-theme .tag-gerencial { background: #14532d; color: #bbf7d0; }

/* ==========================================================================
   Slide de Abertura (Title Slide)
   ========================================================================== */
.title-slide-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 30px 40px;
}

.title-card {
  background: var(--beamer-card-bg);
  border-radius: 12px;
  border: 1px solid var(--beamer-border);
  box-shadow: var(--beamer-shadow-lg);
  padding: 36px 40px;
  max-width: 820px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.title-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--warsaw-gradient);
}

.title-card h1 {
  font-size: calc(2.1rem * var(--font-zoom, 1));
  color: var(--warsaw-navy);
  margin: 0 0 10px 0;
  font-weight: 800;
  line-height: 1.25;
}

body.dark-theme .title-card h1 {
  color: #60a5fa;
}

.title-card h2.subtitle {
  font-size: calc(1.3rem * var(--font-zoom, 1));
  color: var(--warsaw-mid);
  margin: 0 0 24px 0;
  font-weight: 500;
}

body.dark-theme .title-card h2.subtitle {
  color: #93c5fd;
}

.title-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: calc(1.05rem * var(--font-zoom, 1));
  color: var(--beamer-text-muted);
  border-top: 1px solid var(--beamer-border);
  padding-top: 18px;
  margin-top: 16px;
}

.title-author {
  font-weight: 700;
  color: var(--beamer-text);
  font-size: calc(1.15rem * var(--font-zoom, 1));
}

.title-inst {
  font-size: 0.95rem;
}

.start-btn {
  margin-top: 24px;
  background: var(--warsaw-gradient);
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 51, 102, 0.3);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 51, 102, 0.4);
}

/* ==========================================================================
   Slide de Roteiro (Agenda / Table of Contents)
   ========================================================================== */
.agenda-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
}

.agenda-card {
  background: var(--beamer-card-bg);
  border: 1px solid var(--beamer-border);
  border-radius: var(--beamer-radius);
  padding: 18px 20px;
  box-shadow: var(--beamer-shadow);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 16px;
}

.agenda-card:hover {
  border-color: var(--warsaw-blue);
  transform: translateY(-3px);
  box-shadow: var(--beamer-shadow-lg);
  background: rgba(37, 99, 235, 0.04);
}

.agenda-num {
  background: var(--warsaw-gradient);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.agenda-info h3 {
  margin: 0 0 4px 0;
  font-size: 1.1rem;
  color: var(--beamer-text);
  font-weight: 700;
}

.agenda-info p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--beamer-text-muted);
}

/* ==========================================================================
   Componente Didático: Leitura Reversa do FQDN
   ========================================================================== */
.fqdn-interactive {
  background: var(--beamer-card-bg);
  border: 1px solid var(--beamer-border);
  border-radius: var(--beamer-radius);
  padding: 16px 20px;
  box-shadow: var(--beamer-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fqdn-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  direction: rtl; /* da direita para a esquerda */
}

.fqdn-chip {
  direction: ltr;
  padding: 10px 16px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  background: #f1f5f9;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.dark-theme .fqdn-chip {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.fqdn-chip .chip-step {
  font-size: 0.65rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.fqdn-chip:hover, .fqdn-chip.active {
  background: var(--warsaw-mid);
  color: white;
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.fqdn-chip.active .chip-step {
  color: #93c5fd;
}

.fqdn-arrow {
  color: var(--warsaw-blue);
  font-size: 1.2rem;
  direction: ltr;
}

.fqdn-desc-box {
  background: rgba(0, 51, 102, 0.05);
  border-left: 4px solid var(--warsaw-blue);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
}

/* ==========================================================================
   Simulador Interativo: Resolução Iterativa vs. Recursiva
   ========================================================================== */
.dns-sim-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--beamer-card-bg);
  border: 1px solid var(--beamer-border);
  border-radius: var(--beamer-radius);
  padding: 12px 16px;
  box-shadow: var(--beamer-shadow);
  height: 100%;
}

.sim-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--beamer-border);
  padding-bottom: 8px;
}

.sim-mode-toggle {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--warsaw-mid);
}

.sim-mode-btn {
  background: transparent;
  color: var(--beamer-text);
  border: none;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sim-mode-btn.active {
  background: var(--warsaw-gradient);
  color: white;
}

.sim-controls-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sim-action-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--beamer-text);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.sim-action-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

body.dark-theme .sim-action-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-theme .sim-action-btn:hover {
  background: #334155;
}

.sim-action-btn.btn-primary {
  background: #2563eb;
  color: white;
  border-color: #1d4ed8;
}

.sim-action-btn.btn-primary:hover {
  background: #1d4ed8;
}

.sim-cache-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--warsaw-mid);
  cursor: pointer;
  user-select: none;
}

body.dark-theme .sim-cache-option {
  color: #93c5fd;
}

/* Canvas ou SVG do Simulador */
.sim-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 290px;
  min-height: 290px;
  background: #f8fafc;
  border: 1px solid var(--beamer-border);
  border-radius: 6px;
  overflow: hidden;
}

body.dark-theme .sim-canvas-wrapper {
  background: #090f19;
}

#dnsSimCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Log de passos da simulação */
.sim-log-box {
  background: #0a1424;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  height: 140px;
  overflow-y: auto;
  border-left: 3px solid #3b82f6;
  line-height: 1.45;
}

.sim-log-entry {
  margin-bottom: 4px;
}

.sim-log-entry.highlight {
  color: #38bdf8;
  font-weight: bold;
}

.sim-log-entry.success {
  color: #4ade80;
  font-weight: bold;
}

.sim-log-entry.cache-hit {
  color: #facc15;
  font-weight: bold;
}

/* ==========================================================================
   Visualizador Interativo da Árvore de Nomes (Hierarquia DNS)
   ========================================================================== */
.tree-demo-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--beamer-card-bg);
  border: 1px solid var(--beamer-border);
  border-radius: var(--beamer-radius);
  padding: 12px 16px;
  box-shadow: var(--beamer-shadow);
  height: 100%;
}

.tree-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tree-filter-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--beamer-text);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tree-filter-btn:hover {
  background: #e2e8f0;
}

.tree-filter-btn.active {
  background: var(--warsaw-navy);
  color: white;
  border-color: var(--warsaw-navy);
}

.tree-filter-btn.filter-global.active {
  background: #1e40af;
  border-color: #1e40af;
}

.tree-filter-btn.filter-adm.active {
  background: #4338ca;
  border-color: #4338ca;
}

.tree-filter-btn.filter-gerencial.active {
  background: #15803d;
  border-color: #15803d;
}

.tree-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 330px;
  min-height: 330px;
  background: #fdfdfd;
  border: 1px solid var(--beamer-border);
  border-radius: 6px;
  overflow: hidden;
}

body.dark-theme .tree-canvas-wrapper {
  background: #090f19;
}

#dnsTreeCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.tree-info-panel {
  background: rgba(0, 51, 102, 0.05);
  border-left: 4px solid var(--warsaw-navy);
  padding: 8px 14px;
  border-radius: 0 6px 6px 0;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.dark-theme .tree-info-panel {
  background: rgba(30, 64, 175, 0.15);
  border-color: #60a5fa;
}

/* ==========================================================================
   Ajustes Responsivos e de Apresentação
   ========================================================================== */
@media (max-width: 900px) {
  .two-cols {
    grid-template-columns: 1fr;
  }
  .agenda-grid {
    grid-template-columns: 1fr;
  }
}

/* Scrollbar sutil */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 51, 102, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 51, 102, 0.6);
}
