/* Reset e estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Source Sans Pro', Arial, sans-serif;
  background-color: #fff;
  color: #333;
  line-height: 1.6;
}

/* Header fixo */
header {
  width: 100%;
  height: 60px;
  background-color: #003f7d;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
}

header img.logo {
  height: 40px;
  margin-right: 1rem;
}

header h1 {
  font-size: 1.2rem;
  font-weight: normal;
}

/* Menu hamburger */
.hamburger {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: block;
  z-index: 1001;
}

/* Menu lateral */
nav#sideMenu {
  width: 250px;
  background-color: #003f7d;
  color: #fff;
  height: calc(100vh - 60px);
  position: fixed;
  top: 60px;
  left: 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
  overflow-y: auto;
}

nav#sideMenu.open {
  transform: translateX(0);
}

nav#sideMenu ul {
  list-style: none;
  margin-top: 0;
}

nav#sideMenu ul li a {
  display: block;
  padding: 0.8rem 1rem;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid #222;
}

nav#sideMenu ul li a:hover,
nav#sideMenu ul li a.active {
  background-color: #0052a4;
}

/* Conteúdo principal */
.main-content {
  margin-top: 60px;
  transition: margin-left 0.3s ease-in-out;
}

.main-content.shifted {
  margin-left: 250px;
}

/* Container de conteúdo */
.dashboard-grid {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.container-full {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Filtros */
.container-filters {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 15px;
  margin-bottom: 20px;
}

/* Cards */
.card {
  margin-bottom: 20px;
  border: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border-radius: 8px;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 15px 20px;
}

.card-header h5 {
  font-size: 1.1rem;
  margin: 0;
  color: #003f7d;
}

/* Títulos */
h1, h2, h3, h4, h5, h6 {
  color: #003f7d;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.3rem;
  margin: 1.5rem 0 1rem;
}

/* Stats card */
.stats-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #0d6efd;
}

.stat-item {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  height: 100%;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #0d6efd;
  margin-top: 0.5rem;
}

/* Chart container */
.chart-container {
  height: 300px;
  margin-bottom: 2rem;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Comment text */
.comment-text {
  white-space: pre-wrap;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 4px;
  border-left: 3px solid #6c757d;
}

/* Progress bars */
.progress {
  height: 25px;
  border-radius: 4px;
}

.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.progress-bar.bg-danger {
  background-color: #dc3545 !important;
}
.progress-bar.bg-warning {
  background-color: #ffc107 !important;
}
.progress-bar.bg-success {
  background-color: #198754 !important;
}

/* Badges */
.discrimination-badge {
  margin-right: 5px;
  margin-bottom: 5px;
}

.problem-badge {
  margin-right: 5px;
  margin-bottom: 5px;
  font-size: 0.8rem;
}

.rating-badge {
  font-size: 1.1rem;
  padding: 5px 10px;
}

/* Paginação */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pagination {
  margin: 0;
}

.page-item.active .page-link {
  background-color: #003f7d;
  border-color: #003f7d;
}

.page-link {
  color: #003f7d;
}

/* Comentários e motoristas - cards paginados */
.comments-container, .drivers-container {
  display: none; /* Inicialmente escondidos */
}

.comments-container.active, .drivers-container.active {
  display: block;
}

/* Driver cards */
.driver-card {
  margin-bottom: 15px;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.driver-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.driver-card:last-child {
  margin-bottom: 0;
}

/* List items */
.list-unstyled small {
  color: #6c757d;
  font-size: 0.85rem;
  display: block;
  margin-top: 3px;
}

/* Map styles */
#map, #problemMap {
  height: 500px;
  width: 100%;
  border-radius: 6px;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.map-instructions {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
}

/* Legend styles */
.info {
  padding: 6px 8px;
  font: 14px/16px Arial, Helvetica, sans-serif;
  background: white;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-radius: 5px;
}

.info h6 {
  margin: 0 0 5px;
  color: #777;
}

.legend {
  line-height: 18px;
  color: #555;
}

.legend i {
  width: 18px;
  height: 18px;
  float: left;
  margin-right: 8px;
  opacity: 0.7;
}

.legend-scale {
  display: inline-block;
  width: 100%;
  height: 20px;
  background: linear-gradient(to right, #dc3545, #fd7e14, #ffc107, #198754);
  border-radius: 4px;
  margin-top: 10px;
}

.legend-label {
  position: absolute;
  font-size: 12px;
  bottom: -20px;
}

.legend-label:first-child {
  left: 0;
}

.legend-label:last-child {
  right: 0;
}

/* Loading overlay */
#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.8);
  z-index: 9999;
  display: none;
  justify-content: center;
  align-items: center;
}

/* Responsividade */
@media (max-width: 768px) {
  .col-md-3, .col-md-2 {
    margin-bottom: 1rem;
  }

  .card-body .row > div {
    margin-bottom: 1rem;
  }

  .card-header h5 {
    font-size: 1rem;
  }

  #map, #problemMap {
    height: 300px !important;
  }

  .driver-card .row > div {
    margin-bottom: 1rem;
  }
}

/* Ajustes para os containers principais */
.container-full {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* Estilo unificado para cards de seção */
.section-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: none;
}

.section-card .card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #eee;
  padding: 15px 20px;
}

.section-card .card-header h5 {
  font-size: 1.1rem;
  margin: 0;
  color: #003f7d;
  font-weight: 600;
}

.section-card .card-body {
  padding: 20px;
}

/* Ajustes para o container de filtros */
.container-filters {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.container-filters h2 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #003f7d;
  font-weight: 600;
}

/* Ajustes para o stats-card */
.stats-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 20px;
  border-left: 4px solid #0d6efd;
}

.stats-card h4 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #003f7d;
  font-weight: 600;
}

/* Melhorias na paginação */
.pagination-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.pagination {
  margin: 0;
}

.page-item.active .page-link {
  background-color: #003f7d;
  border-color: #003f7d;
}

.page-link {
  color: #003f7d;
  padding: 8px 16px;
}

/* Ajustes para os cards de motorista */
.driver-card {
  margin-bottom: 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.driver-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.driver-card .card-header {
  background-color: #f8f9fa;
  padding: 15px;
}

.driver-card .card-body {
  padding: 15px;
}

/* Ajustes para legendas de mapas */
.map-legend {
  background: white;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  line-height: 1.5;
}

.map-legend h6 {
  margin: 0 0 5px;
  color: #555;
  font-size: 14px;
  font-weight: bold;
}

/* Ajustes para responsividade */
@media (max-width: 992px) {
  .driver-card .row > div {
    margin-bottom: 15px;
  }

  .container-filters .col-md-3,
  .container-filters .col-md-2 {
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  #map, #problemMap {
    height: 350px;
  }

  .driver-card {
    margin-bottom: 15px;
  }
}

/* --- FIX: título do header visível e responsivo --- */
header h1 {
  color: #fff;            /* força título branco no header */
  margin: 0;
  line-height: 1.2;
  font-size: clamp(1rem, 2.2vw, 1.2rem); /* ajusta em telas menores */
  white-space: nowrap;    /* evita quebra em 2 linhas */
  overflow: hidden;       /* previne overflow lateral */
  text-overflow: ellipsis;/* mostra "..." se faltar espaço */
}
