/* Theme variables: cores e fontes usadas globalmente */
:root {
  --bg-gradient-start: #230557;
  --bg-gradient-end: #0c2856;
  --bg-dark: #0f1126;
  --bg-dark-transparent: rgba(15, 17, 38, 0.6);
  --genius-verde: #4ae23d;
  --genius-vermelho: #ed282c;
  --genius-azul: #0068ff;
  --genius-amarelo: #ffce00;
  --genius-branco: #ffffff;
  --font-primary: "Segoe UI", "Inter", sans-serif;
  --font-display: "Gilroy", "Segoe UI", sans-serif;
  --map-stroke: #ffffff;
  --map-fill: rgba(255, 255, 255, 0.1);
  --map-hover: #4ae23d;
}

@media (max-width: 1024px) {
  .main-dashboard {
    grid-template-columns: 1fr;
    text-align: center;
    align-items: center;
  }
  .genius-container {
    margin-bottom: 40px;
  }
  .col-title {
    justify-content: center;
  }
  .card-video.main {
    width: 90%;
    height: auto;
    aspect-ratio: 16/9;
  }
  .card-video.side {
    display: none;
  }
  .regions-legend {
    flex: 1;
    max-height: 300px;
  }
  .map-wrapper {
    flex: 1;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: linear-gradient(
    180deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-end) 100%
  );
  color: white;
  min-height: 100vh;
}

header {
  padding: 10px 20px;
  background-color: rgba(0, 0, 0, 0.3);
}

.header-logo {
  max-width: 250px;
}

.hero {
  text-align: center;
  padding: 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.1rem;
  line-height: 1.5;
  opacity: 0.9;
  max-width: 900px;
  margin: 0 auto;
}

/* CAROUSEL STYLES: controles e mini-cards de vídeo */
.nav-arrow:hover {
  transform: scale(1.1);
  background-color: #f0f0f0;
}

.carousel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 0;
  gap: 20px;
}

.carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-arrow {
  background: white;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  z-index: 10;
}

/* Cards de vídeo (layout do carrossel) */

.card-video {
  border-radius: 16px;
  transition: all 0.4s ease-in-out;
  overflow: hidden;
  position: relative;
}

.card-video.main {
  width: 600px;
  height: 340px;
  background-color: black;
  z-index: 2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(1.05);
}

.card-video.side {
  width: 250px;
  height: 180px;
  background-color: rgba(0, 0, 0, 0.3);
  opacity: 0.6;
  z-index: 1;
  filter: grayscale(80%);
  pointer-events: auto;
  cursor: pointer;
}

#card-left {
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 60%);
  mask-image: linear-gradient(to right, transparent 0%, black 60%);
}

#card-right {
  -webkit-mask-image: linear-gradient(to left, transparent 0%, black 60%);
  mask-image: linear-gradient(to left, transparent 0%, black 60%);
}

.card-video.side:hover {
  opacity: 0.8;
  filter: grayscale(40%);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: white;
  transform: scale(1.2);
}

/* MAP SECTION STYLES */
/* --- MAPA INTERATIVO --- */

.map-section {
  max-width: 100%;
  text-align: center;
  display: flex;
  justify-content: center;
  padding: 40px;
}

.map-container-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  background-color: rgba(15, 17, 38, 0.5);
  border-radius: 16px;
  padding: 40px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 1400px;
  width: 100%;
}

.map-header {
  width: 100%;
  text-align: center;
  margin-bottom: 30px;
}

.map-content {
  display: flex;
  gap: 30px;
  width: 100%;
  align-items: center;
}

.regions-legend {
  flex: 0 0 240px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
  position: relative;
}

/* Esconder scrollbar padrão */
.regions-legend::-webkit-scrollbar {
  width: 4px;
}

.regions-legend::-webkit-scrollbar-track {
  background: transparent;
}

.regions-legend::-webkit-scrollbar-thumb {
  background: rgba(0, 104, 255, 0.4);
  border-radius: 2px;
}

