* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f0f2f5;
  margin: 0;
  padding: 70px 20px 20px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

h1 {
  text-transform: capitalize;
}

h2 {
  text-align: center;
  color: #333;
  margin-top: 0;
  text-transform: capitalize;
}

p {
  color: #444;
  font-size: 15px;
  line-height: 1.6;
  margin: 10px 0;
  letter-spacing: 0.2px;
  font-weight: 400;
}

.containers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 900px;
}

.container {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  width: 100%;
  flex: 1 1 300px;
  justify-content: space-between; /* distribui topo e base */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 auto;
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 420px;
  flex: 1 1 300px;
}

label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  color: #555;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
margin-bottom: 2px;
}

input::placeholder {
  color: transparent;
}

button {
  margin-top: 20px;
  width: 100%;
  background-color: #007BFF;
  color: white;
  border: none;
  padding: 12px;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

input.half-width,
button.half-width {
  width: 100% !important;
  display: inline-block;
}

input.quarter-width,
button.quarter-width {
  width: 23% !important;
  display: inline-block;
}

.resultado {
  margin-top: 20px;
  padding: 15px;
  background-color: #e7f3ff;
  border: 1px solid #b3daff;
  border-radius: 6px;
  color: #004085;
  font-weight: bold;
  text-align: center;
}

.erro {
  color: red;
  margin-top: 10px;
  text-align: center;
}

.conteudo {
  flex-grow: 1;
  display: flex;
  align-items: center;     /* Centraliza verticalmente */
  justify-content: center; /* (Opcional) Centraliza horizontalmente */
  text-align: center;      /* Para centralizar texto */
  background: #fff;     /* Apenas para visualização, como no seu exemplo */
}

.botoes {
  /* fica sempre alinhado na base */
}

.langsel-container {
  position: fixed;
  top: 0; /* <-- move para o topo */
  left: 0;
  width: 100%;
  background-color: #fff;
  border-bottom: 1px solid #ccc; /* era border-top */
  box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* ajusta sombra para topo */
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 1001; /* levemente maior que #breadcrumb */
  flex-wrap: nowrap;
}

.langsel-btn {
  background: transparent;
  color: #007BFF;
  border: 2px solid #007BFF;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 6px 10px;
  gap: 4px;
  height: 42px;
  max-width: 110px; /* <- limita largura */
  margin-top: 1px;
}

/* Hover/focus */
.langsel-btn:hover,
.langsel-btn:focus {
  background-color: #007BFF;
  color: white;
  border-color: #0056b3;
}

/* Nome do idioma visível no desktop */
.langsel-label {
  display: inline;
}

.imagem-transparente {
  background-color: transparent;
  mix-blend-mode: multiply; /* ou 'darken', dependendo do efeito desejado */
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 4%;
  flex-wrap: wrap;
}

/* Deixe o botão de exclusão pequeno e sem herdar estilo geral */
td.excluir button {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  color: red;
}

td.excluir {
  text-align: center;
  width: 30px;
}

#tabela-itens {
  border-collapse: collapse;
  border: none;
  width: 100%;
  border-radius: 8px;
  overflow: hidden; /* Garante que o conteúdo interno (como o thead) também respeite os cantos */
}

#tabela-itens td, #tabela-itens th {
  border: none;
  padding: 2px;
}

#tabela-itens tbody tr:nth-child(even) {
  background-color: #f9f9f9; /* cor para linhas pares */
}

#tabela-itens tbody tr:nth-child(odd) {
  background-color: #f1f1f1; /* cor para linhas ímpares */
}

/* YouTube Video embedded */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 proporção */
  height: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* -------------------------------------------- */
/* ------------------ Mobile ------------------ */
/* -------------------------------------------- */

@media (max-width: 768px) {
  
  .containers {
    flex-direction: column;
    align-items: center;
    padding-bottom: 70px;

  }

  .container {
    border-radius: 12px !important; /* Garante que os cantos fiquem arredondados no mobile */
    box-shadow: none;
    box-shadow: 0 0 12px rgba(0,0,0,0.1);
    padding: 15px 20px; /* Ajusta o padding para adicionar mais sobra no container */
    margin: 10px 0px; /* Adiciona margem entre os containers */
    padding-bottom: 30px;
  }

  button,
  input[type="text"],
  input[type="number"] {
    font-size: 14px;
    padding: 12px; /* Aumenta o padding nos inputs e botões para torná-los mais acessíveis */
  }
  
  input::placeholder {
    color: #555;
  }

  h2 {
    font-size: 20px;
  }

  .langsel-btn {
    width: 48px;
    height: 48px;
    font-size: 18px;
    padding: 6px;
    border-radius: 6px;
  }

  .langsel-label {
    display: none;
  }

  /* a) oculta título e labels p/ economizar espaço            */
  #add-item h2,
  #add-item label{
    display:none;
  }

  /* b) container vira barra fixa — largura total */
  #add-item{
    position: fixed;
    bottom: env(safe-area-inset-bottom, 0);
    left: 0;
    width: 100%;
    background: #fff;
    border-top: 1px solid #ccc;
    box-shadow: 0 -2px 6px rgba(0,0,0,.1);
    padding: 6px 8px;
    z-index: 999;
    margin-bottom: 0px;
  }

  /* c) coloca campos e botão numa única linha                 */
  #add-item form{
    display:flex;
    gap:6px;
    align-items: center;           /* ⬅️ alinha botão e inputs no mesmo plano */
    justify-content: center;       /* ⬅️ mantém o grupo no centro */
    margin-bottom: 10px;
  }

  /* d) inputs */
  #add-item input[type="text"]{
    flex: 2 1 0;
    min-width: 120px;
    height: 54px;
    padding: 4px 6px;
    font-size: 13px;
  }

  #add-item input[type="number"]{
    flex: 0 0 90px;
    max-width: 90px;
    height: 54px;
    padding: 4px 6px;
    font-size: 13px;
  }
  
  /* e) botão super-compacto, agora perfeitamente alinhado */
  #add-item button[type="submit"]{
    align-self: center;   /* ⬅️ força o botão a alinhar pelo centro do contêiner flex */
    display: flex;
    justify-content: center;
    align-items: center;  /* ⬅️ centraliza o ícone dentro do próprio botão */
    width: 34px;
    height: 34px;
    padding: 0px;
    font-size: 20px;
    font-weight: bold;
    margin-top: 0px;
  }
  
  /* Exibe só “＋” (ou mude para ➕, ✅ etc.) */
  #add-item button[type="submit"]::before{
    content:"＋";
  }

  /* Esconde o texto “Adicionar” dentro do botão no mobile */
  #add-item button[type="submit"] span{
    display:none;
  }
  
  label[for] {
    display: none;
  }
  
  .topo-conteudo h1 {
    font-size: 20px;
  }

  .subtitulo {
    font-size: 12px;
  }
  
}

