/* Kionera Interactive Map Styles */

.kionera-interactive-map {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

/* Tabs Navigation */
.kionera-map-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    background: #59331A;
    border-radius: 8px 8px 0 0;
    padding: 0;
    margin-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.kionera-map-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.tab-button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 500;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    min-width: max-content;
}

.tab-button:hover,
.tab-button.active {
    color: #ffffff;
    border-bottom-color: #007cba;
}

/* .tab-button.active {
    background: rgba(0, 124, 186, 0.1);
} */

/* Map Container */
.kionera-map-container {
    position: relative;
    width: 100%;
    background: transparent;
    border-radius: 0 0 8px 8px;
    overflow: visible; /* Permite tooltips serem exibidos fora do container */
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

/* Map Points Container */
.map-points-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual Map Points */
.map-point {
    position: absolute;
    pointer-events: all;
    cursor: pointer;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.3s ease;
}

.map-point.hidden {
    display: none;
}

/* Point Marker */
.point-marker {
    width: 20px;
    height: 20px;
    background: transparent !important;
    /* border: 3px solid #ffffff; */
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.map-point:hover .point-marker {
    transform: scale(1.2);
    background: #005a87;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.map-point:hover .point-tooltip img{
    transform: scale(1.2);
    -webkit-transform: scale(1.2);
}

/* Point Tooltip */
.point-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    /* background: #ffffff; */
    border-radius: 8px;
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); */
    padding: 12px;
    min-width: 82px;
    max-width: 250px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    text-align: center;
    font-family: 'Presicav New', sans-serif;
}

.point-tooltip img {
    border: 1px solid #fff;
}

.point-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 48.5%;
    transform: translateX(-50%);
    border: 1px solid #ffffffab;
    /* border-top-color: #ffffff; */
    height: 22px;
}

/* Tooltip posicionado abaixo do ponto */
.point-tooltip.tooltip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #ffffff;
}

.always-visible-tooltip .point-market{
    top: 5px;
}

.always-visible-tooltip .point-tooltip::after{
    left: 49.5%;
}

.map-point:hover .point-tooltip,
.map-point.active .point-tooltip,
.map-point.always-visible-tooltip .point-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: 35px;
}

.tooltip-image {
    width: 58px !important;
    height: 58px !important;
    object-fit: cover;
    border-radius: 100%;
    -webkit-border-radius: 100% !important;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
}

