.grid-dashboard {
  /*background-color: #002d56;*/
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  /* max-width: 1000px;*/
  margin: 0 auto;
}

.card-dashboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  border-radius: 20px;
  border: 2px solid #004a8d;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-decoration: none; /* Para o link do SIGAA */
  color: inherit;
}

.card-dashboard:hover {
  transform: translateY(-8px);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #004a8d; /* Azul UFPI */
}

.card-dashboard .icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  transition: transform 0.3s ease;
}

.card-dashboard:hover .icon {
  transform: scale(1.1);
}

.card-dashboard h3 {
  font-size: 1.25rem;
  color: #004a8d;
  margin-bottom: 8px;
}

.card-dashboard p {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.4;
}

.boas-vindas {
  text-align: center;
  padding: 20px 20px;
  background: linear-gradient(to bottom, #f8fafc, #ffffff);
  margin-bottom: 20px;
}

.boas-vindas h1 {
  font-size: 2.5rem;
  color: #1e293b;
  font-weight: 800;
}

.boas-vindas p {
  color: #64748b;
  font-size: 1.1rem;
  margin-top: 10px;
}

/* Botão Flutuante de Home dentro das outras telas */
.btn-home {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #004a8d;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.top-bar {
  display: flex;
  align-items: center;
}

.cleaner-btn {
  background-color: #023e8a;
  color: #f0f7ff;
  margin-left: 10px;
}

.modal-sobreposicao {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6); /* Efeito de vidro escuro */
  backdrop-filter: blur(5px); /* Desfoque no fundo do site */

  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 10000;
  padding: 20px;
}

.modal-header {
  background: #ffffff;
  width: 100%;
  max-width: 800px;
  max-height: 85vh; /* Não deixa o modal ultrapassar a altura da tela */
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Garante que as bordas arredondadas cortem o conteúdo */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: modalEntrada 0.3s ease-out;
}

.modal-header-top {
  top: 200px;
  padding: 15px;
  display: flex;
  border-bottom: 1px solid #eee; /* Linha sutil separando a busca dos cards */
  align-items: center;
}

@keyframes modalEntrada {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header button {
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s;
}

.modal-header button:hover {
  background: #e0e0e0;
  color: #d32f2f;
}

#curso-atual-nome {
  background-color: #004a8d;
  color: #e0e0e0;
  font-weight: bold;
  border: 2px solid #666;
  width: 200px;
  cursor: pointer;
}

.seletor-curso-gatilho {
  width: 201px;
  height: 19px;
  margin-top: 4px;
  transition: all 0.2s ease;
}

#busca-curso-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}

#busca-curso-input:focus {
  border-color: #004a8d; /* Azul padrão UFPI */
}

.modal-sobreposicao.active {
  opacity: 0.8;
  visibility: visible;
}

.grid-cursos {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  overflow-y: auto; /* Scroll apenas aqui dentro */
}

/* Estilo de cada card de curso */
.card-curso {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  padding: 15px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;

  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60px;
}

.card-curso:hover {
  background: #004a8d;
  color: white;
  border-color: #004a8d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 74, 141, 0.2);
}

.busca-container {
  margin-top: 5px;
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;
  position: relative;
}

.busca-container input {
  display: flex;
  width: 60%;
  align-items: center;
  justify-content: center;
}

#container-resultado-busca-materias {
  max-height: 400px; /* Limita a altura para não quebrar o modal */
  overflow-y: auto; /* Scroll macio se houver muitos resultados */
  background: #ffffff;
  border-top: 1px solid #eee;
  padding: 5px;

  /* Layout em Grid para os resultados parecerem cards pequenos */
  display: grid;
  gap: 6px;
}

#container-resultado-busca-materias:empty {
  display: none;
}

.item-materia.item-busca {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.item-materia.item-busca:hover {
  background: #edf2f7;
  border-color: #004a8d;
  transform: translateY(-2px);
}

.item-materia.item-busca label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
}

/* Customizando o checkbox para ficar mais moderno */
.item-materia.item-busca input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #004a8d; /* Cor oficial da UFPI */
}

