/* ============================================= */
/* ARQUIVO: public/css/budget.css                */
/* Versão com Responsividade Corrigida           */
/* ============================================= */

/* === ESTILOS BASE (DESKTOP-FIRST) === */
body {
  justify-content: start;
}

#div-mes {
  display: flex;
  align-items: center;
}

#section-orçamento {
  display: flex;
  flex-direction: row; /* Layout original em linha */
  width: 100%;
  min-height: 100%;
  gap: 30px;
  justify-content: center;
  padding: 15px;
  box-sizing: border-box;
}

h2 {
  margin-left: 0;
  text-align: center;
}

.section-orçamento {
  padding: 10px;
  padding-top: 0;
  width: 30%; /* Três colunas como no original */
  height: fit-content;
}

#titulo-orçamento {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}

h1 {
  margin-top: 40px;
  margin-bottom: 40px;
  font-size: 38px;
  margin-inline: 0;
}

.span-titulo {
  font-size: 20px;
  color: #334666;
  font-weight: 900;
}

#titulo-orçamento button {
  all: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  border: #334666 0.5px solid;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
}

#titulo-orçamento button img {
  width: 20px;
  height: 20px;
}

table {
  margin-bottom: 50px;
  margin-top: 50px;
  width: 100%;
}

th,
td {
  padding: 10px;
}

/* ============================================= */
/* ARQUIVO: public/css/budget.css                */
/* Estilos para o cabeçalho da tabela de despesas*/
/* ============================================= */

#th-despesas {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 10px; /* Adiciona um espaço entre o título e o botão */
}

#titulo-despesa {
  font-weight: bold; /* Mantém o texto do título em negrito */
}

#troca-tipo-despesa {
  all: unset; /* Remove todos os estilos padrão do botão */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 5px; /* Adiciona bordas arredondadas */
  padding: 2px;
  transition: background-color 0.2s ease; /* Efeito suave ao passar o rato */
}

#troca-tipo-despesa:hover {
  background-color: rgba(
    255,
    255,
    255,
    0.2
  ); /* Cor de fundo subtil ao passar o rato */
}

#troca-tipo-despesa img {
  width: 20px; /* Define o tamanho do ícone */
  height: 20px;
}

.th-despesa {
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-orçamento th {
  background-color: #334666;
  color: #fff;
}

.section-orçamento td {
  background-color: #fff;
}

.sectionValores {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 75px;
  margin-bottom: 50px;
}

.grafico {
  position: relative; /* Essencial para o Chart.js calcular o tamanho */
  height: 250px;
  width: 100%; /* Garante que o contentor ocupe a largura disponível */
  max-width: 450px; /* Impede que o gráfico fique gigante em telas largas */
  margin: 20px auto; /* Adiciona margem e centraliza o gráfico */
}

#valorOrçado {
  background-color: chocolate;
}

.valor {
  margin: 0;
}

.adicionar-btn {
  width: 100%;
  padding: 10px;
  background-color: #dbe1e9;
  color: #334666;
  border: 1px dashed #334666;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.td-input {
  padding: 0;
}

.section-orçamento table input {
  all: unset;
  margin: 0;
  border: none;
  width: 100%;
  padding: 10px 5px;
  box-sizing: border-box;
  text-align: center;
}

#section-orçamento tr td:first-child {
  width: 40%;
  padding-inline: 15px;
}

#section-orçamento td {
  width: 30%;
}

.mostrador-valor {
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

#mostrador-valor-top {
  display: none;
}

.grafico {
  margin-top: 50px;
}

/* ============================================= */
/* === REGRAS DE RESPONSIVIDADE ===              */

@media (max-width: 1580px) {
  #titulo-orçamento {
    flex-direction: column;
  }
  h1 {
    margin-bottom: 0;
  }
}

@media (max-width: 1566px) {
  #titulo-orçamento {
    flex-direction: column;
  }

  #section-orçamento tr td:first-child {
    width: 33%;
  }

  #section-orçamento td {
    width: 33%;
  }
}
@media (max-width: 1400px) {
  body {
    height: auto;
    flex-direction: column-reverse;
  }
  #menu {
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    height: 60px;
  }

  #menu img {
    margin-top: 0px;
    margin-bottom: 0px;
    padding-inline: 15px;
    margin-right: 0px;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 1266px) {
  h2 {
    font-size: 16px;
  }

  table {
    font-size: 14px;
  }

  button {
    font-size: 16px;
  }
}

@media (max-width: 1166px) {
  #mostrador-valor-top {
    display: flex;
  }

  #mostrador-valor-bottom {
    display: none;
  }

  #section-orçamento {
    flex-wrap: wrap;
    gap: 5%;
  }

  .section-orçamento {
    width: 45%;
  }
  #orçamento-center {
    display: flex;
    flex-direction: column;
    height: auto;
    justify-content: center;
    align-items: center;
  }

  #orçamento-right {
    display: flex;
    order: 2;
    flex-direction: row-reverse;
    width: 100%;
    gap: 5%;
    padding: 15px;
  }

  #sectionValores {
    width: 45%;
  }

  .section-orçamento table {
    min-width: 50%;
  }
}

@media (max-width: 1080px) {
  h1 {
    margin-bottom: 0px;
  }
}

@media (max-width: 830px) {
  #sectionValores {
    display: none;
  }
  .section-orçamento {
    width: 80%;
    justify-content: center;
  }
  #orçamento-right {
    width: 80%;
    flex-wrap: wrap-reverse;
  }

  #sectionValores {
    width: 100%;
    justify-content: start;
    align-items: center;
    margin-bottom: 0;
  }

  table:last-child {
    margin: 0;
    margin-top: 20px;
  }
}

@media (max-width: 490px) {
  #troca-despesa {
    margin-left: 10px;
  }

  #troca-despesa img {
    height: 20px;
  }

  table {
    font-size: 12px;
  }
  button {
    font-size: 12px;
  }
  td {
    padding: 5px;
  }

  .section-orçamento {
    width: 95%;
  }

  #orçamento-right {
    width: 95%;
  }
}
