/* 🌟 Estilo Geral */
body {
  font-family: 'Georgia', serif;
  background-color: #f4f7fc;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease;
}

body.dark {
  background-color: #1c1c1c;
  color: #eee;
}

/* 🧱 Cabeçalho */
header {
  text-align: center;
  padding: 30px 20px;
  background: linear-gradient(to right, #6a9e3f, #4f7c2a);
  color: white;
  border-bottom: 4px solid #4f7c2a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 2.5rem;
  margin: 0;
}

body.dark header {
  background: linear-gradient(to right, #333, #222);
  color: #eee;
}

/* 📌 Cabeçalho fixo */
.cabecalho-fixo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10; /* menor valor para evitar sobreposição */
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

body.dark .cabecalho-fixo {
  background-color: #1c1c1c;
}

/* 🧰 Toolbar de Botões */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background-color: #eaf1f8;
}

body.dark .toolbar {
  background-color: #2a2a2a;
}

.toolbar button {
  background: linear-gradient(to right, #6a9e3f, #4f7c2a);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.toolbar button:hover {
  background: linear-gradient(to right, #4f7c2a, #3a5e1f);
  transform: scale(1.05);
}

/* 🧮 Barra de Edição Suspensa */
.barra-edicao {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background-color: #f0f4e8;
  border-top: 1px solid #c2d6b0;
  border-bottom: 1px solid #c2d6b0;
  position: sticky;
  top: 120px;
  z-index: 999;
}

body.dark .barra-edicao {
  background-color: #2a2a2a;
  border-color: #444;
}

.barra-edicao button {
  background-color: #6a9e3f;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.barra-edicao button:hover {
  background-color: #4f7c2a;
}

.barra-edicao input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* 🧾 Área de Edição */
#editor-area {
  padding: 20px;
}

/* 🧩 Campo Dinâmico */
.campo-dinamico {
  max-width: 1080px;
  margin: 30px auto;
  padding: 24px;
  border: 2px solid #6a9e3f;
  border-radius: 16px;
  background: linear-gradient(to bottom, #ffffff, #f2f6fa);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

body.dark .campo-dinamico {
  background: linear-gradient(to bottom, #1f1f1f, #2a2a2a);
  border-color: #444;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 🏷️ Labels */
label {
  display: block;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 1.1rem;
  color: #6a9e3f;
}

body.dark label {
  color: #a4d87f;
}

/* 🖋️ Editor de Título + Parágrafo */
.titulo-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.titulo-editor select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-weight: bold;
}

.editor {
  width: 95%;
  min-height: 160px;
  padding: 16px 20px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background-color: #fff;
  font-size: 1.2rem;
  line-height: 1.7;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  overflow-y: auto;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.editor:focus {
  border-color: #6a9e3f;
  box-shadow: 0 0 0 3px rgba(106,158,63,0.2);
  outline: none;
}

body.dark .editor {
  background-color: #2a2a2a;
  border-color: #555;
  color: #eee;
}

body.dark .editor:focus {
  border-color: #a4d87f;
  box-shadow: 0 0 0 3px rgba(164,216,127,0.3);
}

/* 🗑️ Botão Excluir */
.excluir {
  margin-top: 20px;
  background-color: #d9534f;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.excluir:hover {
  background-color: #c9302c;
}

/* 📷 Imagens */
.campo-dinamico img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.campo-dinamico img:hover {
  transform: scale(1.02);
}

/* 📦 Painel de Ações */
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 40px auto;
  padding: 10px;
}

.actions button {
  background: linear-gradient(to right, #6a9e3f, #4f7c2a);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.actions button:hover {
  background: linear-gradient(to right, #4f7c2a, #3a5e1f);
  transform: scale(1.05);
}

/* 🔗 Links Fixos — estilo original mantido e refinado */
.link-fixo {
  max-width: 1080px;
  margin: 30px auto;
  padding: 20px;
  background-color: #eaf1f8;
  border-left: 6px solid #6a9e3f;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* 🏷️ Título centralizado e destacado */
.link-fixo h3 {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  line-height: 1.3;
}

/* 🔘 Botões de link em linha */
.link-fixo .botao-link {
  display: inline-block;
  padding: 10px 20px;
  margin-right: 12px;
  margin-bottom: 10px;
  background-color: #6a9e3f;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  vertical-align: middle;
}

/* 🔘 Hover nos botões */
.link-fixo .botao-link:hover {
  background-color: #55832f;
}

/* 📱 Responsivo para telas pequenas */
@media (max-width: 600px) {
  .link-fixo .botao-link {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* 🎥 Bloco de vídeos */
.video-bloco {
  max-width: 1080px;
  margin: 40px auto;
  padding: 20px;
  background-color: #eaf1f8;
  border-left: 6px solid #0078D7;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  text-align: center;
}

.video-bloco h3 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

/* 🎯 Botões em linha */
.video-botoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.nilson-video-btn {
  background-color: #0078D7;
  color: white;
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-family: 'Segoe UI', sans-serif;
}

.nilson-video-btn:hover {
  background-color: #005fa3;
}

/* 🪟 Pop-up container */
.nilson-video-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
}

/* 📺 Pop-up content */
.nilson-video-content {
  background-color: #000;
  padding: 0;
  border-radius: 10px;
  max-width: 800px;
  width: 90%;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.nilson-video-content iframe {
  width: 100%;
  height: 450px;
  border: none;
  border-radius: 10px;
}

/* ❌ Botão de fechar */
.nilson-video-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 30px;
  color: white;
  cursor: pointer;
  font-weight: bold;
  padding: 10px;
}

.nilson-video-close:hover {
  color: #ccc;
}

/* 📱 Responsivo */
@media (max-width: 768px) {
  .nilson-video-content iframe {
    height: 250px;
  }
  .nilson-video-close {
    top: -30px;
    font-size: 24px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #conteudo-exportavel, #conteudo-exportavel * {
    visibility: visible;
  }

  #conteudo-exportavel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    font-family: 'Georgia', serif;
    color: black;
  }

  /* Remover botões e elementos interativos */
  button, nav, .menu, .controle-fontes {
    display: none !important;
  }
}



@media print {
  body * {
    visibility: hidden;
  }

  #conteudo-exportavel, #conteudo-exportavel * {
    visibility: visible;
  }

  #conteudo-exportavel {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 20px;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-family: 'Times New Roman', serif;
    color: black;
  }

    /* Remove estilos visuais extras */
  .editor, .titulo-editor {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
  }
}

@media print {
  @page {
    margin: 2cm;
  }

  #conteudo-exportavel {
    font-size: 14pt;
    line-height: 1.6;
  }
}


.citacao-estilizada {
  border-left: 4px solid #4CAF50;
  background-color: #f0f0f0;
  padding: 15px 25px;
  margin: 20px 0;
  font-style: italic;
  font-size: 1.2em;
  color: #333;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
  border-radius: 5px;
}

.citacao-estilizada footer {
  margin-top: 10px;
  text-align: right;
  font-weight: bold;
  font-style: normal;
  color: #555;
}




button {
  padding: 10px 15px;
  margin: 5px;
  border: none;
  border-radius: 5px;
  background-color: #4CAF50;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #45a049;
}




/* 📱 Correção definitiva para celular */
@media (max-width: 600px) {
  body {
    overflow-x: hidden;
  }

  .cabecalho-fixo {
    position: relative;
    max-height: none;
    overflow: visible;
    box-shadow: none;
  }

  .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-height: calc(100vh - 150px); /* ajusta conforme altura do cabeçalho */
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 20px;
  }

  .toolbar button {
    width: 100%;
    font-size: 1rem;
    padding: 10px;
    margin-bottom: 8px;
  }

  #editor-area {
    padding: 10px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .actions button {
    width: 100%;
    font-size: 1rem;
    padding: 10px;
  }
}


/* Títulos de divisão dos controles */

h2.painel-controle {
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: #2e7d32; /* verde escuro elegante */
  background: linear-gradient(to right, #c8e6c9, #a5d6a7);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin: 20px auto;
  width: 90%;
  max-width: 600px;
  font-family: 'Georgia', serif;
}


h3.link-apoio {
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
  color: #2e7d32; /* verde elegante */
  background: linear-gradient(to right, #c8e6c9, #a5d6a7);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin: 20px auto;
  width: fit-content;
  max-width: 90%;
  font-family: 'Georgia', serif;
}


/* 📱 Correção estrutural para celular */
@media (max-width: 600px) {
  html, body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .cabecalho-fixo {
    position: relative;
    box-shadow: none;
  }

  .toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    max-height: unset;
    overflow-y: visible;
    flex-wrap: nowrap;
  }

  .toolbar {
  display: flex;
  flex-direction: column;
  align-items: center; /* centraliza os botões */
  padding: 10px;
  gap: 10px;
}

.toolbar button {
  width: 65%;
  font-size: 1rem;
  padding: 10px;
  margin-bottom: 8px;
  margin-left: auto;
  margin-right: auto; /* garante centralização mesmo fora de flex */
}

  #editor-area {
    padding: 10px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px;
  }

  .actions {
  display: flex;
  flex-direction: column;
  align-items: center; /* centraliza horizontalmente */
  gap: 10px;
  padding: 10px;
}

.actions button {
  width: 80%;
  max-width: 300px; /* opcional: limita largura para manter centralizado */
  font-size: 1rem;
  padding: 10px;
}


/* 📱 Fixar cabeçalho no topo no celular */
@media (max-width: 600px) {
  .cabecalho-fixo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  body.dark .cabecalho-fixo {
    background-color: #1c1c1c;
  }

  /* Adiciona espaço abaixo do cabeçalho para evitar sobreposição (valor anterior 160) */
  main {
    margin-top: 60px; /* ajuste conforme altura do cabeçalho */
  }
}

#editor-area {
  padding-top: 60px; /* igual à altura do cabeçalho */
}

@media (max-width: 600px) {
  main,
  #editor-area {
    margin-top: 420px; /* ajuste conforme altura visual do cabeçalho */
  }
}
