/* Importar fontes IDECICLO */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700&family=Lato:wght@300;400;700;900&display=swap');

/* Variáveis de cores IDECICLO */
:root {
  --ideciclo-red: #CE4831;
  --ideciclo-teal: #6DBFAC;
  --ideciclo-blue: #5AC2E1;
  --ideciclo-yellow: #EFC345;
  --ideciclo-pink: #F5BDBF;
  --ideciclo-green: #69BFAF;
  --background-grey: #E5E8E9;
  --text-grey: #334454;
  --custom-grey: #F1F1F1;
  --ameciclo: #008080;
  --ideciclo: #5050aa;
}

/* Reset e Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-grey);
  background: white;
}

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

/* Header IDECICLO */
.header {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-bottom: 2px solid var(--ideciclo-teal);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 80px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
  padding: 0 2rem;
}

.logo img {
  height: 64px;
  filter: drop-shadow(0px 2px 4px rgba(0,0,0,0.1));
}

.logo h1 a {
  color: var(--ideciclo-teal);
  text-decoration: none;
  font-size: 1.8rem;
  font-weight: 700;
}

.logo p {
  color: var(--text-grey);
  font-size: 0.9rem;
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--text-grey);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: var(--ideciclo-yellow);
  color: var(--text-grey);
}

.nav-link.active {
  background-color: var(--ideciclo-red);
  color: white;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
}

/* Main Content */
.main {
  min-height: calc(100vh - 140px);
  padding: 2rem 0;
}

/* Hero Section IDECICLO */
.hero {
  background-image: url('../ideciclo-navcover.png');
  background-size: cover;
  background-position: center;
  height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  margin-top: 0;
}

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

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
  font-size: 1.2rem;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-card {
  background: white;
  padding: 2rem;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ideciclo-blue);
  display: block;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

/* Search Section */
.search-section {
  background: white;
  padding: 2rem;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  margin-bottom: 1rem;
}

.search-group {
  display: flex;
  flex-direction: column;
}

/* Filters */
.filters {
  background: white;
  padding: 2rem;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  margin-bottom: 2rem;
}

.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  align-items: end;
}

.results-info {
  margin-top: 1rem;
  color: #666;
  font-size: 0.9rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: #333;
}

.search-input, .filter-select {
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--ideciclo-teal);
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--ideciclo-blue);
  color: white;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
  background: var(--ideciclo-teal);
}