.regions-legend::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 104, 255, 0.7);
}

/* Firefox scrollbar */
.regions-legend {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 104, 255, 0.4) transparent;
}

.legend-scroll-indicator {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(0, 104, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bounce 2s infinite;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(4px);
  }
}

.legend-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: white;
  text-align: left;
}

.regions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.region-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.region-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.region-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.region-info {
  flex: 1;
  text-align: left;
}

.region-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  line-height: 1.2;
}

.region-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.map-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
}

#svg11494 {
  width: 100%; /* Mude de 90% para 100% para preencher o container */
  height: auto;
  max-height: 600px;
  display: block;
  margin: 0 auto; /* Garante que fique centralizado */
  overflow: hidden; /* Mude de visible para hidden para evitar vazamentos */
  transition: all 0.8s ease-in-out;
}

/* Efeito de seleção na legenda */
.region-item.active {
  background-color: rgba(0, 104, 255, 0.2);
  border-left: 3px solid #0068ff;
  padding-left: 5px;
}

/* Tooltip */
.map-tooltip {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 9999;
  font-size: 0.9rem;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- CORES DAS 12 REGIÕES DE DESENVOLVIMENTO --- */

/* 1. Metropolitana (Azul) */
#region-metro path {
  fill: #ed282c !important;
}

/* 2. Mata Norte (Verde Água) */
#region-mata-norte path {
  fill: #b74a00 !important;
}

/* 3. Mata Sul (Verde Folha) */
#region-mata-sul path {
  fill: #ff6700 !important;
}

/* 4. Agreste Setentrional (Laranja) */
#region-agreste-setentrional path {
  fill: #ffb000 !important;
}

/* 5. Agreste Central (Vermelho Vivo) */
#region-agreste-central path {
  fill: #ffce00 !important;
}

/* 6. Agreste Meridional (Vinho) */
#region-agreste-meridional path {
  fill: #97e53c !important;
}

/* 7. Sertão do Moxotó (Roxo) */
#region-sertao-moxoto path {
  fill: #4ae23d !important;
}

/* 8. Sertão do Pajeú (Rosa Choque) */
#region-sertao-pajeu path {
  fill: #1ca27a !important;
}

/* 9. Sertão Central (Amarelo Ouro) */
#region-sertao-central path {
  fill: #00b7ff !important;
}

/* 10. Sertão do Araripe (Amarelo Claro) */
#region-sertao-araripe path {
  fill: #0068ff !important;
}

/* 11. Sertão do São Francisco (Azul Claro) */
#region-sertao-sao-francisco path {
  fill: #4400ff !important;
}

/* 12. Sertão de Itaparica (Marrom) */
#region-sertao-itaparica path {
  fill: #3ae8c6 !important;
}

/* Outros (Cinza) */
#region-outros path {
  fill: #555555 !important;
}

/* --- ESTADOS VISUAIS --- */

.state-view .municipality-path {
  stroke: #ffffff !important;
  stroke-width: 0.5px !important;
  transition: opacity 0.3s;
  cursor: pointer;
}

