/* ===== EDITORIAL CLUSTER MARKERS - DESIGN SYSTEM COMPLIANT ===== */

/* Design System Variables */
:root {
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    
    --color-text-dark: #1a202c;
    --color-text-medium: #4a5568;
    --color-bg-white: #fdfdfd;
    --color-bg-light-gray: #f8fafc;
    --color-border: #e2e8f0;
    
    --color-accent-fatal: #c53030;
    --color-accent-injured: #b7791f;
    --color-accent-interactive: #4299e1;
}

/* Individual mountain markers - Following design system */
.individual-marker-custom {
    background: transparent !important;
    border: none !important;
}

.individual-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

/* Name View - Individual markers using design system */
.individual-marker.name-view {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #1a202c; /* var(--color-text-dark) */
    border: none;
}

.individual-marker.name-view .marker-icon {
    color: white;
}

.individual-marker.name-view:hover,
.individual-marker.name-view.hover-state {
    transform: scale(1.1);
    z-index: 1000;
}

.individual-marker.name-view.active {
    border: 2px solid #4299e1; /* var(--color-accent-interactive) */
    box-shadow: 0 0 12px rgba(66, 153, 225, 0.5);
}

/* Numbers View - Individual markers using exact design system colors */
.individual-marker.numbers-view {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 14px;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.individual-marker.numbers-view::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid;
    pointer-events: none;
    z-index: -1;
}

/* Low incident count outline */
.individual-marker.numbers-view.low-count::after {
    border-color: #94a3b8; /* Subtle gray outline for low counts */
}

/* Medium incident count outline */
.individual-marker.numbers-view.medium-count::after {
    border-color: #d69e2e; /* Warm amber outline for medium counts */
}

/* High incident count outline */
.individual-marker.numbers-view.high-count::after {
    border-color: #e53e3e; /* Strong red outline for high counts */
}

.individual-marker.numbers-view .marker-number {
    font-size: 14px;
    font-weight: 700;
}

.individual-marker.numbers-view:hover,
.individual-marker.numbers-view.hover-state {
    transform: scale(1.1);
    z-index: 1000;
}

/* Mountain name hover label */
.mountain-hover-label {
    background-color: var(--color-text-dark);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
    animation: fadeInHover 0.2s ease-in-out forwards;
}

@keyframes fadeInHover {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Editorial cluster markers - Design system compliant */
.editorial-cluster-custom {
    background: transparent !important;
    border: none !important;
}

.editorial-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    border: 2px solid white;
}

.editorial-cluster:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Name View - Cluster markers using design system */
.editorial-cluster.name-view {
    background-color: #1a202c; /* var(--color-text-dark) */
    width: 80px;
    height: 80px;
}

.editorial-cluster.name-view .cluster-incident-count {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 24px;
    color: white;
    line-height: 1;
    margin-bottom: 2px;
}

.editorial-cluster.name-view .cluster-context {
    font-family: 'Lato', sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.1;
    max-width: 60px;
}

/* Numbers View - Cluster markers using design system colors */
.editorial-cluster.numbers-view {
    width: 60px;
    height: 60px;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    position: relative;
}

.editorial-cluster.numbers-view::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 2px solid;
    pointer-events: none;
    z-index: -1;
}

/* Cluster outline colors matching individual markers */
.editorial-cluster.numbers-view.low-count::after {
    border-color: #94a3b8; /* Subtle gray outline for low counts */
}

.editorial-cluster.numbers-view.medium-count::after {
    border-color: #d69e2e; /* Warm amber outline for medium counts */
}

.editorial-cluster.numbers-view.high-count::after {
    border-color: #e53e3e; /* Strong red outline for high counts */
}

.editorial-cluster.numbers-view .cluster-number {
    font-size: 20px;
    font-weight: 700;
}

/* Map legend updates for new markers */
.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 200px;
}

.map-legend h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Lato', sans-serif;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #495057;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-marker {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 0.5rem;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.legend-marker.mountain-marker-low {
    background-color: var(--color-border); /* #e2e8f0 */
}

.legend-marker.mountain-marker-medium {
    background-color: var(--color-accent-injured); /* #b7791f */
}

.legend-marker.mountain-marker-high {
    background-color: var(--color-accent-fatal); /* #c53030 */
}

/* Toggle button styles - Design system compliant */
.map-toggle-btn {
    background-color: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-medium);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-body);
}

.map-toggle-btn:hover {
    background-color: var(--color-bg-light-gray);
    border-color: var(--color-text-dark);
}

