/* CSS customizado para complementar o Bootstrap */

/* Efeito de sobreposição na seção Hero para melhorar a legibilidade do texto */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* Garante que o conteúdo da seção Hero fique acima da sobreposição */
.hero .container {
  position: relative;
  z-index: 2;
}

/* Espaçamento padrão para seções */
section {
  position: relative;
}
@media (max-width: 991.98px) {
  #anything-llm-embed-chat-button {
    display: none !important;
  }
}
.modal-body img {
  max-height: 90vh; /* imagem ocupa no máximo 90% da altura da tela */
  max-width: 100%;  /* nunca ultrapassa a largura */
  width: auto;      /* mantém a proporção natural */
  display: block;
  margin: 0 auto;   /* centraliza a imagem */
}

/* Estilos gerais */
body {
  font-family: 'Roboto', sans-serif;
}

/* Pinch-to-zoom imagens */
.pinch-zoom-wrapper {
  position: relative;
  overflow: hidden; /* evita que a imagem ampliada extrapole visualmente */
  display: inline-block;
  touch-action: none; /* controla pinch manualmente */
  max-width: 100%;
}
/* Quando aplicado em carousel-item, manter display block para ocupar toda a área */
.carousel-item.pinch-zoom-wrapper { display: block; text-align: center; }
.carousel-item.pinch-zoom-wrapper img.pinch-zoom-target { margin-left: auto; margin-right: auto; }
.pinch-zoom-wrapper img.pinch-zoom-target {
  transform-origin: 0 0; /* Usamos origem 0,0 para cálculo simplificado */
  will-change: transform;
  transition: transform .18s ease;
  user-select: none;
  -webkit-user-drag: none;
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
}
.pinch-zoom-wrapper img.pinch-zoom-target.zoomed-in {
  cursor: grab;
}
.pinch-zoom-wrapper img.pinch-zoom-target.grabbing { cursor: grabbing; }
@media (pointer: coarse) {
  .pinch-zoom-wrapper img.pinch-zoom-target { transition: none; }
}

