/* ============================================================================
   LEAFLET OVERRIDES - Custom Leaflet Styling
   Loads AFTER Leaflet CSS to override defaults
   Used by: map.html, report.html
   ============================================================================ */

/* =================================================
   LEAFLET MAP CONTAINER STYLES
   ================================================= */

/* Ensure Leaflet map takes full container space */
.modern-property-map .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 60vh !important;
}

/* Fix map controls positioning on mobile */
.leaflet-control-container {
    font-size: 14px !important;
}

.leaflet-control-zoom {
    margin-right: 10px !important;
    margin-top: 10px !important;
}

/* Map overlay for mobile activation */
.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    text-align: center;
    z-index: 1000;
    padding: 20px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.map-instructions {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* MARKER CLUSTERING STYLES
   ================================================= */

/* Base cluster container styling - FORCE perfect circles */
.marker-cluster {
    background-clip: padding-box !important;
    border-radius: 20px !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.2s ease !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.marker-cluster div {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    border-radius: 15px !important;
    border: 2px solid rgba(255, 255, 255, 0.9) !important;
    font: bold 12px "Helvetica Neue", Arial, Helvetica, sans-serif !important;
    font-weight: bold !important;
    line-height: 26px !important;
    color: white !important;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    position: relative !important;
    box-sizing: border-box !important;
}

.marker-cluster:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.marker-cluster span {
    display: inline-block;
    line-height: 1;
    font-size: 12px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* =================================================
   POPUP STYLING - Enhanced with White Backgrounds
   ================================================= */

/* Enhanced popup styling for better contact info display */
.leaflet-popup-content {
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin: 8px 12px !important; /* Increased margin for breathing room */
    padding: 12px !important; /* Add internal padding */
    min-width: 200px !important;
    max-width: 300px !important;
    overflow: hidden !important; /* Prevent content overflow */
    border-radius: 8px !important; /* Rounded corners for content */
    background: #ffffff !important; /* Ensure white background */
}

.leaflet-popup-content-wrapper {
    background: #ffffff !important; /* Force white background */
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    backdrop-filter: blur(10px) !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    position: relative !important;
    z-index: 1000 !important;
    padding: 4px !important; /* Add padding around the wrapper */
}

.leaflet-popup-tip {
    background: #ffffff !important; /* Force white background for tip */
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15) !important;
}

/* Custom popup content styling */
.custom-popup-wrapper {
    font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
    color: #333;
    line-height: 1.4;
    background: #ffffff !important; /* Ensure white background */
    border-radius: 8px;
    padding: 16px !important; /* Add generous padding */
    margin: 4px !important; /* Add margin for spacing */
    border: 1px solid #e9ecef !important; /* Subtle inner border */
}

.popup-header {
    margin-bottom: 12px;
    padding: 8px 0 10px 0 !important; /* Add padding to header */
    border-bottom: 2px solid #e9ecef;
    background: #ffffff; /* White background for header */
}

.popup-header h4 {
    margin: 0 0 6px 0 !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: #2c3e50 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0 !important; /* Add padding to header title */
}

.popup-header h4 i {
    color: #667eea !important;
    font-size: 14px !important;
    margin-right: 4px !important; /* Add margin to icon */
}

.popup-address {
    font-size: 12px !important;
    color: #666 !important;
    margin: 0 !important;
    font-style: italic;
    padding: 4px 0 !important; /* Add padding to address */
    border-radius: 4px !important;
    background: rgba(102, 126, 234, 0.05) !important; /* Very light colored background */
    padding: 6px 8px !important; /* More generous padding for address */
    margin-top: 4px !important; /* Add top margin for address */
}

.popup-body {
    margin-top: 8px;
    padding: 8px 0 !important; /* Add padding to body */
}

.popup-field {
    margin-bottom: 8px !important;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px !important; /* Add padding to each field */
    border-bottom: 1px solid #f1f3f4;
    background: rgba(248, 249, 250, 0.5) !important; /* Very light background for fields */
    border-radius: 4px !important; /* Rounded corners for fields */
    margin: 4px 0 !important; /* Add vertical margin between fields */
}

.popup-field:last-child {
    border-bottom: none;
    margin-bottom: 0 !important;
}

.field-label {
    font-weight: 600 !important;
    color: #555 !important;
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 70px;
    flex-shrink: 0;
    padding-right: 4px !important; /* Add padding to label */
}

.field-value {
    color: #333 !important;
    font-size: 12px !important;
    text-align: right;
    flex: 1;
    word-break: break-word;
    padding-left: 4px !important; /* Add padding to value */
}

.field-value a {
    color: #667eea !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

.field-value a:hover {
    color: #4c63d2 !important;
    text-decoration: underline !important;
}

/* Specific popup type styling - all with white backgrounds */
.school-popup .popup-header h4 i {
    color: #4caf50 !important;
}

.early-childhood-popup .popup-header h4 i {
    color: #9c27b0 !important;
}

.ev-station-popup .popup-header h4 i {
    color: #f44336 !important;
}

/* Force white background for all popup types */
.school-popup,
.early-childhood-popup,
.ev-station-popup,
.cycleway-popup,
.traffic-monitor-popup,
.crash-data-popup,
.school-zone-popup {
    background: #ffffff !important;
    color: #333 !important;
}

/* Override any inherited background colors */
.leaflet-popup,
.leaflet-popup-content,
.custom-popup-wrapper,
.popup-body {
    background: #ffffff !important;
}

/* Prevent popup positioning issues that could cause map jumping */
.leaflet-popup-pane {
    pointer-events: auto !important;
    z-index: 700 !important;
}

/* =================================================
   CLUSTER TYPE COLORS - Specific Category Styling
   ================================================= */

/* Category-specific cluster colors */
.marker-cluster-ev {
    background-color: rgba(244, 67, 54, 0.3) !important;
}
.marker-cluster-ev div {
    background-color: rgba(244, 67, 54, 0.9) !important; /* Red for EV stations */
}

.marker-cluster-schools {
    background-color: rgba(76, 175, 80, 0.3) !important;
}
.marker-cluster-schools div {
    background-color: rgba(76, 175, 80, 0.9) !important; /* Green for schools */
}

.marker-cluster-early-childhood {
    background-color: rgba(156, 39, 176, 0.3) !important;
}
.marker-cluster-early-childhood div {
    background-color: rgba(156, 39, 176, 0.9) !important; /* Purple for ECE */
}

.marker-cluster-cycleways {
    background-color: rgba(255, 152, 0, 0.3) !important;
}
.marker-cluster-cycleways div {
    background-color: rgba(255, 152, 0, 0.9) !important; /* Orange for cycleways */
}

.marker-cluster-traffic {
    background-color: rgba(33, 150, 243, 0.3) !important;
}
.marker-cluster-traffic div {
    background-color: rgba(33, 150, 243, 0.9) !important; /* Blue for traffic monitors */
}

.marker-cluster-crash {
    background-color: rgba(255, 193, 7, 0.3) !important;
}
.marker-cluster-crash div {
    background-color: rgba(255, 193, 7, 0.9) !important; /* Amber for crash data */
}

/* =================================================
   LEAFLET POPUP POSITIONING & CONTAINER STYLES
   ================================================= */

.leaflet-popup {
    position: absolute !important;
    z-index: 1000 !important;
    margin: 0 !important;
}

/* Ensure map container allows proper interaction */
#map {
    position: relative !important;
}

.leaflet-container {
    position: relative !important;
}

/* =================================================
   SIZE-BASED CLUSTER STYLING
   ================================================= */

/* Size-based cluster styling */
.marker-cluster-small {
    background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.8);
}

.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
    background-color: rgba(240, 194, 12, 0.8);
}

