/* 🎨 Paleta de Cores - Tema MQTT */
:root {
  --cor-principal: #660066;     /* Roxo principal */
  --cor-secundaria: #993399;    /* Roxo claro para destaques */
  --cor-clara: #f4f0f8;         /* Fundo suave lilás */
  --cor-texto: #2a002a;         /* Texto escuro roxo */
}

/* 🔤 Estilo global */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--cor-clara);
  color: var(--cor-texto);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

/* 🧱 Estrutura */
header {
  background-color: var(--cor-principal);
  color: white;
  padding: 40px 20px;
  text-align: center;
}

nav {
  background: white;
  display: flex;
  justify-content: center;
  padding: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 20px;
}

nav a {
  color: var(--cor-principal);
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  color: var(--cor-secundaria);
}

/* 📄 Conteúdo */
section {
  margin-bottom: 50px;
}

h2 {
  color: var(--cor-principal);
  border-bottom: 2px solid var(--cor-principal);
  padding-bottom: 5px;
}

.box,
.highlight {
  background: white;
  padding: 20px;
  margin-top: 10px;
  border-left: 5px solid var(--cor-principal);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 🖼️ Imagens */
.img-padrao {
  display: block;
  margin: 30px auto;
  width: 90%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.img-media {
  display: block;
  margin: 30px auto;
  width: 75%;
  max-width: 700px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.img-pequena {
  display: block;
  margin: 30px auto;
  width: 210px;
  height: auto;
}

.figurac-centralizada,
.figurac-centralizada figcaption {
  text-align: center;
}

.figure-centralizada,
.figure-centralizada figcaption {
  text-align: center;
}

.figurac-centralizada,
.figure-centralizada {
  display: block;
  margin: 30px auto;
}


.legenda {
  font-size: 12px;
  color: #555;
  margin-top: 5px;
  font-style: italic;
  line-height: 1.4;
}

/* 📊 Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

table, th, td {
  border: 1px solid #ccc;
}

th, td {
  padding: 12px;
  text-align: left;
}

th {
  background-color: var(--cor-principal);
  color: white;
}

/* 🦶 Rodapé */
footer {
  background: var(--cor-principal);
  color: white;
  text-align: center;
  padding: 20px;
  margin-top: 40px;
}

/* 🔝 Botão Voltar ao Topo */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--cor-principal);
  color: white;
  border: none;
  border-radius: 50%; /* Torna o botão perfeitamente circular */
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  display: none;
  z-index: 999;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: background 0.3s;
}

#back-to-top:hover {
  background: var(--cor-secundaria); /* muda o tom no hover */
}

/* ✨ Animação de entrada */
.fade-in {
  animation: fadeIn 1s ease-in forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.header-mqtt {
  background-color: var(--cor-principal);
  color: white;
  padding: 60px 20px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-mqtt h1 {
  font-size: 56px;
  margin: 0;
  line-height: 1.2;
}