/* Estilos para a galeria de imagens */
.galeria-img, .galeria-home-img {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.galeria-img:hover, .galeria-home-img:hover {
  transform: scale(1.03);
  opacity: 0.9;
}

/* Estilos para o modal da galeria */
.modal-content.bg-dark {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.carousel-img {
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.carousel-caption {
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin-bottom: 0;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.carousel-fade .carousel-item {
  transition: opacity 0.5s ease;
}

/* Estilos específicos para dispositivos móveis */
@media (max-width: 768px) {
  .carousel-img {
    max-height: 65vh;
  }
  
  .carousel-caption {
    padding: 5px !important;
  }
  
  .carousel-caption h5 {
    font-size: 1rem;
    margin-bottom: 0;
  }
  
  .carousel-caption p {
    font-size: 0.8rem;
    margin-bottom: 0;
  }
}

/* Estilos para controles do carrossel */
.carousel-control-prev, .carousel-control-next {
  width: 10%;
  opacity: 0.8;
  background: linear-gradient(to right, rgba(0,0,0,0.5), transparent);
  border-radius: 4px;
}

.carousel-control-next {
  background: linear-gradient(to left, rgba(0,0,0,0.5), transparent);
}

.carousel-control-prev:hover, .carousel-control-next:hover {
  opacity: 1;
}

/* Estilos existentes */

/* Botão de alternar tema (modo claro/escuro) */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: #343a40;
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Tema Escuro */
.dark-theme {
  background-color: #121212;
  color: #e0e0e0;
}

/* Ajustes para elementos no tema escuro */
.dark-theme .navbar-dark {
  background-color: #000000 !important;
}

.dark-theme .bg-light {
  background-color: #1e1e1e !important;
}

.dark-theme .card {
  background-color: #252525;
  border-color: #333;
}

.dark-theme .card-body {
  color: #e0e0e0;
}

.dark-theme hr {
  border-color: #444;
}

.dark-theme .text-dark {
  color: #e0e0e0 !important;
}

.dark-theme .form-control,
.dark-theme .form-select {
  background-color: #333;
  border-color: #444;
  color: #e0e0e0;
}

.dark-theme .btn-outline-secondary {
  color: #adb5bd;
  border-color: #6c757d;
}

.dark-theme .btn-outline-secondary:hover {
  background-color: #4e5256;
  color: #fff;
}

.dark-theme footer {
  background-color: #000000 !important;
}

/* Modo escuro para a página sobre */
.dark-theme .bg-white {
  background-color: #1f2937 !important;
}

.dark-theme .text-secondary {
  color: #e5e7eb !important;
}

.dark-theme .text-success {
  color: #10b981 !important;
}

.dark-theme .text-info {
  color: #06b6d4 !important;
}

.dark-theme .text-primary {
  color: #3b82f6 !important;
}

.dark-theme .text-danger {
  color: #ef4444 !important;
}

.dark-theme .text-warning {
  color: #f59e0b !important;
}

.dark-theme .border-bottom {
  border-color: #4b5563 !important;
}

.dark-theme .alert-primary {
  background-color: #1e3a8a !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

.dark-theme .alert-success {
  background-color: #166534 !important;
  border-color: #15803d !important;
  color: #ffffff !important;
}

.dark-theme .alert-info {
  background-color: #1e3a8a !important;
  border-color: #1d4ed8 !important;
  color: #ffffff !important;
}

/* Correção para texto dos itens de lista no modo escuro */
.dark-theme .card-body li {
  color: #e5e7eb !important;
}

.dark-theme .card-body p {
  color: #e5e7eb !important;
}

.dark-theme .card-body h2 {
  color: #e5e7eb !important;
}

.dark-theme .card-body h2.text-success {
  color: #10b981 !important;
}

.dark-theme .card-body h2.text-info {
  color: #06b6d4 !important;
}

.dark-theme .card-body h2.text-secondary {
  color: #9ca3af !important;
}

/* Regras mais específicas para modo escuro na página sobre */
.dark-theme .sobre-card {
  background: rgba(37, 37, 37, 0.95) !important;
  color: #e5e7eb !important;
}

.dark-theme .sobre-card .card-body * {
  color: #e5e7eb !important;
}

.dark-theme .sobre-card .card-body .text-primary {
  color: #3b82f6 !important;
}

.dark-theme .sobre-card .card-body .text-success {
  color: #10b981 !important;
}

.dark-theme .sobre-card .card-body .text-info {
  color: #06b6d4 !important;
}

.dark-theme .sobre-card .card-body .text-warning {
  color: #f59e0b !important;
}

.dark-theme .sobre-card .card-body .text-danger {
  color: #ef4444 !important;
}

.dark-theme .sobre-card .card-body .text-secondary {
  color: #9ca3af !important;
}

/* Contraste e fundo dos itens de lista no modo escuro - página sobre */
.dark-theme .sobre-card .card-body li {
  color: #fff !important;
  background: rgba(30,30,30,0.92) !important;
  border-bottom: 1px solid #444 !important;
}
.dark-theme .sobre-card .card-body li:last-child {
  border-bottom: none !important;
}
.dark-theme .sobre-card .card-body ul {
  background: transparent !important;
}

/* Transição suave entre temas */
body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card, .navbar, .bg-light, footer, .form-control {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Melhorias para responsividade e visual da página Sobre */
.sobre-card {
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.92);
}
.sobre-card .card-body {
  padding: 2.5rem 2rem;
}
@media (max-width: 991.98px) {
  .sobre-card .card-body {
    padding: 1.5rem 1rem;
  }
  .hero {
    height: 320px !important;
    min-height: 220px;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p.lead {
    font-size: 1rem;
  }
}
@media (max-width: 575.98px) {
  .sobre-card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  }
  .sobre-card .card-body {
    padding: 1rem 0.5rem;
  }
  .hero {
    height: 180px !important;
    min-height: 120px;
  }
  .hero h1 {
    font-size: 1.2rem;
  }
  .hero p.lead {
    font-size: 0.9rem;
  }
}

/* Melhor contraste para alertas e títulos em mobile */
@media (max-width: 768px) {
  .alert-primary {
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
  }
  .sobre-card h2 {
    font-size: 1.1rem;
  }
}

/* Listas listradas para cards da página sobre */
.sobre-card ul.list-unstyled > li:nth-child(odd) {
  background: #f8f9fa;
}
.sobre-card ul.list-unstyled > li:nth-child(even) {
  background: #fff;
}
.sobre-card ul.list-unstyled > li {
  transition: background 0.2s;
  border-bottom: 3px solid #bdbdbd;
  margin-bottom: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.sobre-card ul.list-unstyled > li:last-child {
  border-bottom: none;
}

/* Estilos para o aviso de atualização do sistema */
.update-alert {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  color: white;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  animation: fadeIn 0.5s ease;
}

.update-alert h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: white;
}

.update-alert p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  max-width: 80%;
  color: #e0e0e0;
}

.update-progress {
  width: 80%;
  max-width: 500px;
  height: 10px;
  background-color: #333;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
}

.update-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a6bff, #2196f3);
  border-radius: 5px;
  animation: progress 2s infinite ease-in-out;
  background-size: 200% 100%;
}

.update-status {
  font-size: 1rem;
  color: #aaa;
  margin-top: 0.5rem;
}

/* Removido o estilo para o ícone do Git, substituído pelo logo do site */

/* Estilo para o logo no aviso de atualização */
.site-logo-update {
  max-height: 100px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes progress {
  0% {
    background-position: 0% 50%;
    width: 10%;
  }
  50% {
    background-position: 100% 50%;
    width: 80%;
  }
  100% {
    background-position: 0% 50%;
    width: 10%;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseGlow {
  0% { filter: drop-shadow(0 4px 8px rgba(255,255,255,0.2)); transform: scale(1); }
  50% { filter: drop-shadow(0 4px 12px rgba(255,255,255,0.5)); transform: scale(1.05); }
  100% { filter: drop-shadow(0 4px 8px rgba(255,255,255,0.2)); transform: scale(1); }
}

/* Cards iguais na página Títulos e Documentos */
.row-cols-md-3 > [class*="col-"] .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.row-cols-md-3 > [class*="col-"] .card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Uniformizar altura das pré-visualizações nos cards da página Títulos e Documentos */
.row.row-cols-md-3 .card .pdf-preview {
  height: 300px !important;
  max-height: 300px;
}

/* Forçar altura fixa em todas as pré-visualizações de PDF, ignorando rotações */
.row.row-cols-md-3 .card .pdf-preview,
.row.row-cols-md-3 .card .pdf-preview.rotate-90,
.row.row-cols-md-3 .card .pdf-preview.rotate-180,
.row.row-cols-md-3 .card .pdf-preview.rotate-270 {
  height: 300px !important;
  max-height: 300px !important;
}

/* Estilo para os botões de redes sociais no footer */
footer .social-media .btn-outline-light {
  transition: all 0.3s ease;
  border-radius: 8px;
  padding: 8px 16px;
}

footer .social-media .btn-outline-light:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Modo escuro para os botões de redes sociais */
.dark-theme footer .social-media .btn-outline-light:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
