/* CSS Reset para o body */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.5;
  color: #333;
  background-color: #f4f4f9;
  font-size: 1rem;
}

/* Reset básico para outros elementos */
*,
*::before,
*::after {
  box-sizing: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
li,
figure,
blockquote,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Para garantir que as células mescladas fiquem bem visualmente */
td[rowspan] {
  vertical-align: middle;
}

/* Estilo de badges */
.badge {
  display: inline-block;
  margin-right: 5px;
  font-size: 1rem;
}

/* Estilo para checkboxes */
input[type="checkbox"] {
  display: none;
  /* Esconde o checkbox real */
}

.form-check-input {
  z-index: 1;
}

.form-check-label {
  cursor: pointer;
  color: #333;
  display: flex;
  align-items: center;
  /* Alinha o texto e os ícones */
}

/* Adiciona um ícone ao checkbox */
.form-check-input:checked+.form-check-label .unchecked {
  display: none;
}

.form-check-input:checked+.form-check-label .checked {
  display: inline;
  color: rgb(19, 19, 19);
  /* Altera a cor do ícone marcado */
}

.form-check-input+.form-check-label .checked {
  display: none;
}

/* Estilos para dispositivos de tablet ou menores (768px ou menos) */
@media (max-width: 768px) {
  header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

/* Estilo para o wrapper de horários */
.horario-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 10px;
  margin-bottom: 5px;

  & [type="checkbox"] {
    all: unset;
    position: absolute;
    inset: 0;
  }
}

/* Estilo do badge em relação ao horário */
.horario-wrapper .badge {
  margin-left: 2px;
}

/* Estilos gerais */
h1,
h2 {
  text-align: center;
  color: #333;
}

/* --- Container Responsivo Otimizado --- */
.container {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-left: 16px;
  /* Padding ligeiramente maior para respiro em celulares */
  padding-right: 16px;
  box-sizing: border-box;
  transition: max-width 0.3s ease;
  /* Suaviza a transição ao redimensionar a janela */
}

/* Celulares: Ocupa 100% da largura (definido acima) */

/* Tablets (Portrait): a partir de 768px */
@media (min-width: 768px) {
  .container {
    max-width: 720px;
    /* Largura ideal para leitura em tablets */
  }
}

/* Notebooks e Monitores Médios: a partir de 992px */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
    /* Abre espaço para a tabela cronológica sem esticar demais */
  }
}

/* Monitores Grandes (Desktop/Full HD): a partir de 1200px */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
    /* Limite máximo para manter a ergonomia visual */
  }
}

/* Ajuste extra para a Tabela não "quebrar" o layout */
.table-responsive {
  border: none;
  margin-bottom: 0;
}

/* Estilo do formulário */
form {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

form .form-control {
  margin-bottom: 15px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

form .form-label {
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

form .btn-primary {
  background-color: #007bff;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

form .btn-primary:hover {
  background-color: #0056b3;
}

/* Botão Secondary */
form .btn-secondary {
  background-color: #6c757d;
  border: none;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s;
}

form .btn-secondary:hover {
  background-color: #5a6268;
}

#tabelaGerada {
  display: inline-table;
}

#grade-horarios {
  display: none;
  margin-bottom: 2rem;
}

/* Estilo da tabela */
.table {
  width: 100% !important;
  border-collapse: collapse;
  margin-bottom: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
  padding: 5px;
  border: 1px solid #ddd;
  vertical-align: middle;
}

.table thead th {
  background-color: #343a40;
  /* Fundo escuro */
  color: #fff;
  font-weight: bold;
}

.table tbody tr:nth-child(even) {
  background-color: #f2f2f2;
}

.table tbody tr:hover {
  background-color: #ddd;
}


footer {
  text-align: center;
  font-family: 'Arial', sans-serif;
  font-size: 0.8rem;
  /* Diminuir um pouco o tamanho da fonte */
  color: rgb(173, 173, 173);
  /* Mudar para um cinza mais suave */
  background-color: #343a40;
  border-color: #454d55;
  padding: 3px 0;
  /* Reduzir o padding */
  width: 100%;
}

footer span {
  font-weight: normal;
}



/* Estilos para dispositivos de tablet ou menores (768px ou menos) */
@media (max-width: 768px) {

  body .grade-horarios-container,
  body .form-control {
    font-size: 1.1em;
  }

  #tabelaGerada {
    display: none;
  }

  #grade-horarios {
    display: block;
  }

  .resumoMedicamentos {
    display: block;
  }


  .horario-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    transition: background-color 0.3s;
  }

  .medicamentos-wrapper {
    position: relative;
  }


  .horario-item:nth-child(even) {
    background-color: #e0e0e0;
    /* Cor de fundo diferente para os itens pares */
  }

  .horario-item:hover {
    background-color: #d3d3d3;
    /* Cor de fundo ao passar o mouse */
  }

  .data-wrapper,
  .medicamentos-wrapper,
  .horarios-wrapper {
    display: flex;
    align-items: center;
    margin: 5px 0;
  }

  .horarios-wrapper {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .horario-wrapper {
    display: flex;
    align-items: center;
    margin: 5px;
  }

  .label {
    font-weight: bold;
    margin-right: 5px;
  }
}

