/* Custom colored marker styles */
.custom-colored-marker {
    background: none !important;
    border: none !important;
}

.custom-colored-marker div {
    background: none !important;
    border: none !important;
}

/* Ensure marker SVG displays correctly */
.custom-colored-marker svg {
    display: block;
    margin: 0 auto;
}

/* Map container styles */
.afi-map {
    position: relative;
}

.afi-map .map {
    height: 100%;
    width: 100%;
}

/* Phase color classes for consistency */
.bg-phase1 {
    background-color: #CDFACD !important;
}

.bg-phase2 {
    background-color: #FAE61E !important;
}

.bg-phase3 {
    background-color: #E67800 !important;
}

.bg-phase4 {
    background-color: #C80000 !important;
}

.bg-phase5 {
    background-color: #640000 !important;
}

.phase1-color {
    color: #CDFACD !important;
}

.phase2-color {
    color: #FAE61E !important;
}

.phase3-color {
    color: #E67800 !important;
}

.phase4-color {
    color: #C80000 !important;
}

.phase5-color {
    color: #640000 !important;
}

/* Label styles for points and polygons */
.point-label {
    background: none !important;
    border: none !important;
}

.point-label-text {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    text-align: center;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 3px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.polygon-label {
    background: none !important;
    border: none !important;
}

.polygon-label-text {
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-align: center;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 3px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ensure labels don't interfere with map interactions */
.point-label, .polygon-label {
    pointer-events: none;
    z-index: 1000;
}

.point-label-text, .polygon-label-text {
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Leaflet.LabelTextCollision plugin styles */
.leaflet-label-text-collision {
    background: none !important;
    border: none !important;
    pointer-events: none;
    user-select: none;
    z-index: 1000;
}

.leaflet-label-text-collision.point-label-text {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    text-align: center;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 3px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.leaflet-label-text-collision.polygon-label-text {
    padding: 3px 8px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-align: center;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        0 0 3px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive label sizing */
@media (max-width: 768px) {
    .point-label-text {
        font-size: 10px;
        padding: 1px 4px;
    }
    
    .polygon-label-text {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Hide labels on very small screens or low zoom */
@media (max-width: 480px) {
    .point-label-text {
        font-size: 9px;
        padding: 1px 3px;
    }
}

/* Animation for label appearance */
.leaflet-marker-icon.point-label,
.leaflet-marker-icon.polygon-label {
    animation: labelFadeIn 0.3s ease-in-out;
}

@keyframes labelFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* GeoJSON feature labels */
.geojson-label {
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    text-align: center;
    white-space: nowrap;
    box-shadow: none;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        -1px 0 0 #fff,
        1px 0 0 #fff,
        0 -1px 0 #fff,
        0 1px 0 #fff,
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff;
    pointer-events: none;
    user-select: none;
}

/* Remove default leaflet tooltip styling for geojson labels */
.geojson-label::before {
    display: none;
}

/* Responsive sizing for geojson labels */
@media (max-width: 768px) {
    .geojson-label {
        font-size: 11px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .geojson-label {
        font-size: 10px;
        padding: 2px 5px;
    }
}

/* Region boundary label styling */
.poly-label {
    background: transparent !important;
    border: none !important;
    border-radius: 0;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 500;
    color: #333;
    text-align: center;
    white-space: nowrap;
    box-shadow: none;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        -1px 0 0 #fff,
        1px 0 0 #fff,
        0 -1px 0 #fff,
        0 1px 0 #fff,
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff;
    pointer-events: none;
    user-select: none;
}

/* Remove default leaflet tooltip styling for poly labels */
.poly-label::before {
    display: none;
}

/* Responsive sizing for poly labels */
@media (max-width: 768px) {
    .poly-label {
        font-size: 10px;
        padding: 2px 5px;
    }
}

@media (max-width: 480px) {
    .poly-label {
        font-size: 9px;
        padding: 2px 4px;
    }

/* Custom cluster marker styles using SVG icons */
.custom-cluster-marker {
    background: none !important;
    border: none !important;
}

.custom-cluster-marker div {
    background: none !important;
    border: none !important;
}

/* Ensure cluster SVG displays correctly */
.custom-cluster-marker svg {
    display: block;
    margin: 0 auto;
}

/* Animation for cluster appearance */
.custom-cluster-marker {
    animation: clusterFadeIn 0.3s ease-in-out;
}

@keyframes clusterFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Country label styling for region layer */
.country-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 14px;
    font-weight: 600;
    color: #4a4a4a;
    text-align: center;
    white-space: nowrap;
    text-shadow:
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        -2px 0 0 #fff,
        2px 0 0 #fff,
        0 -2px 0 #fff,
        0 2px 0 #fff,
        0 0 3px rgba(255, 255, 255, 0.9);
    pointer-events: none;
    user-select: none;
}

/* Remove default leaflet tooltip styling for country labels */
.country-label::before {
    display: none;
}

/* Responsive sizing for country labels */
@media (max-width: 768px) {
    .country-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .country-label {
        font-size: 11px;
    }
}
}
