/* ===================================
   CONTENEDOR PRINCIPAL DEL MAPA
   =================================== */
.nexuscore-map-section {
  margin: 2rem 0;
}

.nexuscore-map-section h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #202124;
  margin-bottom: 1rem;
}

.nexuscore-map-container {
  position: relative !important;
  width: 100%;
  height: 600px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  min-height: 400px;
  background: #e5e3df;
}

/* Buscador de direcciones */
.leaflet-control-search {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  padding: 0;
  margin-top: 10px;
  margin-right: 10px;
}

.leaflet-control-search input {
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  width: 250px;
  outline: none;
  border-radius: 4px 0 0 4px;
}

.leaflet-control-search button {
  border: none;
  background: #07ad41;
  color: white;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  border-radius: 0 4px 4px 0;
  transition: background 0.2s;
}

.leaflet-control-search button:hover {
  background: #059135;
}

/* Marcador de resultado de búsqueda */
.nexuscore-search-marker {
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.nexuscore-search-pin {
  background: #ea4335;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Buscador de direcciones - Estilo Google Maps (Viewer) */
.leaflet-control-search-viewer {
  background: white !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin-top: 10px !important;
  margin-left: 10px !important;
  z-index: 1000 !important;
  border: 1px solid rgba(0, 0, 0, 0.04) !important;
  overflow: visible !important;
  transition: box-shadow 0.2s ease !important;
  position: relative !important;
  flex-wrap: wrap !important;
}

/* Sugerencias de búsqueda (Viewer) */
.leaflet-control-search-viewer .search-suggestions {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 4px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
}

.leaflet-control-search-viewer .suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #202124;
  transition: background 0.15s ease;
}

.leaflet-control-search-viewer .suggestion-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.leaflet-control-search-viewer .suggestion-item:hover {
  background: #f8f9fa;
}

.leaflet-control-search-viewer:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.12) !important;
}

.leaflet-control-search-viewer input {
  border: none !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif !important;
  width: 280px !important;
  outline: none !important;
  border-radius: 8px 0 0 8px !important;
  height: auto !important;
  background: transparent !important;
  color: #202124 !important;
}

.leaflet-control-search-viewer input::placeholder {
  color: #70757a !important;
}

.leaflet-control-search-viewer button {
  border: none !important;
  background: #07ad41 !important;
  color: white !important;
  padding: 12px 16px !important;
  cursor: pointer !important;
  font-size: 18px !important;
  border-radius: 0 8px 8px 0 !important;
  transition: background 0.2s ease !important;
  height: auto !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 48px !important;
}

.leaflet-control-search-viewer button:hover {
  background: #059135 !important;
}

.leaflet-control-search-viewer button:active {
  background: #047a2d !important;
}

#nexuscore-map-viewer {
  width: 100% !important;
  height: 100% !important;
  min-height: 400px;
}

/* ===================================
   BOTÓN CENTRAR MAPA (estilo Google Maps)
   =================================== */
.nexuscore-map-container .map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
}

.nexuscore-map-container .map-controls .button {
  background: #fff;
  color: #3c4043;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nexuscore-map-container .map-controls .button:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.nexuscore-map-container .map-controls .button:active {
  background: #e8eaed;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===================================
   PANEL DE FILTROS (estilo Google Maps)
   =================================== */
.nexuscore-map-filters {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  min-width: 180px;
  max-width: 220px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.nexuscore-map-filters h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #202124;
  padding-bottom: 8px;
  border-bottom: 1px solid #e8eaed;
}

.nexuscore-map-filters label.filter-item {
  display: flex;
  align-items: center;
  font-size: 14px;
  margin-bottom: 10px;
  color: #3c4043;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.nexuscore-map-filters label.filter-item:hover {
  background-color: #f1f3f4;
}

.nexuscore-map-filters label.filter-item:last-child {
  margin-bottom: 0;
}

.nexuscore-map-filters input[type="checkbox"] {
  margin-right: 10px;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #1a73e8;
}

.nexuscore-map-filters .filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 26px;
  margin-right: 8px;
  vertical-align: middle;
}

.nexuscore-map-filters .filter-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Custom pin icon class */
.custom-pin-icon {
  background: none !important;
  border: none !important;
}

/* ===================================
   CONTROLES DE LEAFLET (personalización)
   =================================== */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: #fff !important;
  color: #3c4043 !important;
  border: none !important;
  width: 40px !important;
  height: 40px !important;
  line-height: 40px !important;
  font-size: 20px !important;
  font-weight: 500 !important;
  transition: background-color 0.15s ease !important;
}

.leaflet-control-zoom a:hover {
  background: #f8f9fa !important;
}

.leaflet-control-zoom a:active {
  background: #e8eaed !important;
}

.leaflet-control-zoom-in {
  border-bottom: 1px solid #e8eaed !important;
}

/* ===================================
   POPUPS (estilo Google Maps)
   =================================== */
.leaflet-popup-content-wrapper {
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 16px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #3c4043 !important;
}

.leaflet-popup-content strong {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #202124 !important;
  display: block !important;
  margin-bottom: 4px !important;
}