.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
    background-color: rgba(241, 128, 23, 0.8);
}

/* =================================================
   ENHANCED POPUP STYLING - Professional Look
   ================================================= */

/* Override default popup styling for enhanced popups */
.leaflet-popup-content {
    margin: 8px 14px !important;
    line-height: 1.4 !important;
    font-size: 13px !important;
    min-width: 200px !important;
}

/* Enhanced popup content styling */
.leaflet-popup-content h3 {
    margin: 0 0 8px 0 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.leaflet-popup-content p {
    margin: 4px 0 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

.leaflet-popup-content p strong {
    font-weight: 600 !important;
    color: #333 !important;
}

/* =================================================
   PULSATING RED POINTER MARKER
   ================================================= */

/* Pulsating Marker Base */
.pulsating-marker {
    position: relative;
    background: #e74c3c;
    border: 3px solid rgba(231, 76, 60, 0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: pulse-red 2s infinite;
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
}

.pulsating-marker::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

/* Pulsating Animation */
@keyframes pulse-red {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Leaflet Marker Overrides */



/* =================================================
   PULSING POINTER MARKER (Report Page)
   ================================================= */

/* =================================================
   PROFESSIONAL PROPERTY MARKER - Pin Style with Pulsating Effect
   ================================================= */

.property-marker-container,
.leaflet-div-icon.property-marker-container {
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.property-pin {
    position: relative;
    width: 45px;
    height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Pulsating circles behind the pin - RED like original */
.pin-pulse,
.pin-pulse-2 {
    position: absolute;
    top: 11px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
}

.pin-pulse {
    animation: propertyPulse 2s ease-out infinite;
}

.pin-pulse-2 {
    animation: propertyPulse 2s ease-out infinite 1s;
}

@keyframes propertyPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.5;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* Main pin body - PERFECTLY CIRCULAR with RED color - 75% size */
.pin-body {
    position: relative;
    width: 33px;
    height: 33px;
    min-width: 33px;
    min-height: 33px;
    background: #ff0000;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.3),
                inset 0 1px 2px rgba(255, 255, 255, 0.3);
    z-index: 10;
    transition: all 0.3s ease;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
}

/* Icon inside the pin - no rotation needed since circle is not rotated */
.pin-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Sharp point at the bottom of the pin - original size, RED color */
.pin-point {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 12px solid #ff0000;
    z-index: 9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Hover effect - RED theme */
.property-pin:hover .pin-body {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5),
                inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.property-pin:hover .pin-pulse {
    animation: propertyPulseHover 1.5s ease-out infinite;
}

@keyframes propertyPulseHover {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* Ensure marker stays centered and properly anchored - 75% size */
.leaflet-div-icon.property-marker-container {
    margin-left: -22px !important;
    margin-top: -56px !important;
}

/* Mobile Interaction Styles */
.map-active {
    overflow: hidden;
    touch-action: none;
}

/* Mobile optimizations - maintain circular shape - 50% smaller */
@media (max-width: 768px) {
    .property-pin {
        width: 25px;
        height: 33px;
    }
    
    .pin-body {
        width: 19px;
        height: 19px;
        min-width: 19px;
        min-height: 19px;
        border: 1px solid white;
    }
    
    .pin-icon {
        font-size: 8px;
    }
    
    .pin-pulse,
    .pin-pulse-2 {
        width: 17px;
        height: 17px;
        min-width: 17px;
        min-height: 17px;
    }
}


/* =================================================
   MARKER CLUSTERING STYLES
   ================================================= */

/* Hide default cluster styling completely */
.marker-cluster:not(.marker-cluster-cycleways):not(.marker-cluster-ev):not(.marker-cluster-traffic):not(.marker-cluster-crash):not(.marker-cluster-schools):not(.marker-cluster-early-childhood) {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.marker-cluster:not(.marker-cluster-cycleways):not(.marker-cluster-ev):not(.marker-cluster-traffic):not(.marker-cluster-crash):not(.marker-cluster-schools):not(.marker-cluster-early-childhood) div {
    background: transparent !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
}

/* Base cluster styling - only applies when custom classes are present */
.marker-cluster.marker-cluster-cycleways,
.marker-cluster.marker-cluster-ev,
.marker-cluster.marker-cluster-traffic,
.marker-cluster.marker-cluster-crash,
.marker-cluster.marker-cluster-schools,
.marker-cluster.marker-cluster-early-childhood {
    background-clip: padding-box !important;
    border-radius: 20px !important;
    /* Default background - will be overridden by specific classes */
    background-color: rgba(181, 226, 140, 0.6) !important;
    border: 2px solid rgba(181, 226, 140, 0.8) !important;
    /* Ensure circular shape */
    width: 40px !important;
    height: 40px !important;
    aspect-ratio: 1 / 1;
    display: block !important;
    box-sizing: border-box !important;
}

.marker-cluster.marker-cluster-cycleways div,
.marker-cluster.marker-cluster-ev div,
.marker-cluster.marker-cluster-traffic div,
.marker-cluster.marker-cluster-crash div,
.marker-cluster.marker-cluster-schools div,
.marker-cluster.marker-cluster-early-childhood div {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    margin-left: 5px !important;
    margin-top: 5px !important;
    text-align: center !important;
    border-radius: 15px !important;
    font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif !important;
    /* Default background - will be overridden by specific classes */
    background-color: rgba(110, 204, 57, 0.8) !important;
    /* Force circular shape */
    aspect-ratio: 1 / 1;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.marker-cluster span {
    color: white !important;
    font-weight: bold !important;
    font-size: 12px !important;
    line-height: 1 !important;
    /* Ensure text stays centered */
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

.marker-cluster span {
    color: white !important;
    font-weight: bold !important;
    font-size: 12px !important;
    line-height: 1 !important;
    /* Ensure text stays centered */
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

/* EV Station clusters - Green (Higher specificity) */
.marker-cluster.marker-cluster-ev {
    background-color: rgba(76, 175, 80, 0.6) !important;
    border: 2px solid rgba(76, 175, 80, 0.8) !important;
}

.marker-cluster.marker-cluster-ev div {
    background-color: rgba(76, 175, 80, 0.8) !important;
}

/* Early Childhood clusters - Light Blue (Higher specificity) */
.marker-cluster.marker-cluster-early-childhood {
    background-color: rgba(135, 206, 250, 0.6) !important;
    border: 2px solid rgba(135, 206, 250, 0.8) !important;
}

.marker-cluster.marker-cluster-early-childhood div {
    background-color: rgba(135, 206, 250, 0.8) !important;
}

/* School clusters - Darker Blue (Higher specificity) */
.marker-cluster.marker-cluster-schools {
    background-color: rgba(25, 118, 210, 0.6) !important;
    border: 2px solid rgba(25, 118, 210, 0.8) !important;
}

.marker-cluster.marker-cluster-schools div {
    background-color: rgba(25, 118, 210, 0.8) !important;
}

/* Traffic Monitor clusters - Red (Higher specificity) */
.marker-cluster.marker-cluster-traffic {
    background-color: rgba(244, 67, 54, 0.6) !important;
    border: 2px solid rgba(244, 67, 54, 0.8) !important;
}

.marker-cluster.marker-cluster-traffic div {
    background-color: rgba(244, 67, 54, 0.8) !important;
}

/* School Zone clusters - Purple (Higher specificity) */
.marker-cluster.marker-cluster-school-zones {
    background-color: rgba(156, 39, 176, 0.6) !important;
    border: 2px solid rgba(156, 39, 176, 0.8) !important;
}

.marker-cluster.marker-cluster-school-zones div {
    background-color: rgba(156, 39, 176, 0.8) !important;
}

/* Auckland Cycleway clusters - Orange (Higher specificity) */
.marker-cluster.marker-cluster-cycleways {
    background-color: rgba(255, 152, 0, 0.6) !important;
    border: 2px solid rgba(255, 152, 0, 0.8) !important;
}

.marker-cluster.marker-cluster-cycleways div {
    background-color: rgba(255, 152, 0, 0.8) !important;
}


/* =================================================
   MARKER ICON FIXES
   ================================================= */

/* Fix for individual school/ECE marker backgrounds - NOT clusters or pointer */
.leaflet-div-icon.school-marker,
.leaflet-div-icon.zoned-school-marker,
.leaflet-div-icon.ece-marker {
    background: transparent;
    border: none;
    overflow: visible;
}

/* Ensure all map containers allow markers to overflow */
.leaflet-map-pane,
.leaflet-marker-pane,
.leaflet-shadow-pane,
.leaflet-overlay-pane,
.leaflet-popup-pane {
    overflow: visible;
}

.school-marker,
.zoned-school-marker,
.ece-marker,
.hospital-marker,
.ev-marker {
    overflow: visible;
}


/* =================================================
   POPUP STYLING
   ================================================= */

.leaflet-popup {
    z-index: 1000;
}

.leaflet-popup-content-wrapper {
    background: white !important;
    background-color: white !important;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
    padding: 0;
    border: 2px solid #ddd;
    opacity: 1;
    min-width: 320px;
    max-width: 400px;
}

.leaflet-popup-content {
    margin: 12px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 500;
    background: white !important;
    background-color: white !important;
}

.leaflet-popup-tip {
    background: white !important;
    background-color: white !important;
    box-shadow: 0 3px 14px rgba(0,0,0,0.4);
    border: 2px solid #ddd;
    border-top: none;
    border-left: none;
}

/* CRITICAL - Force popup styling with maximum specificity */
html body .leaflet-container .leaflet-popup .leaflet-popup-content-wrapper {
    background: white !important;
    background-color: white !important;
    border: 2px solid #007cba !important;
    border-radius: 8px !important;
    opacity: 1 !important;
}

html body .leaflet-container .leaflet-popup .leaflet-popup-content {
    background: white !important;
    background-color: white !important;
}

html body .leaflet-container .leaflet-popup .leaflet-popup-tip {
    background: white !important;
    background-color: white !important;
    border-right: 2px solid #007cba !important;
    border-bottom: 2px solid #007cba !important;
    border-top: none !important;
    border-left: none !important;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #757575;
    font-size: 20px;
    padding: 4px 8px;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #333;
}

/* =================================================
   CUSTOM POPUP CONTENT STYLING
   ================================================= */

.property-popup {
    text-align: center;
    padding: 4px 0;
    background: white !important;
    background-color: white !important;
    border-radius: 4px;
}

/* Force white background on all popup elements */
.leaflet-popup .leaflet-popup-content-wrapper,
.leaflet-popup .leaflet-popup-content {
    background: white !important;
    background-color: white !important;
}

.leaflet-popup .leaflet-popup-tip {
    background: white !important;
    background-color: white !important;
}

/* =================================================
   CATEGORY-SPECIFIC POPUP STYLING
   ================================================= */

/* Custom popup styling for different categories */
.custom-popup .leaflet-popup-content-wrapper {
    background: white !important;
    border: 2px solid #007cba !important;
    border-radius: 8px !important;
}

.custom-popup .leaflet-popup-tip {
    background: white !important;
    border-right: 2px solid #007cba !important;
    border-bottom: 2px solid #007cba !important;
}

/* Category-specific popup content styling */
.cycleway-popup,
.ev-station-popup,
.traffic-monitor-popup,
.school-popup,
.school-zone-popup,
.ece-popup {
    background: white !important;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #007cba;
}

/* Cycleway popups - Orange */
.cycleway-popup {
    border-left-color: #ff9800;
}

/* EV Station popups - Green */
.ev-station-popup {
    border-left-color: #4caf50;
}

/* Traffic Monitor popups - Red */
.traffic-monitor-popup {
    border-left-color: #f44336;
}

/* School popups - Darker Blue */
.school-popup {
    border-left-color: #1976d2;
}

/* School Zone popups - Purple */
.school-zone-popup {
    border-left-color: #9c27b0;
}

/* Early Childhood popups - Light Blue */
.ece-popup {
    border-left-color: #87ceeb;
}

/* Popup title styling */
.cycleway-popup h3,
.ev-station-popup h3,
.traffic-monitor-popup h3,
.school-popup h3,
.school-zone-popup h3,
.ece-popup h3,
.cycleway-popup h4,
.ev-station-popup h4,
.traffic-monitor-popup h4,
.school-popup h4,
.school-zone-popup h4,
.ece-popup h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* Popup content styling */
.cycleway-popup p,
.ev-station-popup p,
.traffic-monitor-popup p,
.school-popup p,
.school-zone-popup p,
.ece-popup p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.4;
    color: #555;
}

.cycleway-popup strong,
.ev-station-popup strong,
.traffic-monitor-popup strong,
.school-popup strong,
.school-zone-popup strong,
.ece-popup strong {
    color: #333;
    font-weight: 600;
}

/* Override any transparent backgrounds in popup content */
.leaflet-popup-content > div {
    background: white !important;
}

/* =================================================
   ALTERNATING ROW STYLING FOR POPUPS
   ================================================= */

/* Style for popup content with alternating rows */
.cycleway-popup > p:nth-child(even),
.ev-station-popup > p:nth-child(even),
.traffic-monitor-popup > p:nth-child(even),
.school-popup > p:nth-child(even),
.school-zone-popup > p:nth-child(even),
.ece-popup > p:nth-child(even) {
    background-color: #f8f9fa !important;
    padding: 6px 8px;
    margin: 2px -8px;
    border-radius: 4px;
}

.cycleway-popup > p:nth-child(odd),
.ev-station-popup > p:nth-child(odd),
.traffic-monitor-popup > p:nth-child(odd),
.school-popup > p:nth-child(odd),
.school-zone-popup > p:nth-child(odd),
.ece-popup > p:nth-child(odd) {
    background-color: white !important;
    padding: 6px 8px;
    margin: 2px -8px;
    border-radius: 4px;
}

/* Alternative approach for any elements inside popup content */
.leaflet-popup-content p:nth-child(even) {
    background-color: #f8f9fa !important;
    padding: 6px 8px;
    margin: 2px -8px;
    border-radius: 4px;
}

.leaflet-popup-content p:nth-child(odd) {
    background-color: white !important;
    padding: 6px 8px;
    margin: 2px -8px;
    border-radius: 4px;
}

/* Style for div elements if popups use divs instead of paragraphs */
.leaflet-popup-content div:nth-child(even) {
    background-color: #f8f9fa !important;
    padding: 6px 8px;
    margin: 2px -8px;
    border-radius: 4px;
}

.leaflet-popup-content div:nth-child(odd) {
    background-color: white !important;
    padding: 6px 8px;
    margin: 2px -8px;
    border-radius: 4px;
}

/* Additional styling for better readability */
.leaflet-popup-content {
    padding: 8px !important;
}

/* Ensure headers don't get alternating colors */
.leaflet-popup-content h3,
.leaflet-popup-content h4,
.leaflet-popup-content h5 {
    background: transparent !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
}

.property-popup strong {
    color: #e74c3c;
    font-size: 14px;
    font-weight: 600;
}

.property-popup small {
    color: #666;
    font-size: 12px;
    line-height: 1.3;
}

.school-popup,
.zoned-school-popup,
.ece-popup {
    padding: 4px 0;
}

.school-popup strong,
.zoned-school-popup strong,
.ece-popup strong {
    font-size: 14px;
    font-weight: 600;
}

.zone-badge-popup {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
}