.state-view .region-group:hover path {
  opacity: 0.5;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

.detail-view .inactive-region {
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 0.5s;
}

.detail-view .active-region .municipality-path {
  stroke: #ffffff !important;
  stroke-width: 1px !important;
  cursor: pointer;
}

.detail-view .active-region .municipality-path:hover {
  fill: #ffffff !important;
  opacity: 0.5 !important;
}

.btn-reset-map {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 8px 16px;
  background-color: #0068ff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  z-index: 100;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.btn-reset-map:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

/* DASHBOARD STYLES */
.main-dashboard {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
  align-items: flex-start;
}

.col-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 30px;
  height: 40px;
  display: flex;
  align-items: center;
  font-size: 1.4rem;
}

.center-text {
  justify-content: center;
  text-align: center;
}

.data-card,
.placeholder-card {
  background-color: var(--bg-dark);
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.placeholder-card {
  background-color: rgba(255, 255, 255, 0.1);
  align-items: center;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.data-number {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.data-label {
  font-weight: 700;
  font-size: 1rem;
}

.data-sub {
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 4px;
}

.icon-top-right {
  position: absolute;
  top: 20px;
  right: 20px;
}

.placeholder-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  opacity: 0.7;
}

.placeholder-text {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 200px;
}

.genius-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  height: 300px;
  margin: 0 auto;
}

.genius-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  width: 100%;
  height: 100%;
  border-radius: 100px;
  overflow: hidden;
}

.genius-btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: #0c2856;
  padding: 20px;
  transition: filter 0.2s;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.gb-tl {
  background: var(--genius-verde);
  align-items: flex-start;
  padding-top: 40px;
}
.gb-tr {
  background: var(--genius-vermelho);
  color: white;
  align-items: flex-start;
  padding-top: 40px;
}
.gb-bl {
  background: var(--genius-azul);
  color: white;
  align-items: flex-end;
  padding-bottom: 40px;
}
.gb-br {
  background: var(--genius-amarelo);
  align-items: flex-end;
  padding-bottom: 40px;
}

.genius-btn:hover,
.genius-center-pill:hover {
  filter: brightness(0.8);
}

.genius-center-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  width: 420px;
  height: 110px;
  border-radius: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 10;
}

.center-pill-text {
  color: var(--bg-gradient-end);
  font-weight: 800;
  font-size: 1.1rem;
  font-family: var(--font-display);
}

.btn-limpar {
  display: block;
  margin: 20px auto 0;
  color: #aaa;
  text-decoration: underline;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  font-size: 1rem;
}

.btn-limpar:hover {
  color: white;
}

/* --- SEÇÃO DE INICIATIVAS --- */
.initiatives-section {
  padding: 60px 20px;
  width: 100%;
  background-color: transparent;
}

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

.initiatives-header {
  margin-bottom: 40px;
}

/* Barra de Filtros */
.controls-bar {
  display: flex;
  gap: 20px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  color: #bbb;
  font-size: 0.9rem;
  font-weight: 600;
}

.custom-select {
  padding: 12px 15px;
  border-radius: 8px;
  background-color: rgba(15, 17, 38, 0.9); /* Fundo escuro */
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1rem;
  min-width: 280px;
  cursor: pointer;
  outline: none;
}

.custom-select:focus {
  border-color: #0068ff;
}

/* Lista Acordeão */
.initiatives-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.axis-group {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(15, 17, 38, 0.6);
  transition: background-color 0.3s;
}

/* Cabeçalho do Eixo (Clicável) */
.axis-header {
  padding: 20px;
  background-color: rgba(15, 17, 38, 0.95);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

.axis-header:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.axis-group.active .axis-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.axis-title {
  color: #00a8ff; /* Azul destaque */
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toggle-icon {
  color: #fff;
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.axis-group.active .toggle-icon {
  transform: rotate(180deg);
}

/* Conteúdo (Cards) */
.axis-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
}

.axis-group.active .axis-content {
  max-height: 5000px; /* Grande o suficiente */
}

/* Card Individual */
.initiative-card {
  padding: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background-color: rgba(255, 255, 255, 0.02);
}

.initiative-card:last-child {
  border-bottom: none;
}

.card-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.4;
}

/* Linha de Metadados (Status, Data, Local) */
.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 15px;
  align-items: center;
  font-size: 0.9rem;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* Cores dos Status */
.status-execucao {
  background: rgba(33, 150, 243, 0.15);
  color: #2196f3;
  border: 1px solid #2196f3;
}
.status-concluido {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
  border: 1px solid #4caf50;
}
.status-elaboracao {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
  border: 1px solid #ffc107;
}
.status-licitacao {
  background: rgba(156, 39, 176, 0.15);
  color: #ab47bc;
  border: 1px solid #ab47bc;
}
.status-paralisado {
  background: rgba(244, 67, 54, 0.15);
  color: #ef5350;
  border: 1px solid #ef5350;
}

.meta-info {
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-description {
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.6;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