.copyright-symbol {
  font-family: Arial, sans-serif;
  font-size: 2rem;
}

.copyright-symbol::after {
  content: "©";
  position: relative;
  top: -15px;
  /* Ajuste conforme necessário */
  right: -2px;
  /* Ajuste conforme necessário */
  font-size: 1rem;
}

footer {
  .copyright-symbol {
    font-size: 1rem;
  }

  .copyright-symbol::after {
    top: -9px;
    /* Ajuste conforme necessário */
    font-size: 0.8rem;
  }
}

.badge-color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.badge-color:hover {
  transform: scale(1.2);
}

.badge-button {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 5px;
  font-size: 1.2rem;
}

.badge-number {
  font-size: 1rem;
  color: rgb(173, 173, 173);
  font-weight: bold;
}

.badge-number {
  display: inline-flex;
  /* Para permitir o alinhamento vertical */
  align-items: center;
  /* Alinhamento vertical central */
  justify-content: center;
  /* Alinhamento horizontal central */
  height: 50px;
  /* Altura para permitir o alinhamento vertical */
  width: 100px;
  /* Largura desejada */
  background-color: #007bff;
  /* Exemplo de fundo */
  color: white;
  /* Cor do texto */
  border-radius: 0.25rem;
  /* Bordas arredondadas */
}

.badge-custom {
  font-family: 'Roboto', sans-serif;
  border: 1px solid #007bff;
  border-radius: 5px;
}

.badge-custom0 {
  background-color: #ffffff;
  color: #565656;
  border: 2px solid #e1e1e1;
}


.badge-custom1 {
  background-color: #6c757d;
  color: white;
}

.badge-custom2 {
  background-color: #28a745;
  color: white;
}

.badge-custom3 {
  background-color: #dc3545;
  color: white;
}

.badge-custom4 {
  background-color: #ffc107;
  color: #212529;
}

.badge-custom5 {
  background-color: #17a2b8;
  color: white;
  border: 1px solid #17a2b8;
}

.badge-custom6 {
  background-color: #ebb0f5;
  color: #212529;
  border: 1px solid #ebb0f5;
}

.badge-custom7 {
  background-color: #343a40;
  color: white;
  border: 1px solid #343a40;
}

.badge-custom8 {
  background-color: #fd7e14;
  color: white;
  border: 1px solid #fd7e14;
}

.badge-custom9 {
  background-color: #20c997;
  color: white;
  border: 1px solid #20c997;
}

.badge-custom10 {
  background-color: #6610f2;
  color: white;
  border: 1px solid #6610f2;
}

.badge-custom11 {
  background-color: #e83e8c;
  color: white;
  border: 1px solid #e83e8c;
}

.badge-custom12 {
  background-color: #38c172;
  color: white;
  border: 1px solid #38c172;
}

.badge-custom13 {
  background-color: #4e73df;
  color: white;
  border: 1px solid #4e73df;
}

.badge-custom14 {
  background-color: #1cc88a;
  color: white;
  border: 1px solid #1cc88a;
}

.badge-custom15 {
  background-color: #f4e041;
  color: #212529;
  border: 1px solid #f4e041;
}


.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
  top: 5px;
  /* Ajuste conforme necessário */
  left: 5px;
  /* Ajuste conforme necessário */
}

.top-left {
  /* Nada extra necessário, mas adicionado para clareza */
}

/* Estilos para dispositivos de tablet ou menores (768px ou menos) */
.wellcome {
  display: inline-block;
}

