/* styles-stats-map.css */
:root {
    --map-primary-color: #ff6b6b;
    --map-secondary-color: #ff6b6b;
    --map-success-color: #51cf66;
    --map-warning-color: #ff922b;
    --point-parent-radius: 4px;
    --point-child-radius: 4px;
    --point-parent-weight: 2px;
    --point-child-weight: 2px;
    --point-parent-opacity: 0.7;
    --point-child-opacity: 0.8;
    --point-parent-fill-opacity: 0.4;
    --point-child-fill-opacity: 0.5;
    --point-color: var(--map-primary-color);
    --point-fill-color: var(--map-primary-color);
    --polygon-parent-weight: 7px;
    --polygon-child-weight: 5px;
    --polygon-parent-opacity: 0.8;
    --polygon-child-opacity: 0.7;
    --polygon-parent-fill-opacity: 0.2;
    --polygon-child-fill-opacity: 0.3;
    --polygon-color: var(--map-primary-color);
    --polygon-fill-color: var(--map-primary-color);
    --line-parent-weight: 4px;
    --line-child-weight: 4px;
    --line-parent-opacity: 0.5;
    --line-child-opacity: 0.7;
    --line-color: var(--map-primary-color);
}

.map-container {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
/*    margin-bottom: 20px;*/
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 10px;
}

.map-container.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #fff;
    padding: 0px;
}

.map-content {
/*    height: 500px;*/
    width: 100%;
}

.map-container.fullscreen .map-content {
    height: 103% !important;
    width: 100% !important;
}

.map-title {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.map-container.fullscreen .map-title {
    display: none;
}

.fullscreen-btn {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: normal;
    margin-left: 2px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    height: 20px;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.fullscreen-btn svg {
    width: 14px;
    height: 14px;
}

.map-container.fullscreen .fullscreen-btn {
    display: none;
}

.map-fullscreen-close-btn {
    position: fixed;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.map-fullscreen-close-btn:hover {
    background: white;
    border-color: #999;
    transform: scale(1.1);
}

.map-fullscreen-close-btn:active {
    transform: scale(0.95);
}

body.map-fullscreen-active {
    overflow: hidden;
}

.map-popup {
    min-width: 200px;
    max-width: 300px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.map-popup h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.map-popup p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.map-popup strong {
    color: #333;
    min-width: 80px;
    display: inline-block;
}

.map-popup small {
    color: #888;
    font-size: 12px;
}

.map-popup-id {
    color: #888;
    font-size: 11px;
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 5px;
}

.leaflet-popup {
    transition: none !important;
    animation: none !important;
}

.leaflet-popup-content-wrapper {
    transition: none !important;
    animation: none !important;
}

.leaflet-popup-tip {
    transition: none !important;
    animation: none !important;
}

.leaflet-popup-content {
    min-width: 200px;
    margin: 10px;
}

.leaflet-popup-content h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.leaflet-popup-content p {
    margin: 0.3em;
    font-size: 12px;
    line-height: 1;
}

.leaflet-popup-content strong {
    color: #333;
    display: inline-block;
}

.leaflet-popup .error-message {
    color: #d32f2f;
    font-weight: bold;
}

.leaflet-popup .info-message {
    color: #1976d2;
}

.map-tooltip {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.map-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 12px;
    color: #421C18;
    pointer-events: none !important;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

.leaflet-geo-feature-parent + .map-label {
    font-size: 14px;
    font-weight: 900;
    color: #000;
}

.leaflet-geo-feature-child + .map-label {
    font-size: 11px;
    font-weight: normal;
    color: #555;
}

.leaflet-geo-feature-parent,
.leaflet-geo-feature-child {
    cursor: pointer;
}

.leaflet-geo-feature-parent[style*="display: none"],
.leaflet-geo-feature-child[style*="display: none"] {
    cursor: default !important;
    pointer-events: none !important;
}

.leaflet-interactive[style*="opacity: 0"] {
    cursor: default !important;
    pointer-events: none !important;
}

.leaflet-marker-icon[style*="display: none"] {
    cursor: default !important;
    pointer-events: none !important;
}

.leaflet-geo-hidden {
    cursor: default !important;
    pointer-events: none !important;
    opacity: 0 !important;
    fill-opacity: 0 !important;
}

.leaflet-hexagon {
    cursor: pointer;
}

.leaflet-hexagon:hover {
    fill-opacity: 0.9;
}

.hexbin-popup {
    min-width: 200px;
    max-width: 300px;
    line-height: 1;
}

.hexbin-popup h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.hexbin-popup p {
    font-size: 12px;
    color: #555;
}

.hexbin-popup strong {
    color: #333;
    display: inline-block;
}

.hexbin-legend {
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    font-size: 12px;
    line-height: 1.4;
}

.hexbin-legend-scale {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.hexbin-legend-color {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    border: 1px solid #ccc;
}

@media (max-width: 768px) {
    .map-container {
        border-radius: 8px;
        border-left: none;
        border-right: none;
    }
    .map-content {
        height: 300px;
    }
    .map-popup {
        max-width: 250px;
    }
    .leaflet-popup-content {
        min-width: 180px;
    }
    .map-fullscreen-close-btn {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    .fullscreen-btn {
        height: 20px;
    }
    :root {
        --point-parent-radius: 7px;
        --point-child-radius: 5px;
        --point-parent-weight: 2px;
        --point-child-weight: 1.5px;
    }
}

@media (max-width: 480px) {
    .map-container.fullscreen .leaflet-control-container {
        font-size: 14px;
    }
    .map-container.fullscreen .leaflet-control-zoom {
        transform: scale(0.9);
        margin: 10px;
    }
}

.map-highlighted {
    box-shadow: 0 0 0 3px #ff0000, 0 0 20px rgba(255, 0, 0, 0.5);
    transition: box-shadow 0.3s ease;
    border-radius: 4px;
}