.tooltip-title {
    margin: 0;
    font-size: 11px;
    font-weight: 200;
    color: #fff;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Adiciona espaço ao redor do mapa para tooltips */
    .kionera-interactive-map {
        padding: 20px 10px;
    }
    
    .kionera-map-tabs {
        justify-content: flex-start;
        padding: 0 10px;
    }
    
    .tab-button {
        padding: 12px 16px;
        font-size: 12px;
        min-width: auto;
        flex-shrink: 0;
    }
    
    .point-tooltip {
        min-width: 82px;
        max-width: 200px;
        padding: 8px;
        /* Ajusta posicionamento para evitar cortes */
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .tooltip-image {
        width: 48px !important;
        height: 48px !important;
    }
    
    .tooltip-title {
        font-size: 13px;
    }
    
    .point-marker {
        width: 16px;
        height: 16px;
        border-width: 2px;
    }
    
    .map-point:hover .point-marker {
        transform: scale(1.1);
    }
}

@media (max-width: 480px) {
    .always-visible-tooltip  .point-tooltip {
        margin-left: 1px !important;
    }

    .point-tooltip::after {
        left: 50%;
    }

    .kionera-map-container, .map-image {
        height: 315px !important;
        object-fit: contain;
    }
    /* Mais espaço para dispositivos muito pequenos */
    .kionera-interactive-map {
        padding: 25px 5px;
    }
    
    .kionera-map-tabs {
        padding: 0 5px;
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .point-tooltip {
        min-width: 70px;
        max-width: 150px;
        padding: 6px;
        /* Margem para evitar cortes nas bordas */
        margin-left: -3px !important;
       /*   margin-right: -5px; */
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .tooltip-image {
        width: 40px !important;
        height: 40px !important;
    }
    
    .tooltip-title {
        font-size: 12px;
    }
    
    .point-marker {
        width: 14px;
        height: 14px;
    }

    .active .point-marker{
        left: 3px;
    }
    
    /* Auto-posicionamento inteligente dos tooltips em mobile */
    .map-point[style*="left: 0%"],
    .map-point[style*="left: 1%"],
    .map-point[style*="left: 2%"],
    .map-point[style*="left: 3%"],
    .map-point[style*="left: 4%"],
    .map-point[style*="left: 5%"] {
        .point-tooltip {
            left: 0;
            transform: translateX(0);
        }
    }
    
    .map-point[style*="left: 95%"],
    .map-point[style*="left: 96%"],
    .map-point[style*="left: 97%"],
    .map-point[style*="left: 98%"],
    .map-point[style*="left: 99%"],
    .map-point[style*="left: 100%"] {
        .point-tooltip {
            left: auto;
            right: 0;
            transform: translateX(0);
        }
    }
}

/* Animation for point appearance */
@keyframes pointAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.map-point {
    /* transform: scale(1.5);
    -webkit-transform: scale(1.5); */
    animation: pointAppear 0.3s ease-out;
}

/* Smooth transitions for filtering */
.map-point {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.map-point.filtering-out {
    opacity: 0;
    visibility: hidden;
}

/* Special styling for different categories */
.map-point[data-categories*="banks"] .point-marker {
    background: #28a745;
}

.map-point[data-categories*="supermarkets"] .point-marker {
    background: #17a2b8;
}

.map-point[data-categories*="education"] .point-marker {
    background: #ffc107;
}

.map-point[data-categories*="pharmacies"] .point-marker {
    background: #dc3545;
}

.map-point[data-categories*="attractions"] .point-marker {
    background: #6f42c1;
}

.map-point[data-categories*="cinemas"] .point-marker {
    background: #fd7e14;
}

/* Hover effects for category-specific colors */
.map-point[data-categories*="banks"]:hover .point-marker {
    background: #218838;
}

.map-point[data-categories*="supermarkets"]:hover .point-marker {
    background: #138496;
}

.map-point[data-categories*="education"]:hover .point-marker {
    background: #e0a800;
}

.map-point[data-categories*="pharmacies"]:hover .point-marker {
    background: #c82333;
}

.map-point[data-categories*="attractions"]:hover .point-marker {
    background: #59359a;
}

.map-point[data-categories*="cinemas"]:hover .point-marker {
    background: #e8650e;
}

/* Always visible tooltip styles */
.map-point.always-visible-tooltip .point-tooltip {
    /* Garantir que sempre fique visível */
    opacity: 1 !important;
    visibility: visible !important;
    /* Adicionar uma sombra mais sutil para não poluir visualmente */
    /* box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15); */
    /* Leve animação de pulso para destacar */
    /* animation: subtlePulse 3s ease-in-out infinite; */
}

/* Garantir que pontos sempre visíveis sejam mostrados mesmo quando filtrados */
.map-point.always-visible-tooltip.hidden {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.map-point.always-visible-tooltip.filtering-out {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Animação sutil para tooltips sempre visíveis */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    }
}

/* Garantir que tooltips sempre visíveis não sejam afetados por filtros */
.map-point.always-visible-tooltip .point-tooltip {
    z-index: 150; /* Maior z-index para ficar sempre por cima */
}

/* Estilo diferenciado para o marcador de pontos sempre visíveis */
.map-point.always-visible-tooltip .point-marker {
    /* box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3); */
    /* animation: markerPulse 2s ease-in-out infinite; */
}

@keyframes markerPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}