.leaflet-popup-content em {
  color: #5f6368 !important;
  font-style: normal !important;
  font-size: 13px !important;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

.leaflet-popup-close-button {
  color: #5f6368 !important;
  font-size: 24px !important;
  padding: 8px 12px !important;
}

.leaflet-popup-close-button:hover {
  color: #202124 !important;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
  .nexuscore-map-filters {
    min-width: 150px;
    max-width: 180px;
    padding: 12px;
  }

  .nexuscore-map-filters h4 {
    font-size: 14px;
  }

  .nexuscore-map-filters label.filter-item {
    font-size: 13px;
    padding: 4px 6px;
  }

  .nexuscore-map-container .map-controls .button {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* ===================================
   SIDEBAR FLOTANTE PARA DETALLES
   =================================== */
.nexuscore-pin-sidebar {
  position: absolute !important;
  top: 0 !important;
  right: -400px !important;
  width: 400px !important;
  height: 100% !important;
  background: #fff !important;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15) !important;
  z-index: 1000 !important;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  overflow-y: auto !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.nexuscore-pin-sidebar.active {
  right: 0 !important;
}

.nexuscore-pin-sidebar-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.4) !important;
  z-index: 999 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
  pointer-events: none !important;
}

.nexuscore-pin-sidebar-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.nexuscore-sidebar-header {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 12px 20px;
  border-bottom: 1px solid #e8eaed;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.nexuscore-sidebar-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #5f6368;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s ease;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexuscore-sidebar-close:hover {
  background: #f1f3f4;
  color: #202124;
}

.nexuscore-sidebar-content {
  padding: 24px;
}

.nexuscore-sidebar-title {
  font-size: 24px;
  font-weight: 600;
  color: #202124;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.nexuscore-sidebar-type {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.nexuscore-sidebar-type svg {
  width: 18px;
  height: 24px;
  margin-right: 6px;
  flex-shrink: 0;
}

.nexuscore-sidebar-address {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  margin-bottom: 16px;
  font-size: 14px;
  color: #5f6368;
  line-height: 1.4;
}

.nexuscore-sidebar-address svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: #5f6368;
}

.nexuscore-sidebar-address .address-text {
  flex: 1;
}

.nexuscore-sidebar-images-container {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.nexuscore-sidebar-image {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex: 0 0 calc(33.333% - 6px);
  height: 50px;
}

.nexuscore-sidebar-image:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nexuscore-sidebar-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.nexuscore-image-overlay {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nexuscore-sidebar-image:hover .nexuscore-image-overlay {
  opacity: 1;
}

.nexuscore-sidebar-description {
  font-size: 15px;
  line-height: 1.6;
  color: #3c4043;
  margin-bottom: 24px;
}

.nexuscore-sidebar-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.nexuscore-sidebar-info-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e8eaed;
}

.nexuscore-sidebar-info-item:last-child {
  border-bottom: none;
}

.nexuscore-sidebar-info-label {
  font-size: 13px;
  color: #5f6368;
  font-weight: 500;
}

.nexuscore-sidebar-info-value {
  font-size: 14px;
  color: #202124;
  font-weight: 500;
}

.nexuscore-sidebar-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.nexuscore-sidebar-button {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.nexuscore-sidebar-button-primary {
  background: #1a73e8;
  color: #fff;
}

.nexuscore-sidebar-button-primary:hover {
  background: #1765cc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.nexuscore-sidebar-button-secondary {
  background: #fff;
  color: #1a73e8;
  border: 1px solid #dadce0;
}

.nexuscore-sidebar-button-secondary:hover {
  background: #f8f9fa;
  border-color: #1a73e8;
}

/* Responsive Sidebar */
@media (max-width: 768px) {
  .nexuscore-pin-sidebar {
    width: 100%;
    right: -100%;
  }

  .nexuscore-sidebar-content {
    padding: 20px;
  }

  .nexuscore-sidebar-title {
    font-size: 20px;
  }
}

/* ===================================
   MODAL DE ALERTA PERSONALIZADO
   =================================== */
.nexuscore-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.nexuscore-alert-box {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: slideUp 0.3s ease-out;
  position: relative;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nexuscore-alert-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.nexuscore-alert-title {
  font-size: 22px;
  font-weight: 600;
  color: #202124;
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.nexuscore-alert-message {
  font-size: 15px;
  color: #5f6368;
  line-height: 1.6;
  margin-bottom: 24px;
  text-align: left;
}

.nexuscore-alert-message p {
  margin: 0 0 12px 0;
}

.nexuscore-alert-message .alert-suggestions {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
}

.nexuscore-alert-message .alert-suggestions strong {
  color: #202124;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.nexuscore-alert-message ul {
  margin: 0;
  padding-left: 20px;
  text-align: left;
}

.nexuscore-alert-message li {
  margin: 6px 0;
  color: #5f6368;
}

.nexuscore-alert-btn {
  background: #1a73e8;
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 200px;
}

.nexuscore-alert-btn:hover {
  background: #1765cc;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.nexuscore-alert-btn:active {
  transform: scale(0.98);
}

/* Responsive Modal */
@media (max-width: 768px) {
  .nexuscore-alert-box {
    padding: 24px;
    max-width: 90%;
  }

  .nexuscore-alert-title {
    font-size: 20px;
  }

  .nexuscore-alert-message {
    font-size: 14px;
  }
}

/* ===================================
   MODAL DE IMAGEN AMPLIADA
   =================================== */
.nexuscore-image-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease-out;
}

.nexuscore-image-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  animation: zoomIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.nexuscore-image-modal-content img {
  width: 70vw;
  height: 70vh;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.nexuscore-image-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  line-height: 1;
}

.nexuscore-image-modal-close:hover {
  transform: scale(1.1);
}

.nexuscore-image-modal-caption {
  color: white;
  text-align: center;
  padding: 12px 20px;
  font-size: 16px;
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
}

/* Responsive Image Modal */
@media (max-width: 768px) {
  .nexuscore-sidebar-image {
    width: 50%;
    height: 50px;
  }

  .nexuscore-image-modal-content img {
    width: 90vw;
    height: 60vh;
  }

  .nexuscore-image-modal-close {
    top: -35px;
    font-size: 32px;
  }

  .nexuscore-image-modal-caption {
    font-size: 14px;
  }
}
