/* ========================================
   LEGISLAÇÃO - Estilos da Página
   ======================================== */

/* Hero Section Legislação */
.hero-section-legislacao {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(0, 61, 130, 0.85) 0%, rgba(0, 40, 86, 0.75) 100%),
    url('https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?q=80&w=2000') center/cover no-repeat;
  background-attachment: fixed;
  overflow: visible;
  padding: 100px 20px 80px;
}

.hero-section-legislacao .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(0, 86, 179, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-section-legislacao .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  width: 100%;
  padding: 0 2rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-section-legislacao .hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: white;
  margin: 0 0 1.5rem 0;
  text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
  letter-spacing: -0.02em;
  width: 100%;
  text-align: center;
}

.hero-section-legislacao .hero-subtitle {
  font-size: 1.25rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: 1.6;
  max-width: 700px;
  width: 100%;
  text-align: center;
}

/* Seção Principal de Legislação */
.legislacao-section {
  padding: 80px 20px;
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.legislacao-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Filtros de Categoria */
.legislacao-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 40px 0;
  justify-content: center;
  padding: 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Poppins', sans-serif;
}

.filter-btn:hover {
  background: #f8fafc;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-2px);
}

.filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-icon {
  width: 20px;
  height: 20px;
}

/* Barra de Pesquisa */
.search-bar {
  position: relative;
  max-width: 600px;
  margin: 0 auto 40px;
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #94a3b8;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  color: #1e293b;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2);
}

.search-input::placeholder {
  color: #94a3b8;
}

/* Grid de Documentos */
.documentos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Card de Documento */
.documento-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid #f1f5f9;
}

.documento-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Cabeçalho do Card */
.documento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 2px solid #e2e8f0;
}

.documento-tipo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.documento-tipo.lei {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.documento-tipo.decreto {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
}

.documento-tipo.portaria {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.documento-tipo.outros {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.tipo-icon {
  width: 16px;
  height: 16px;
}

.documento-data {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.data-icon {
  width: 16px;
  height: 16px;
}

/* Conteúdo do Card */
.documento-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.documento-titulo {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
  margin: 0;
}

.documento-ementa {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

/* Tags */
.documento-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  padding: 4px 12px;
  background: #f1f5f9;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
}

/* Rodapé do Card */
.documento-footer {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-top: 2px solid #f1f5f9;
  background: #fafbfc;
}

.btn-download,
.btn-visualizar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
}

.btn-download {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-visualizar {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
}

.btn-visualizar:hover {
  background: #667eea;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Mensagem de Sem Resultados */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-results-icon {
  width: 64px;
  height: 64px;
  color: #cbd5e1;
  margin: 0 auto 20px;
}

.no-results h3 {
  font-size: 24px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px;
}

.no-results p {
  font-size: 16px;
  color: #64748b;
  margin: 0;
}


/* Informação Importante */
.legislacao-importante {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  margin-top: 40px;
}

.legislacao-importante .importante-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legislacao-importante .importante-icon svg {
  width: 24px;
  height: 24px;
  color: #f59e0b;
}

.legislacao-importante .importante-content {
  flex: 1;
}

.legislacao-importante .importante-title {
  font-size: 18px;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 8px;
}

.legislacao-importante .importante-description {
  font-size: 14px;
  color: #78350f;
  line-height: 1.6;
  margin: 0;
}

/* Modal de Visualização */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 2px solid #f1f5f9;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: #fee;
  border-color: #ef4444;
}

.modal-close svg {
  width: 20px;
  height: 20px;
  color: #64748b;
}

.modal-close:hover svg {
  color: #ef4444;
}

.modal-body {
  flex: 1;
  overflow: hidden;
  background: #f8fafc;
}

.pdf-viewer {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.documento-card {
  animation: fadeIn 0.5s ease forwards;
}

.documento-card:nth-child(1) { animation-delay: 0.1s; }
.documento-card:nth-child(2) { animation-delay: 0.2s; }
.documento-card:nth-child(3) { animation-delay: 0.3s; }
.documento-card:nth-child(4) { animation-delay: 0.4s; }
.documento-card:nth-child(5) { animation-delay: 0.5s; }
.documento-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsividade */
@media (max-width: 768px) {
  .hero-section-legislacao {
    min-height: 55vh;
    padding: 80px 20px 60px;
  }

  .hero-section-legislacao .hero-title {
    font-size: 2.5rem;
    margin: 0 0 1.2rem 0;
  }

  .hero-section-legislacao .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-section-legislacao .hero-content {
    padding: 0 1.5rem;
  }

  .legislacao-section {
    padding: 40px 16px;
  }

  .legislacao-filters {
    padding: 16px;
    gap: 8px;
  }

  .filter-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .filter-icon {
    width: 16px;
    height: 16px;
  }

  .documentos-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .documento-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .documento-footer {
    flex-direction: column;
  }

  .legislacao-importante {
    flex-direction: column;
    padding: 20px;
  }

  .modal-container {
    max-height: 100vh;
    border-radius: 0;
  }

  .pdf-viewer {
    min-height: 500px;
  }
}

@media (max-width: 480px) {
  .hero-section-legislacao {
    min-height: 50vh;
    padding: 70px 16px 50px;
  }

  .hero-section-legislacao .hero-title {
    font-size: 2rem;
    margin: 0 0 1rem 0;
  }

  .hero-section-legislacao .hero-subtitle {
    font-size: 1rem;
  }

  .hero-section-legislacao .hero-content {
    padding: 0 1rem;
  }

  .search-input {
    font-size: 14px;
    padding: 14px 16px 14px 44px;
  }

  .documento-titulo {
    font-size: 16px;
  }

  .documento-ementa {
    font-size: 13px;
  }

  .btn-download,
  .btn-visualizar {
    padding: 10px 16px;
    font-size: 13px;
  }
}