#tabela-itens thead {
  background-color: #007BFF;
  color: white;
}

#tabela-itens thead th {
  padding: 6px;
  text-align: left;
  font-weight: bold;
  border-bottom: 1px solid #ccc;
}

/* Desktop (largura > 768 px): tudo segue como antes */

.topo-principal {
  /*position: sticky;*/
  top: 0;
  width: 100%;
  background-color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 999;
  padding: 16px 12px;
  text-align: center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  overflow: hidden; /* Garante que conteúdos internos respeitem o arredondamento */
}

.topo-conteudo h1 {
  margin: 0;
  font-size: 24px;
  color: #007BFF;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.subtitulo {
  margin: 4px 0 0;
  font-size: 14px;
  color: #666;
}


/* ------------------------------------------- */
/* ---------------- DARK MODE ---------------- */
/* ------------------------------------------- */

[data-theme="dark"] body {
  background-color: #121212;
  color: #e0e0e0;
}

[data-theme="dark"] .topo-principal {
  background: linear-gradient(135deg, #1c1c1c, #2b2b2b);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .titulo-site,
[data-theme="dark"] .logo {
  color: #4DA3FF;
}

[data-theme="dark"] .subtitulo {
  color: #ccc;
}

[data-theme="dark"] .container {
  background: #1e1e1e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  background-color: #2b2b2b;
  color: #e0e0e0;
}

[data-theme="dark"] .container h2 {
  color: #4DA3FF;
}

[data-theme="dark"] .conteudo p {
  color: #ddd;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"] {
  background-color: #2b2b2b;
  border: 1px solid #555;
  color: #eee;
}

[data-theme="dark"] label {
  color: #bbb;
}

[data-theme="dark"] .conteudo {
  background-color: #2b2b2b;
  color: #bbb;
}

[data-theme="dark"] p {
/*  background-color: #2b2b2b;*/
  color: #bbbbbb;
}

[data-theme="dark"] button {
  background-color: #0060AA;
  color: white;
}

[data-theme="dark"] button:hover {
  background-color: #3394ff;
}

[data-theme="dark"] .resultado {
  background-color: #263248;
  color: #a5d6ff;
  border-color: #3c4f6b;
}

[data-theme="dark"] .erro {
  color: #ff6b6b;
}

[data-theme="dark"] .langsel-container {
  background-color: #1c1c1c;
  border-top: 1px solid #444;
}

[data-theme="dark"] .langsel-btn {
  background: transparent;
  color: #4DA3FF;
  border-color: #4DA3FF;
}

[data-theme="dark"] .langsel-btn:hover {
  background-color: #4DA3FF;
  color: black;
}

[data-theme="dark"] #tabela-itens tbody tr:nth-child(even){
  background-color: #3E3F40;
  color: #BABABA;
}

[data-theme="dark"] #tabela-itens tbody tr:nth-child(odd) {
  background-color: #333333;
  color: #BABABA;
}

[data-theme="dark"] td.excluir button {
  color: #ff6b6b;
}

[data-theme="dark"] #tabela-itens thead {
  background-color: #0060AA;
  color: #ffffff;
}

[data-theme="dark"] #tabela-itens thead th {
  border-bottom: 1px solid #444;
}

/* -------------------------------------------*/
/* -------------- Barra Opções -------------- */
/* ------------------------------------------ */

/* MOBILE RESPONSIVO */
@media (max-width: 768px) {
  .containers {
    flex-direction: column;
    align-items: center;
    margin-bottom: 0px;
  }

  .container {
    padding: 20px;
/*    margin: 10px 0;
    box-shadow: none;*/
    border-radius: 12px;
  }

  .topo-conteudo h1 {
    font-size: 22px;
  }

  .subtitulo {
    font-size: 13px;
  }

  .logo {
    font-size: 26px;
  }

  .langsel-btn {
    width: 48px;
    height: 48px;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
  }

  .langsel-label {
    display: none;
  }
  
  [data-theme="dark"] #add-item {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-top: 1px solid #444;
  }

  [data-theme="dark"] #add-item input[type="text"],
  [data-theme="dark"] #add-item input[type="number"] {
    background-color: #2b2b2b;
    border: 1px solid #555;
    color: #eee;
  }

  [data-theme="dark"] #add-item label {
    color: #bbb;
  }

  [data-theme="dark"] #add-item button {
    background-color: #0060AA;
    color: white;
  }

  [data-theme="dark"] #add-item button:hover {
    background-color: #3394ff;
  }

}

/* Se estiver em WebView, remove o espaçamento */
body.no-topbar {
    margin-top: -50px;
}