/* ============================================================================
   PULSAR - Painel Geográfico v2.0 (Otimizado)
   Estados → Cidades → Bairros com IBGE + ViaCEP
   ============================================================================ */

/* Grid Principal */
#states-grid.geo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
  margin-top: 1.5rem;
}

/* Card de Estado */
.geo-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.95) 0%, rgba(40, 20, 60, 0.95) 100%);
  border: 2px solid rgba(142, 45, 226, 0.3);
}

.geo-card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 50px rgba(142, 45, 226, 0.4);
  border-color: rgba(142, 45, 226, 0.6);
}

/* Imagem do Estado */
.geo-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.geo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: brightness(0.8);
}

.geo-card:hover .geo-image img {
  transform: scale(1.15);
  filter: brightness(1.2);
}

/* Overlay */
.geo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.geo-uf {
  font-size: 2rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 20px rgba(142, 45, 226, 0.8), 0 4px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

/* Informações */
.geo-info {
  padding: 1.5rem;
}

.geo-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.geo-count {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Modal */
.geo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.geo-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.geo-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  max-height: 80vh;
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.98) 0%, rgba(40, 20, 60, 0.98) 100%);
  border-radius: 25px;
  padding: 2.5rem;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(142, 45, 226, 0.4);
  overflow-y: auto;
}

.geo-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.geo-modal-close:hover {
  background: rgba(255, 0, 0, 0.8);
  transform: rotate(90deg);
}

.geo-modal-title {
  font-size: 2rem;
  color: #fff;
  margin: 0 0 2rem 0;
  text-shadow: 0 0 20px rgba(0, 224, 255, 0.6);
}

/* Campo de Busca */
.geo-search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(0, 224, 255, 0.3);
  border-radius: 15px;
  color: white;
  font-size: 1rem;
  font-family: 'Orbitron', sans-serif;
  transition: all 0.3s ease;
}

.geo-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.geo-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(0, 224, 255, 0.8);
  box-shadow: 0 0 20px rgba(0, 224, 255, 0.6);
}

.geo-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

/* Cards Pequenos (Cidades) */
.geo-card-small {
  background: linear-gradient(135deg, rgba(0, 224, 255, 0.1) 0%, rgba(142, 45, 226, 0.1) 100%);
  border: 2px solid rgba(0, 224, 255, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.geo-card-small:hover {
  transform: translateY(-5px);
  background: linear-gradient(135deg, rgba(0, 224, 255, 0.2) 0%, rgba(142, 45, 226, 0.2) 100%);
  border-color: rgba(0, 224, 255, 0.6);
  box-shadow: 0 10px 30px rgba(0, 224, 255, 0.3);
}

.geo-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 10px rgba(0, 224, 255, 0.6));
}

.geo-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.5rem;
}

.geo-events {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Cards Mini (Bairros) */
.geo-card-mini {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.geo-card-mini:hover {
  background: rgba(0, 255, 127, 0.1);
  border-color: rgba(0, 255, 127, 0.4);
  transform: translateY(-3px);
}

.geo-card-mini .geo-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.geo-card-mini .geo-label {
  font-size: 0.95rem;
}

/* Loading */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Animações */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsividade */
@media (max-width: 768px) {
  #states-grid.geo-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
  }

  .geo-modal-content {
    width: 95%;
    padding: 2rem 1.5rem;
  }

  .geo-modal-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .geo-modal-title {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  #states-grid.geo-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .geo-image {
    height: 180px;
  }

  .geo-modal-content {
    padding: 1.5rem 1rem;
    max-height: 90vh;
  }

  .geo-modal-grid {
    grid-template-columns: 1fr;
  }

  .geo-card-small {
    padding: 1.2rem;
  }
}

/* Scrollbar customizada */
.geo-modal-content::-webkit-scrollbar {
  width: 8px;
}

.geo-modal-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.geo-modal-content::-webkit-scrollbar-thumb {
  background: rgba(142, 45, 226, 0.5);
  border-radius: 10px;
}

.geo-modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(142, 45, 226, 0.8);
}
