/* 
 * Mapa Interactivo - Estilos Frontend
 * Tipografía: Quicksand
 * Color principal: #3DAE2B
 */

.mapa-interactivo-container {
    font-family: 'Quicksand', sans-serif;
    margin: 20px 0;
    position: relative;
}

/* Contenedor de búsqueda */
.mapa-interactivo-busqueda {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: stretch;
}

/* Input de búsqueda */
.mapa-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e5e5e5 !important;
    border-radius: 8px;
    font-family: 'Quicksand', sans-serif;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333;
    outline: none;
}

.mapa-input:focus {
    border-color: #3DAE2B;
    box-shadow: 0 0 0 3px rgba(61, 174, 43, 0.1);
}

.mapa-input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Botón de búsqueda */
.mapa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #3DAE2B;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Quicksand', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
}

.mapa-btn:hover {
    background: #339924;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 174, 43, 0.3);
}

.mapa-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(61, 174, 43, 0.3);
}

.mapa-btn svg {
    flex-shrink: 0;
}

/* Contenedor del mapa */
#mapa-interactivo,
.mapa-interactivo-map {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
}

/* Personalización de controles de Leaflet */
.leaflet-control-zoom a {
    background: #ffffff !important;
    color: #333 !important;
    border: 2px solid #e5e5e5 !important;
    font-family: 'Quicksand', sans-serif !important;
    font-weight: 600 !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
    background: #3DAE2B !important;
    color: #ffffff !important;
    border-color: #3DAE2B !important;
}

.leaflet-control-attribution {
    font-family: 'Quicksand', sans-serif !important;
    font-size: 11px !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

/* Popups personalizados */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    font-family: 'Quicksand', sans-serif !important;
    padding: 20px !important;
    min-width: 200px !important;
}

.mapa-popup-titulo {
    font-size: 24px;
    font-weight: 700;
    color: #3DAE2B;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.mapa-popup-descripcion {
    font-size: 14px;
    font-weight: 400;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.mapa-popup-meta {
    margin-top: 12px;
    font-size: 14px;
    color: #333333;
    font-weight: 500;
}

.mapa-popup-meta .mapa-popup-extra {
    margin-bottom: 4px;
    font-weight: 400;
}

.leaflet-popup-tip {
    background: #ffffff !important;
}

.leaflet-popup-close-button {
    display: none !important;
}

/* Marcadores personalizados */
.leaflet-marker-icon.mapa-marker-image {
    transition: transform 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.leaflet-marker-icon.mapa-marker-image:hover {
    transform: translate3d(0, -2px, 0) scale(1.03);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
}

.leaflet-interactive.mapa-usuario-marker {
    filter: drop-shadow(0 0 8px rgba(33, 150, 243, 0.6));
}

/* Estados de carga */
.mapa-cargando {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-family: 'Quicksand', sans-serif;
    font-weight: 600;
    color: #3DAE2B;
    font-size: 15px;
}

/* Mensaje de error */
.mapa-error {
    padding: 12px 16px;
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffeaa7;
    border-radius: 8px;
    margin-top: 10px;
    font-family: 'Quicksand', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .mapa-interactivo-busqueda {
        flex-direction: column;
    }
    
    .mapa-btn {
        justify-content: center;
        width: 100%;
    }
    
    .mapa-input {
        width: 100%;
    }
    
    #mapa-interactivo,
    .mapa-interactivo-map {
        height: 400px !important;
    }
}

@media (max-width: 480px) {
    .mapa-input,
    .mapa-btn {
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .mapa-popup-titulo {
        font-size: 18px;
    }
    
    .mapa-popup-descripcion {
        font-size: 13px;
    }
}

/* Widget específico */
.widget .mapa-interactivo-container {
    margin: 0;
}

.widget .mapa-interactivo-busqueda {
    margin-bottom: 12px;
}

/* Animación de entrada para los marcadores */
@keyframes markerBounce {
    0%, 100% {
        transform: translateY(0) rotate(-45deg);
    }
    50% {
        transform: translateY(-10px) rotate(-45deg);
    }
}

.mapa-marker.animado {
    animation: markerBounce 0.6s ease;
}

/* Cluster de marcadores (si se implementa en el futuro) */
.marker-cluster {
    background: rgba(61, 174, 43, 0.6);
    border: 3px solid #3DAE2B;
    border-radius: 50%;
    color: #ffffff;
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    text-align: center;
    line-height: 35px;
}

.marker-cluster:hover {
    background: rgba(61, 174, 43, 0.8);
}

/* Accesibilidad */
.mapa-btn:focus-visible,
.mapa-input:focus-visible {
    outline: 3px solid #3DAE2B;
    outline-offset: 2px;
}

/* Modo oscuro (opcional, por si el tema lo usa) */
@media (prefers-color-scheme: dark) {
    .mapa-input {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #444;
    }
    
    .mapa-input::placeholder {
        color: #888;
    }
    
    #mapa-interactivo,
    .mapa-interactivo-map {
        border-color: #444;
    }
}