@media (max-width: 768px) {
  .wellcome {
    display: none;
  }
}


.tooltip {
  visibility: hidden;
}

.badge-button:hover .tooltip {
  visibility: visible;
}


.list-group-item {
  cursor: pointer;
}

/* Estilos adicionais para o botão e o formulário, se necessário */
.form-container {
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 20px;
}

.toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background-color: #f8f9fa;
  padding: 10px;
  border-radius: 5px;
}

.toggle-arrow {
  transition: transform 0.3s ease;
}

.toggle-arrow.expanded {
  transform: rotate(180deg);
  /* Inverte a seta ao expandir */
}

.form-group {
  padding: 10px;
}

.today {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background-color: #007120;
  color: white;
  font-weight: bold;
  font-size: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  padding: 4px;
}

td.position-relative .today {
  position: absolute;
  top: 5px;
  left: 5px;
}

.color-today {
  color: #007120;
}


.btn-today {
  width: 125px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(0, 86, 179, 0.8);
  /*  80% de transparência */
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3;
}

.btn-today:hover {
  background-color: rgba(0, 86, 179, 0.8);
  /*  80% de transparência */
  color: white;
}

.btn-today.btn-today-active:hover {
  title: 'Exibindo hoje';
}

.btn-today:hover {
  title: 'Exibindo todos';
}


.btn-today.btn-today-active:hover {
  background-color: rgb(0, 113, 32, 0.8);
  /*  80% de transparência */
  color: white;
}

.btn-today-active {
  background-color: rgb(0, 113, 32, 0.8);
  /*  80% de transparência */
  color: white;
}

.version-number {
  word-wrap: break-word;
  /* Permite a quebra de palavras longas */
}

.x-small {
  font-size: 0.9rem;
}

.xx-small {
  font-size: 0.8rem;
}

.botoes .btn,
.badge-button {
  display: flex;
  align-items: center;
  height: 2.5rem;
  /* Defina uma altura padrão para todos os botões */
}

.version-control span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

.version-control i {
  color: white;
}

.d-none-important {
  display: none !important;
}

.horario-item-cabecalho {
  background: linear-gradient(135deg, #e0f7fa, #b3e5fc);
  /* Gradiente suave */
  border: 1px solid #007bff;
  /* Borda azul */
  border-radius: 8px;
  /* Borda arredondada */
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
  /* Sombra suave */
}

.horario-item-cabecalho .dia-wrapper .data {
  font-weight: bold;
  color: #007bff;
  /* Texto azul */
  font-size: 1.1rem;
}

.horario-item-cabecalho .dia-wrapper {
  text-align: center;
  /* Alinha o texto no centro */
  margin: 5px 0;
}

.card-list .card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-list .card:nth-child(odd) {
  background-color: #f9f9f9;
  /* Cor clara para itens ímpares */
}

.card-list .card:nth-child(even) {
  background-color: #e3f2fd;
  /* Cor azul clara para itens pares */
}

.data.atual {
  font-weight: bold;
  color: #ff4500;
  /* Exemplo de cor vibrante */
  border: 2px solid #ff4500;
  padding: 5px;
  border-radius: 50%;
  /* Para destacar com círculo */
}

.align-right {
  font-size: 0.8rem;
  text-align: right;
  font-weight: 300;
  color: #333;
}

#botoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}



@media (max-width: 576px) {



  #botoes {
    flex-direction: column;
    gap: 0.25rem;
  }

  #botoes .badge-button .btn {
    font-size: 0.8rem;
    padding: 0.4rem;
  }
}

#repetirContainer input[type="checkbox"] {
  display: block;
}

#usoContinuoContainer input[type="checkbox"] {
  display: block;
}

#usoOpcionalContainer input[type="checkbox"] {
  display: block;
}

#horaInicio:not(:focus):invalid {
  color: #999;
  /* cor cinza para o placeholder */
}

@media (max-width: 576px) {
  #botoes {
    flex-direction: column;
    gap: 0.25rem;
  }

  /* Força os botões a empilharem e ocuparem 100% da tela no celular */
  #buttonsPrimary {
    flex-direction: column;
    width: 100%;
  }

  #buttonsPrimary .badge-button {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  #botoes .badge-button .btn {
    font-size: 0.9rem;
    padding: 0.6rem;
  }
}