/*
 * RESOLVIT - Premium Map Intelligence Design System
 * World-Class Glassmorphism & Elite Visualization
 */

:root {
    --map-glass-bg: rgba(15, 23, 42, 0.7);
    --map-glass-border: rgba(255, 255, 255, 0.1);
    --map-glass-glow: rgba(99, 102, 241, 0.3);
    --map-glass-blur: blur(16px) saturate(180%);
}

/* ── Elite Cluster Branding ──────────────────────────────────── */

.premium-cluster {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    touch-action: manipulation; /* Fixes mobile tap delay */
    cursor: pointer;
}

@media (hover: hover) {
    .premium-cluster:hover {
        transform: scale(1.15);
    }
}

.cluster-glass-shell {
    position: relative;
    background: var(--map-glass-bg);
    backdrop-filter: var(--map-glass-blur);
    -webkit-backdrop-filter: var(--map-glass-blur);
    border: 1.5px solid var(--map-glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(255, 255, 255, 0.05);
    z-index: 2;
    overflow: hidden;
}

.cluster-count {
    color: white;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-family: 'Outfit', sans-serif;
}

/* Priority Glow Rings */
.cluster-glow {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    z-index: 1;
    opacity: 0.6;
    animation: clusterGlowPulse 2.5s infinite;
    pointer-events: none; /* Do not steal touch/click */
}

.glow-critical { background: radial-gradient(circle, #dc262688 0%, transparent 70%); }
.glow-high { background: radial-gradient(circle, #ea580c88 0%, transparent 70%); }
.glow-medium { background: radial-gradient(circle, #ca8a0488 0%, transparent 70%); }
.glow-low { background: radial-gradient(circle, #16a34a88 0%, transparent 70%); }

@keyframes clusterGlowPulse {
    0% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.3); opacity: 0.7; }
    100% { transform: scale(0.9); opacity: 0.4; }
}

/* Inner Orbit Animation for High Priority */
.cluster-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px dashed rgba(255,255,255,0.2);
    animation: rotateOrbit 4s linear infinite;
    pointer-events: none; /* Do not steal touch/click */
}

@keyframes rotateOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Refined Issue Markers ───────────────────────────────────── */

.urban-marker-premium {
    position: relative;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.urban-marker-premium:hover {
    transform: scale(1.5);
    z-index: 1000 !important;
}

.marker-inner-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
}

/* ── Glassmorphism Popups ────────────────────────────────────── */

.leaflet-popup-premium .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 18px !important;
    padding: 0 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7) !important;
    color: white !important;
}

.leaflet-popup-premium .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255,255,255,0.1);
}

.leaflet-popup-premium .leaflet-popup-content {
    margin: 0 !important;
    width: 300px !important;
    font-family: 'Outfit', sans-serif;
}

/* ── Custom Map Controls (Glass) ────────────────────────────── */

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1) !important;
}

.leaflet-control-zoom a {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: var(--accent) !important;
}

/* ───────────────────────────────────────────────────────────── */
/* ── Intelligence Panel Mobile Polish ────────────────────────── */
.intel-panel {
    background: rgba(15, 23, 42, 0.8) !important;
    backdrop-filter: blur(25px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(200%) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    z-index: 2000 !important;
}

@media (max-width: 768px) {
    .premium-cluster {
        /* Larger tap area for mobile */
        padding: 10px;
    }
    
    .intel-panel {
        width: 100% !important;
        right: -100% !important;
        border-left: none !important;
        padding: 30px 20px !important;
    }
    
    .intel-panel.open {
        right: 0 !important;
    }
    
    .leaflet-popup-premium .leaflet-popup-content {
        width: 260px !important;
    }
}

/* Fix for Leaflet tap conflict with custom icons */
.leaflet-interactive {
    outline: none !important;
}
