/* ==========================================================================
   Mapa Interactivo de Universidades Mineras - Estilos
   ========================================================================== */

/* Contenedor principal */
.mapa-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    line-height: 0;
}

.mapa-container img.mapa-fondo {
    width: 100%;
    height: auto;
    display: block;
}

/* SVG overlay */
.mapa-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* ── Marcadores/Pins ── */

/* Área invisible de hover */
.marcador-ccaa .hit-area {
    fill: transparent;
    cursor: pointer;
}

/* Pin visible */
.marcador-ccaa .pin-dot {
    fill: #2D7D2D;
    stroke: #ffffff;
    stroke-width: 2.5;
    cursor: pointer;
    transition: r 0.25s ease, fill 0.25s ease;
}

/* Punto interior blanco */
.marcador-ccaa .pin-inner {
    fill: #ffffff;
    pointer-events: none;
    transition: r 0.25s ease;
}

/* Anillo de pulso */
.marcador-ccaa .pulse-ring {
    fill: transparent;
    stroke: #2D7D2D;
    stroke-width: 2;
    opacity: 0;
    pointer-events: none;
    animation: pulse-anim 2.5s ease-out infinite;
}

@keyframes pulse-anim {
    0% {
        r: 10;
        opacity: 0.6;
    }
    100% {
        r: 30;
        opacity: 0;
    }
}

/* Estado hover / active */
.marcador-ccaa:hover .pin-dot,
.marcador-ccaa.active .pin-dot {
    fill: #1B5E1B;
    r: 14;
}

.marcador-ccaa:hover .pin-inner,
.marcador-ccaa.active .pin-inner {
    r: 5;
}

.marcador-ccaa:hover .pulse-ring,
.marcador-ccaa.active .pulse-ring {
    animation: none;
    opacity: 0;
}

/* ── Tooltip ── */
.mapa-tooltip {
    position: absolute;
    z-index: 100;
    background: #ffffff;
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border-left: 4px solid #2D7D2D;
    max-width: 380px;
    min-width: 280px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    line-height: 1.5;
}

.mapa-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.mapa-tooltip .tooltip-ccaa {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #2D7D2D;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.mapa-tooltip .tooltip-uni {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.mapa-tooltip .tooltip-uni:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.mapa-tooltip .uni-nombre {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    margin: 0 0 4px 0;
}

.mapa-tooltip .uni-titulaciones {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    color: #666666;
    margin: 0;
}

.mapa-tooltip .uni-titulaciones span {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
    margin-top: 4px;
}

.mapa-tooltip .tag-grado {
    background: #e8f5e9;
    color: #2D7D2D;
}

.mapa-tooltip .tag-master {
    background: #e3f2fd;
    color: #1565c0;
}

.mapa-tooltip .tag-extincion {
    background: #fff3e0;
    color: #e65100;
}

.mapa-tooltip .tag-investigacion {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Instrucción */
.mapa-instruccion {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #888;
    margin-top: 15px;
    line-height: 1.6;
}

/* ── Responsive ── */

/* Tablet */
@media (max-width: 980px) {
    .mapa-tooltip {
        max-width: 320px;
        min-width: 240px;
        padding: 16px 18px;
    }

    .mapa-tooltip .tooltip-ccaa {
        font-size: 15px;
    }

    .mapa-tooltip .uni-nombre {
        font-size: 13px;
    }

    .mapa-instruccion {
        font-size: 13px;
    }
}

/* Móvil */
@media (max-width: 767px) {
    .mapa-tooltip {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%) translateY(20px);
        top: auto !important;
        max-width: calc(100vw - 40px);
        min-width: 260px;
        pointer-events: auto;
        border-radius: 12px;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    }

    .mapa-tooltip.visible {
        transform: translateX(-50%) translateY(0);
    }

    .mapa-tooltip .tooltip-close {
        display: block;
    }

    .mapa-instruccion {
        font-size: 12px;
        margin-top: 10px;
    }
}

/* Botón cerrar (solo visible en móvil) */
.mapa-tooltip .tooltip-close {
    display: none;
    position: absolute;
    top: 10px;
    right: 12px;
    width: 24px;
    height: 24px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
    color: #666;
    cursor: pointer;
    pointer-events: auto;
}

.mapa-tooltip .tooltip-close:hover {
    background: #e0e0e0;
    color: #333;
}
