/* CSS Reset Simplificado */
html {
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Container Principal */
#imagem-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    text-align: center;
    background-color: #f0f0f0;
}

/* Imagem do Mapa */
#mapa-principal {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
}

/* Destaque das Áreas */
.area-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.area-highlight polygon {
    fill: rgba(255, 215, 0, 0.2);
    stroke: #ff5722;
    stroke-width: 3px;
    stroke-dasharray: 5, 5;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.3; }
}

/* Container da Animação */
#animacao-wrapper {
    position: fixed;
    top: 25%;         /* posição padrão em telas grandes */
    right: 220px;
    transform: translateY(-50%);
    z-index: 10;
    width: min(300px, 24vw);
}

#animacao-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    max-height: 300px;
    display: none;
}

#animacao {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Balões Ajustados */
.balao-imagem-container {
    position: fixed;
    top: 57%;
    right: -250px;
    transform: translateY(-50%) scale(7);
    transform-origin: right bottom;
    z-index: 20;
    display: none;
    width: 180px;
}

.balao-imagem-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Responsividade */
@media (max-width: 1600px) {
    .balao-imagem-container {
        transform: scale(2.5);
        width: 180px;
    }
    #animacao-wrapper {
        right: 150px;
        top: 28%;
    }
}

@media (max-width: 1200px) {
    .balao-imagem-container {
        transform: scale(2);
        width: 180px;
    }
    #animacao-wrapper {
        right: 100px;
        top: 30%;
    }
}

@media (max-width: 992px) {
    .balao-imagem-container {
        transform: scale(1.7);
        width: 160px;
    }
    #animacao-wrapper {
        width: min(200px, 35vw);
        right: 50px;
        top: 35%;   /* desce um pouco mais */
    }
    #animacao-container {
        max-width: 200px;
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .balao-imagem-container {
        transform: scale(1.3);
        width: 140px;
        bottom: calc(100% + 30px);
    }
    #animacao-wrapper {
        width: min(150px, 40vw);
        right: 15px;
        top: 40%;   /* mais abaixo */
    }
    #animacao-container {
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 576px) {
    .balao-imagem-container {
        transform: scale(1);
        width: 120px;
    }
    #animacao-wrapper {
        width: min(120px, 50vw);
        right: 5px;
        top: 50%;   /* celular → centralizado verticalmente */
    }
    #animacao-container {
        max-width: 120px;
        max-height: 120px;
    }
}
