/* ============================================================
   MAPA TARDIGRADA - ESTILOS
   ============================================================ */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.2);
}

.stat-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #2e7d32;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Filters Section */
.filters-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filters-section h3 {
  color: #2e7d32;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-weight: 600;
  color: #333;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label i {
  color: #2e7d32;
}

.filter-group select {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-group input[type="search"] {
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.3s ease;
}

.filter-group select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.filter-group input[type="search"]:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Legenda do mapa (Leaflet control) */
.map-legend {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(129, 199, 132, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  color: #333;
}

.map-legend h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #2e7d32;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin: 6px 0;
}

.map-legend .legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.map-legend .legend-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}

.btn-reset {
  padding: 12px 24px;
  background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
}

.btn-reset:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* Map Container */
.map-container {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.leaflet-map {
  width: 100%;
  height: 500px;
  border-radius: 8px;
  z-index: 1;
}

/* Table Section */
.table-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.table-section h3 {
  color: #2e7d32;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.table-responsive {
  overflow-x: auto;
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.records-table thead {
  background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
  color: white;
}

.records-table th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
  white-space: nowrap;
}

.records-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.3s ease;
  cursor: pointer;
}

.records-table tbody tr:focus-visible {
  outline: 3px solid #2e7d32;
  outline-offset: -3px;
}

.records-table tbody tr:hover {
  background: rgba(46, 125, 50, 0.05);
}

.records-table td {
  padding: 14px 12px;
  color: #333;
}

.records-table tbody tr:last-child {
  border-bottom: none;
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 16px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.leaflet-popup-content h4 {
  color: #2e7d32;
  margin-bottom: 8px;
  font-size: 16px;
}

.leaflet-popup-content p {
  margin: 4px 0;
  font-size: 13px;
  color: #555;
}

.leaflet-popup-content strong {
  color: #333;
}

/* Mobile Responsiveness */

/* Tablets em modo paisagem */
@media (min-width: 769px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filters-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .leaflet-map {
    height: 450px;
  }
}

/* Tablets em modo retrato */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    flex-direction: column;
    text-align: center;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .stat-value {
    font-size: 24px;
  }

  .stat-label {
    font-size: 12px;
  }

  .filters-section {
    padding: 20px;
  }

  .filters-section h3 {
    font-size: 18px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .filter-group select {
    padding: 10px;
  }

  .map-container {
    padding: 20px;
  }

  .leaflet-map {
    height: 400px;
  }

  .table-section {
    padding: 20px;
  }

  .table-section h3 {
    font-size: 18px;
  }

  .records-table {
    font-size: 12px;
  }

  .records-table th,
  .records-table td {
    padding: 10px 8px;
  }

  .records-table th {
    font-size: 11px;
  }
}

/* Smartphones */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 11px;
  }

  .filters-section {
    padding: 16px;
  }

  .filters-section h3 {
    font-size: 16px;
  }

  .filter-group label {
    font-size: 13px;
  }

  .filter-group select {
    padding: 10px;
    font-size: 13px;
  }

  .btn-reset {
    padding: 10px 20px;
    font-size: 14px;
  }

  .map-container {
    padding: 16px;
  }

  .leaflet-map {
    height: 300px;
  }

  .table-section {
    padding: 16px;
  }

  .table-section h3 {
    font-size: 16px;
  }

  .records-table {
    font-size: 11px;
  }

  .records-table th,
  .records-table td {
    padding: 8px 6px;
  }

  .records-table th {
    font-size: 10px;
  }

  .leaflet-popup-content h4 {
    font-size: 14px;
  }

  .leaflet-popup-content p {
    font-size: 12px;
  }
}

/* Dispositivos muito pequenos */
@media (max-width: 360px) {
  .stats-grid {
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .stat-value {
    font-size: 20px;
  }

  .filters-section,
  .map-container,
  .table-section {
    padding: 12px;
  }

  .leaflet-map {
    height: 280px;
  }

  .btn-reset {
    padding: 9px 16px;
    font-size: 13px;
  }
}

/* Telas grandes */
@media (min-width: 1440px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .filters-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .leaflet-map {
    height: 600px;
  }
}

/* Orientação paisagem em smartphones */
@media (max-height: 500px) and (orientation: landscape) {
  .leaflet-map {
    height: 250px;
  }

  .stat-card {
    padding: 10px;
  }

  .filters-section {
    padding: 12px;
  }
}
