/**
 * Estilos públicos del Mapa Interactivo Uruguay
 */

/* Contenedor principal */
.miu-mapa-wrapper {
    font-family: 'Open Sans', Arial, sans-serif;
    margin: 30px auto;
    position: relative;
}

.miu-mapa-container {
    position: relative;
    background: #f0f6f9;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: 650px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG Container */
.miu-svg-container {
    width: 100%;
    height: 100%;
    padding: 25px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.miu-svg-container svg {
    width: auto;
    height: 100%;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

/* Estilos del mapa de Uruguay */
.miu-svg-container svg path {
    fill: #2ea3f2;
    stroke: #ffffff;
    stroke-width: 1;
    transition: all 0.3s ease;
}

.miu-svg-container svg path:hover {
    fill: #374EA2;
    stroke: #ffffff;
    stroke-width: 2;
    cursor: pointer;
}

/* Opcional: Diferentes colores por departamento */
.miu-svg-container svg path[id*="UY-"] {
    fill: #2ea3f2;
}

.miu-svg-container svg path[id*="UY-"]:nth-child(odd) {
    fill: #2ea3f2;
}

.miu-svg-container svg path[id*="UY-"]:hover {
    fill: #374EA2;
}

/* Marcadores */
.miu-marcadores {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.miu-marcador {
    position: absolute;
    cursor: pointer;
    pointer-events: all;
    z-index: 100;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* El transform: translate(-50%, -50%) está en el HTML inline */
}

.miu-marcador:hover {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 20;
}

/* Pin del marcador */
.miu-pin {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #1CABE2;
    box-shadow: 0 4px 12px rgba(28, 171, 226, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    border: 3px solid white;
}

.miu-pin .dashicons {
    color: white;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Efecto de pulso */
.miu-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #1CABE2;
    opacity: 0;
    animation: miu-pulse-animation 2s infinite;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
}

@keyframes miu-pulse-animation {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Tarjeta de información (Modal) */
.miu-info-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.miu-info-card.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: miu-fade-in 0.3s ease;
}

.miu-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.miu-info-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: miu-slide-up 0.3s ease;
}

@keyframes miu-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes miu-slide-up {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Botón de cerrar */
.miu-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.miu-close-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

/* Contenido de la tarjeta */
.miu-info-titulo {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 700;
    color: #333;
    padding-right: 30px;
}

.miu-info-descripcion {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
    font-size: 15px;
}

.miu-info-descripcion p:last-child {
    margin-bottom: 0;
}

/* Botón de acción */
.miu-info-boton-container {
    margin-top: 20px;
}

.miu-info-boton {
    display: inline-block;
    padding: 12px 24px;
    background: #2ea3f2;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Open Sans', Arial, sans-serif;
    transition: all 0.2s ease;
    border: 2px solid #2ea3f2;
}

.miu-info-boton:hover {
    background: #1a8dd9;
    border-color: #1a8dd9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 163, 242, 0.4);
}

/* Estilos de botón secundario */
.miu-info-boton.secondary {
    background: #374EA2;
    border-color: #374EA2;
}

.miu-info-boton.secondary:hover {
    background: #2a3d7f;
    border-color: #2a3d7f;
    box-shadow: 0 4px 12px rgba(55, 78, 162, 0.4);
}

/* Estilo de botón outline */
.miu-info-boton.outline {
    background: transparent;
    color: #2ea3f2;
    border-color: #2ea3f2;
}

.miu-info-boton.outline:hover {
    background: #2ea3f2;
    color: white;
}

/* Leyenda */
.miu-leyenda {
    display: none; /* Ocultar leyenda */
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.miu-leyenda h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.miu-leyenda ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.miu-leyenda li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 4px;
    padding: 8px 10px;
}

.miu-leyenda li:hover {
    background: #f5f5f5;
}

.miu-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.miu-legend-title {
    font-size: 14px;
    color: #555;
}

/* Mensaje de sin marcadores */
.miu-no-markers {
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    color: #999;
    font-style: italic;
}

/* Controles de zoom */
.miu-zoom-controls {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    flex-direction: column;
    gap: 8px;
    pointer-events: auto;
    transform: scale(1) !important;
    transform-origin: top right !important;
}

.miu-zoom-btn {
    width: 44px;
    height: 44px;
    background: white;
    border: 2px solid #4A90A4;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.miu-zoom-btn:hover {
    background: #4A90A4;
    transform: scale(1.05);
}

.miu-zoom-btn:hover .dashicons {
    color: white;
}

.miu-zoom-btn:active {
    transform: scale(0.95);
}

.miu-zoom-btn .dashicons {
    color: #4A90A4;
    font-size: 20px;
    width: 20px;
    height: 20px;
    transition: color 0.2s ease;
}

/* Responsive - Tablets */
@media (max-width: 1024px) {
    .miu-mapa-container {
        min-height: 500px;
    }

    .miu-leyenda {
        margin-top: 15px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .miu-mapa-container {
        height: 600px;
        overflow: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .miu-svg-container {
        padding: 60px 15px 15px 15px;
        height: auto;
        min-height: 100%;
    }

    .miu-svg-container svg {
        width: 100%;
        height: auto;
        min-height: 500px;
    }

    /* Mostrar controles de zoom en mobile */
    .miu-zoom-controls {
        display: flex;
    }

    /* Marcadores más grandes para touch */
    .miu-pin {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }

    .miu-pin .dashicons {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

    .miu-pulse {
        width: 40px;
        height: 40px;
    }

    /* Modal adaptado a móvil */
    .miu-info-content {
        padding: 20px;
        max-width: 95%;
        max-height: 85vh;
        border-radius: 12px;
        margin: 0 10px;
    }

    .miu-info-titulo {
        font-size: 20px;
        padding-right: 35px;
    }

    .miu-info-descripcion {
        font-size: 14px;
        line-height: 1.5;
    }

    .miu-close-btn {
        width: 36px;
        height: 36px;
        font-size: 28px;
        top: 10px;
        right: 10px;
    }

    .miu-info-boton {
        padding: 14px 24px;
        font-size: 16px;
        width: 100%;
        text-align: center;
    }

    /* Leyenda adaptada */
    .miu-leyenda {
        padding: 15px;
        margin-top: 15px;
    }

    .miu-leyenda h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .miu-leyenda li {
        padding: 10px;
        font-size: 14px;
    }

    .miu-legend-color {
        width: 18px;
        height: 18px;
        margin-right: 12px;
    }

}

/* Responsive - Mobile Small */
@media (max-width: 480px) {
    .miu-info-content {
        padding: 15px;
        max-height: 90vh;
        border-radius: 8px;
    }

    .miu-info-titulo {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .miu-info-descripcion {
        font-size: 13px;
    }

    .miu-info-boton {
        padding: 12px 20px;
        font-size: 15px;
    }

    .miu-leyenda {
        padding: 12px;
    }

    .miu-leyenda h4 {
        font-size: 15px;
    }

    .miu-leyenda li {
        padding: 8px;
        font-size: 13px;
    }

    /* Marcadores ajustados */
    .miu-pin {
        width: 36px;
        height: 36px;
    }

    .miu-pin .dashicons {
        font-size: 20px;
        width: 20px;
        height: 20px;
    }

    .miu-pulse {
        width: 36px;
        height: 36px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Mejorar área de touch */
    .miu-marcador {
        padding: 10px;
        margin: -10px;
    }

    .miu-pin {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    }

    .miu-leyenda li {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Remover hover en touch devices */
    .miu-marcador:hover {
        transform: translate(-50%, -50%) scale(1);
    }

    /* Tap feedback visual */
    .miu-marcador:active .miu-pin {
        transform: scale(0.95);
    }

    .miu-leyenda li:active {
        background: #e8e8e8;
    }
}
