/* =====================================================
   MAPA.CSS - ESTILOS EXCLUSIVOS DEL MAPA LEAFLET
   Dark Mode + Marcadores Visibles
   ===================================================== */

/* ===== CONTENEDOR BASE DEL MAPA ===== */
#map-container { 
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1 !important; /* Abajo de todo */
    background-color: #0a0a0a !important;
}

/* ===== TILES DARK MODE (Como foto 2) ===== */
.leaflet-tile-pane { 
    filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3);
    opacity: 1 !important;
}

/* Forzar visibilidad de tiles */
.leaflet-tile { 
    opacity: 1 !important; 
    will-change: opacity;
}

.leaflet-tile-container { 
    opacity: 1 !important;
}

/* ===== CONTROLES DE ZOOM (Dark) ===== */
.leaflet-control-zoom, 
.leaflet-bar {
    background-color: rgba(31, 41, 55, 0.95) !important;
    border: 1px solid #374151 !important;
    border-radius: 0.5rem !important;
    backdrop-filter: blur(10px);
}

.leaflet-control-zoom a {
    background-color: rgba(31, 41, 55, 0.95) !important;
    color: #f3f4f6 !important;
    border-bottom: 1px solid #374151 !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    transition: all 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background-color: #3b82f6 !important;
}

/* Ocultar atribución */
.leaflet-control-attribution { 
    display: none !important;
}

.leaflet-control-container { 
    z-index: 5 !important;
}

/* ===== MARCADORES PERSONALIZADOS ===== */
.custom-div-icon {
    background: transparent !important;
    border: none !important;
}

.marker-base,
.custom-marker-compact .marker-pin-compact {
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.95);
    position: relative;
}

.marker-base:hover,
.custom-marker-compact:hover .marker-pin-compact {
    transform: scale(1.25) !important;
    z-index: 1000 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

/* Iconos dentro de los marcadores */
.marker-base i {
    color: white !important;
    font-size: 20px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.4));
}

/* ===== COLORES POR TIPO DE MARCADOR ===== */
/* Comercios - Naranja */
.marker-comercio,
.marker-ferreteria,
.marker-barraca { 
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Cultura/Música - Rosa */
.marker-cultura,
.marker-musico { 
    background: linear-gradient(135deg, #ec4899, #db2777) !important;
}

/* Servicios - Morado */
.marker-esencial,
.marker-servicio,
.marker-servicio-red { 
    background: linear-gradient(135deg, #8b5cf6, #7c3aed) !important;
}

/* Canales TV - Azul */
.marker-canal { 
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

/* Municipal/Salud - Verde */
.marker-municipal,
.marker-salud { 
    background: linear-gradient(135deg, #10B981, #059669) !important;
}

/* Gastronomía - Rojo */
.marker-gastronomia,
.marker-restaurant { 
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
}

/* Default - Gris */
.marker-default { 
    background: linear-gradient(135deg, #6B7280, #4b5563) !important;
}

/* Eventos LIVE - Animado */
.marker-evento {
    background: linear-gradient(45deg, #EF4444, #F59E0B) !important;
    animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Badge LIVE para eventos */
.marker-evento::before {
    content: 'LIVE';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #EF4444;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    animation: blink-live 1.5s infinite;
}

@keyframes blink-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== TOOLTIPS BLANCOS COMPACTOS ===== */
.leaflet-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.leaflet-tooltip::before {
    display: none !important;
}

.custom-tooltip-white {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
    padding: 0 !important;
}

/* Tooltip de ubicación del usuario */
.user-tooltip {
    background: #3B82F6 !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* ===== OPTIMIZACIÓN GPU ===== */
.leaflet-tile,
.leaflet-marker-icon {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .marker-base {
        width: 35px;
        height: 35px;
    }
    
    .marker-base i {
        font-size: 16px;
    }
}