/* Estilo para as matérias na busca (pode ser mais compacto) */
.item-busca {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* Força as colunas a terem o mesmo tamanho */
  font-size: 0.85rem; /* Fonte levemente menor */
  background: white;
}

/* Cabeçalho mais fino */
th {
  background-color: #004a8d;
  color: white;
  padding: 8px 4px;
  font-weight: 600;
  border: 1px solid #000000;
}

/* Diminuindo a altura das células de horário */
td {
  border: 1px solid #000000;
  padding: 4px; /* Padding reduzido ao mínimo */
  height: 35px; /* Altura fixa e baixa para as linhas */
  text-align: center;
  vertical-align: middle;
  word-wrap: break-word; /* Evita que o texto vaze da célula */
}
/* Td's dos horarios */
td:first-child,
th:first-child {
  width: 60px;
  background-color: #f8fafc;
  font-weight: bold;
  color: #64748b;
}

/* Muda o estilo dos horarios de 12:00 e 18:00 */
.divisorDeTurno td {
  border-top: 2px dashed;
  border-bottom: 2px dashed;
}

.conflito-ativo {
  font-size: 0.6rem;
  line-height: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100%;
  text-transform: uppercase;
}

@keyframes piscar {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
.conflito-ativo {
  animation: piscar 910ms infinite;
}

/* Item da Matéria Individual */
.item-materia {
  background: #fff;
  border: 1px solid #fdfdfd;
  padding: 2px;
  transition: 0.2s;
}

.item-materia:hover {
  background-color: #f0f7ff;
  border-color: #023e8a;
}

.item-materia label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.periodo-header {
  color: #f3eeee;
  background-color: #004a8d;
  padding: 3px 5px;
  margin-top: 3px;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  align-items: center;
  font-weight: bold;
  transition: background 0.2s;
}

.periodo-header:hover {
  text-decoration: underline;
}

/* Contêiner das matérias */
.periodo-corpo {
  display: block;
  max-height: 1000px; /* Um valor grande o suficiente */
  opacity: 1;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    opacity 0.3s ease;
}

.periodo-corpo.escondido {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.seta-icon {
  display: inline-block;
  transition: transform 0.3s ease;
  transform: rotate(0deg);
}

.seta-icon:hover {
  color: #3b4877;
}

.periodo-corpo.fechado .seta-icon {
  transform: rotate(-90deg); /* Seta para a direita */
}

.periodo-header.fechado .seta-icon {
  transform: rotate(-90deg);
}

.aviso {
  grid-column: 1 / -1; /* Faz o aviso ocupar todas as colunas do grid */
  padding: 20px;
  margin: 20px 0;

  background-color: #f50000; /* Vermelho bem claro de fundo */
  color: #ecd9d9; /* Vermelho escuro para o texto */
  border: 2px dashed #ffffff; /* Borda tracejada para dar ideia de "vazio" */
  border-radius: 12px;
  font-family: Arial, Helvetica, sans-serif;

  text-align: center;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: surgeAviso 0.4s ease;
}

/* Adicionando um ícone via CSS (Opcional, mas fica ótimo) */
.aviso:before {
  content: "🔍"; /* Ícone de lupa */
  font-size: 2rem;
  filter: grayscale(1);
  opacity: 0.6;
}

/* Animação para o aviso não aparecer do nada */
@keyframes surgeAviso {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reportar-texto {
  grid-column: 1 / -1; /* Faz o aviso ocupar todas as colunas do grid */
  padding: 20px;
  margin: 20px 0;

  background-color: #004a8d; /* Vermelho bem claro de fundo */
  color: #ecd9d9; /* Vermelho escuro para o texto */
  border: 2px solid #000000; /* Borda tracejada para dar ideia de "vazio" */
  border-radius: 12px;
  font-family: Arial, Helvetica, sans-serif;

  text-align: center;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: surgeAviso 1s ease;
}

.link-reportar {
  color: #000000;
  font-weight: bold;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.link-reportar :hover {
  color: #e0e0e0;
  border-bottom-color: #002d56;
  padding-bottom: 2px;
}

/* Container com scroll caso a tela seja pequena */
.grade-wrapper {
  overflow-x: auto;
  padding: 10px;
}

footer {
  text-align: center;
  padding: 20px;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 40px;
}
