/* ============================================================
   Cartografía de la Ausencia - Estilos
   ============================================================ */

/* Variables CSS */
:root {
  --texto-marca: #f3edc9;
  --texto-blanco: #FFFFFF;
  --dorado-acento: #e2b021;
  --morado-principal: #4b2e83;
  --rosa-burbuja-fill: rgba(214, 51, 132, 0.35);
  --rosa-burbuja-hover: rgba(214, 51, 132, 0.6);
  --bg-oscuro: #0a0a0a;
  --shadow-default: 0 0 12px rgba(0,0,0,0.5);
  --shadow-hover: 0 0 16px rgba(0,0,0,0.7);
}

/* Reset y base */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-oscuro);
  color: var(--texto-blanco);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Layout principal */
#app {
  height: calc(100vh - 56px); /* Altura total menos navbar */
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Navbar personalizado */
.bg-brand-morado {
  background-color: var(--morado-principal) !important;
}

/* === NUEVO: Estilo para el logo en el navbar === */
.navbar-logo {
  height: 32px;
  width: 32px;
  margin-right: 12px;
  border-radius: 4px;
}

/* === CAMBIO: Tipografía del título actualizada === */
.title-marca {
  color: var(--texto-marca) !important;
  letter-spacing: 0.5px;
  font-family: "Oswald", serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

/* Mapa */
#map {
  height: 100%;
  width: 100%;
  background: var(--bg-oscuro);
}

/* Estilos de Leaflet personalizados */
.leaflet-container {
  background: var(--bg-oscuro);
  font-family: inherit;
}

.leaflet-tooltip {
  background: rgba(10, 10, 10, 0.92);
  color: var(--texto-blanco);
  border: 1px solid #d63384; 
  box-shadow: var(--shadow-default);
  padding: 8px 10px;
  font-size: 0.92rem;
  border-radius: 4px;
}

.leaflet-tooltip-top:before {
  border-top-color: #d63384;
}

.circle-bubble {
  cursor: pointer;
  transition: all 0.2s ease;
}

.circle-bubble:hover {
  fill: var(--rosa-burbuja-hover);
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 5px #d63384);
}

.polygon-boundary {
  fill: none;
  stroke: var(--texto-marca) !important; /* <-- AÑADE !important AQUÍ */
  stroke-width: 0.6px;
  opacity: 0.4;
  pointer-events: none;
}

/* Panel de estado */
.status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(226,176,33,0.45);
  color: var(--texto-blanco);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1000;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.status.success {
  border-color: rgba(120, 200, 120, 0.7);
  background: rgba(10, 20, 10, 0.85);
}

.status.error {
  border-color: rgba(200, 100, 100, 0.7);
  background: rgba(20, 10, 10, 0.85);
}

.status.warning {
  border-color: rgba(226, 176, 33, 0.7);
  background: rgba(20, 15, 10, 0.85);
}

/* Panel de controles/estadísticas */
.controls {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--dorado-acento);
  padding: 12px 15px;
  border-radius: 8px;
  z-index: 1000;
  color: var(--texto-blanco);
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
  min-width: 180px;
}

.controls div {
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls div:last-child {
  margin-bottom: 0;
}

.controls strong {
  color: var(--dorado-acento);
  font-weight: 600;
  margin-left: 8px;
}

/* Loader */
.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(214, 51, 132, 0.3);
  border-top-color: #d63384;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Leyenda personalizada */
.legend-control {
  background: rgba(10, 10, 10, 0.9) !important;
  padding: 10px !important;
  border-radius: 8px !important;
  border: 1px solid var(--dorado-acento) !important;
  color: var(--texto-blanco) !important;
  font-size: 0.85rem !important;
  backdrop-filter: blur(8px);
}

.legend-control .legend-title {
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--dorado-acento);
  border-bottom: 1px solid rgba(226, 176, 33, 0.3);
  padding-bottom: 4px;
}

.legend-control .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.legend-control .legend-item:last-child {
  margin-bottom: 0;
}

/* Controles de Leaflet personalizados */
.leaflet-control-zoom {
  border: 1px solid #d63384 !important;
  background: rgba(10, 10, 10, 0.9) !important;
  border-radius: 4px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: rgba(10, 10, 10, 0.9) !important;
  color: #d63384 !important;
  border-bottom: 1px solid rgba(214, 51, 132, 0.3) !important;
  transition: all 0.2s ease;
}

.leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(214, 51, 132, 0.2) !important;
  color: var(--texto-blanco) !important;
}

.leaflet-control-attribution {
  background: rgba(10, 10, 10, 0.7) !important;
  color: rgba(243, 237, 201, 0.6) !important;
  font-size: 0.75rem !important;
}

.leaflet-control-attribution a {
  color: var(--dorado-acento) !important;
  text-decoration: none;
}

.leaflet-control-attribution a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .title-marca {
    font-size: 1rem;
  }
  
  .controls {
    top: auto;
    bottom: 60px;
    right: 12px;
    font-size: 0.8rem;
    min-width: 150px;
  }
  
  .status {
    font-size: 0.85rem;
    max-width: calc(100% - 24px);
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: 0.9rem;
  }
  
  .controls {
    padding: 8px 10px;
  }
  
  #app {
    height: calc(100vh - 48px);
  }
}

/* Utilidades */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Print styles */
@media print {
  .controls,
  .status,
  .leaflet-control-zoom,
  .navbar {
    display: none !important;
  }
  
  #app {
    height: 100vh !important;
  }
}