.map-toggle-btn.active-state {
    background-color: var(--color-border);
    border-color: var(--color-text-dark);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(1px);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

.toggle-text {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
}

/* Mobile responsive adjustments for clusters */
@media (max-width: 768px) {
    .editorial-cluster.name-view {
        width: 60px;
        height: 60px;
    }
    
    .editorial-cluster.name-view .cluster-incident-count {
        font-size: 18px;
    }
    
    .editorial-cluster.name-view .cluster-context {
        font-size: 9px;
        max-width: 50px;
    }
    
    .editorial-cluster.numbers-view {
        width: 50px;
        height: 50px;
    }
    
    .editorial-cluster.numbers-view .cluster-number {
        font-size: 16px;
    }
    
    .individual-marker.name-view {
        padding: 4px 8px;
        min-width: 50px;
    }
    
    .individual-marker.name-view .marker-text {
        font-size: 10px;
    }
    
    .individual-marker.numbers-view {
        width: 30px;
        height: 30px;
    }
    
    .individual-marker.numbers-view .marker-number {
        font-size: 12px;
    }
    
    .map-legend {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 0.75rem;
    }
    
    .map-toggle-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Mobile Diamond Markers - Option 5: Rotated Square */
/* Desktop Circular Markers with New Mountain Icon */
.individual-marker-custom .individual-marker {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    background: linear-gradient(135deg, #2c3e50, #34495e) !important;
    transition: all 0.2s ease !important;
}

/* Numbers mode - better contrast colors */
.individual-marker-custom .individual-marker.numbers-view {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    border: 2px solid rgba(0, 0, 0, 0.2) !important;
    color: #212529 !important;
}

.individual-marker-custom .individual-marker.numbers-view .marker-number {
    color: #212529 !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

/* All numbers mode markers use consistent design language colors */

/* Mobile markers - same as desktop but larger for touch */
@media (max-width: 768px), (max-width: 480px), (orientation: portrait) {
    .individual-marker-custom .individual-marker {
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.15) !important;
        border: 3px solid rgba(255, 255, 255, 0.9) !important;
        background: linear-gradient(135deg, #2c3e50, #34495e) !important;
        transition: all 0.2s ease !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }
    
.individual-marker-custom .individual-marker:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25), 0 3px 6px rgba(0, 0, 0, 0.15) !important;
}

.individual-marker-custom .individual-marker .marker-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
}

/* More specific selector for SVG icons - no rotation needed for circular markers */
.individual-marker-custom .individual-marker svg.marker-icon {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
}

.individual-marker-custom .individual-marker .marker-number {
    transform: rotate(-45deg) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

/* Override the circular border-radius for diamond shape with higher specificity */
.individual-marker-custom .individual-marker.name-view,
.individual-marker-custom .individual-marker.numbers-view {
    border-radius: 6px !important;
}

/* Force diamond shape - override any circular styles */
.individual-marker-custom .individual-marker.name-view {
    border-radius: 6px !important;
}

.individual-marker-custom .individual-marker.numbers-view {
    border-radius: 6px !important;
}

/* Override the ::after pseudo-element border-radius too */
.individual-marker-custom .individual-marker.numbers-view::after {
    border-radius: 6px !important;
}

/* Enhanced styling for different risk levels */
.individual-marker-custom .individual-marker.numbers-view.low-count {
    background: linear-gradient(135deg, #27ae60, #2ecc71) !important;
}

.individual-marker-custom .individual-marker.numbers-view.medium-count {
    background: linear-gradient(135deg, #f39c12, #e67e22) !important;
}

.individual-marker-custom .individual-marker.numbers-view.high-count {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
}

/* Ensure proper sizing for diamond markers */
.individual-marker-custom {
    width: 32px !important;
    height: 32px !important;
}

@media (max-width: 768px) {
    .individual-marker-custom .individual-marker:hover {
        transform: scale(1.15) !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2) !important;
    }
    
    .individual-marker-custom .individual-marker .marker-icon {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
    }
    
    /* Mobile SVG icons - no rotation needed for circular markers */
    .individual-marker-custom .individual-marker svg {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
    }
    
    .individual-marker-custom .individual-marker svg.marker-icon {
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
    }
    
    .individual-marker-custom .individual-marker .marker-number {
        font-weight: 700 !important;
        text-shadow: none !important;
    }
    
    /* Mobile numbers mode - better contrast colors */
    .individual-marker-custom .individual-marker.numbers-view {
        background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
        border: 3px solid rgba(0, 0, 0, 0.2) !important;
        color: #212529 !important;
    }
    
    .individual-marker-custom .individual-marker.numbers-view .marker-number {
        color: #212529 !important;
        font-weight: 700 !important;
        text-shadow: none !important;
    }
    
    /* Ensure circular shape for mobile markers */
    .individual-marker-custom .individual-marker.name-view,
    .individual-marker-custom .individual-marker.numbers-view {
        border-radius: 50% !important;
    }
    
    .individual-marker-custom .individual-marker.name-view {
        border-radius: 50% !important;
    }
    
    .individual-marker-custom .individual-marker.numbers-view {
        border-radius: 50% !important;
    }
    
    /* Ensure ::after pseudo-element is also circular */
    .individual-marker-custom .individual-marker.numbers-view::after {
        border-radius: 50% !important;
    }
    
    /* All mobile numbers mode markers use consistent design language colors */
    
    /* Ensure proper sizing for mobile markers - prevent squishing */
    .individual-marker-custom {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }
}