/* Via Cards */
.vias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.via-card {
  background: white;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.via-card:hover {
  transform: translateY(-2px);
  box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.via-header {
  padding: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.location-typology {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.location-typology .via-location {
  margin: 0;
}

.via-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
}

.via-location {
  color: #666;
  font-size: 0.9rem;
}

.via-body {
  padding: 1.5rem;
}

.via-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.info-item {
  text-align: center;
}

.info-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ideciclo-blue);
}

.info-label {
  font-size: 0.8rem;
  color: #666;
}

.typology-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.typology-ciclovia {
  background: #fecaca;
  color: #CE4831;
}

.typology-ciclofaixa {
  background: #fef3c7;
  color: #EFC345;
}

.typology-calçada-compartilhada {
  background: #dbeafe;
  color: #5AC2E1;
}

.typology-compartilhada {
  background: #dbeafe;
  color: #5AC2E1;
}

.typology-ciclorrota {
  background: #d1fae5;
  color: #6DBFAC;
}

/* Score Badge */
.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.score-excellent { background: #4CAF50; color: white; }
.score-good { background: #8BC34A; color: white; }
.score-regular { background: #FFC107; color: #333; }
.score-poor { background: #FF9800; color: white; }
.score-inadequate { background: #F44336; color: white; }

/* Footer IDECICLO */
.footer {
  background: var(--ideciclo);
  color: white;
  padding: 3rem 0;
  margin-top: 3rem;
  position: relative;
  overflow: hidden;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo img {
  height: 48px;
}

.footer-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-info p {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
}

.footer-section h3 {
  color: var(--ideciclo-teal);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.footer-section a {
  color: var(--ideciclo-teal);
  text-decoration: none;
}

.footer-section a:hover {
  text-decoration: underline;
}

.footer-logos {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-top: 1rem;
}

.footer-logo {
  height: 60px;
  width: auto;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem;
  color: #666;
}

/* Waypoint Popups */
.waypoint-popup {
  max-width: 200px;
}

.waypoint-popup h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1rem;
}

.waypoint-popup p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #666;
}

.waypoint-popup em {
  color: #888;
  font-size: 0.8rem;
}

/* Structure Popups */
.structure-popup {
  max-width: 250px;
}

.structure-popup h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.structure-popup p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #666;
}

.structure-popup em {
  color: #2E7D32;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Map Section */
.map-section {
  background: white;
  padding: 2rem;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  margin: 2rem 0;
}

.map-section h2 {
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}

.overview-map {
  height: 500px;
  border-radius: 8px;
  overflow: hidden;
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.chart-container {
  background: white;
  padding: 2rem;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

.chart-container:hover {
  transform: translateY(-2px);
}

.chart-container h3 {
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
  font-size: 1.1rem;
}

.chart-container canvas {
  max-height: 300px;
}

/* Responsive */
@media (max-width: 768px) {
  .filters-row {
    grid-template-columns: 1fr;
  }
  
  .filter-group {
    margin-bottom: 1rem;
  }
  
  .search-section {
    margin-bottom: 1rem;
  }
  
  .vias-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .footer-logos {
    justify-content: center;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .charts-section {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    padding: 1rem;
  }
}

/* Componentes IDECICLO */

/* Botões IDECICLO */
.ideciclo-button {
  background: var(--ideciclo-blue);
  color: white;
  border: none;
  border-radius: 40px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.ideciclo-button:hover {
  transform: translateY(-1px);
  box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.ideciclo-button.yellow {
  background: var(--ideciclo-yellow);
  color: var(--text-grey);
}

.ideciclo-button.red {
  background: var(--ideciclo-red);
}

.ideciclo-button.teal {
  background: var(--ideciclo-teal);
}

/* Cards de categoria com ícones */
.categoria-card {
  width: 234px;
  min-height: 150px;
  border-radius: 40px;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 2rem 1rem 1rem;
  text-align: center;
  margin-top: 80px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all 0.3s ease;
}

.categoria-card:hover {
  transform: translateY(-2px);
  box-shadow: 0px 8px 12px rgba(0, 0, 0, 0.3);
}

.categoria-card .icon {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 104px;
  height: 108px;
}

.categoria-projeto {
  background-color: var(--ideciclo-blue);
  color: white;
}

.categoria-seguranca {
  background-color: var(--ideciclo-yellow);
  color: var(--text-grey);
}

.categoria-manutencao {
  background-color: var(--ideciclo-pink);
  color: var(--text-grey);
}

.categoria-urbanidade {
  background-color: var(--ideciclo-green);
  color: white;
}

/* Sistema de Badges/Scores IDECICLO */
.score-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
}

.score-excelente {
  background: #4CAF50;
  color: white;
}

.score-bom {
  background: #8BC34A;
  color: white;
}

.score-regular {
  background: #FFC107;
  color: #333;
}

.score-ruim {
  background: #FF9800;
  color: white;
}

.score-pessimo {
  background: #F44336;
  color: white;
}

/* Utilitários IDECICLO */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.p-4 { padding: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }
.rounded-lg { border-radius: 0.5rem; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* Responsividade IDECICLO */
@media (max-width: 768px) {
  .categoria-card {
    width: 100%;
    max-width: 300px;
    margin: 80px auto 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero {
    height: 40vh;
  }
  
  .header-content {
    padding: 0 1rem;
  }
  
  .nav ul {
    display: none;
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
  .categoria-card {
    width: 280px;
  }
}