/* * FILE: css/mapa.css
 * Contiene los estilos que estaban incrustados en mapa.php
 * --- AÑADIDOS NUEVOS ESTILOS DE MARCADORES MODERNOS ---
 */

/* --- (INICIO) NUEVOS MARCADORES MODERNOS --- */

@keyframes pulse-marker {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.3);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

.modern-marker-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50% 50% 50% 0;
    /* Forma de gota/pin */
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transform: rotate(-45deg);
    /* Gira el pin para que apunte hacia abajo */
    animation: pulse-marker 2s infinite;
}

/* El contenido (emoji) se rota para que quede derecho */
.modern-marker-icon .icon-inner {
    transform: rotate(45deg);
    font-size: 20px;
    line-height: 1;
    display: block;
    margin-top: -2px;
    /* Ajuste fino del emoji */
}

/* Color para Avistamientos */
.modern-marker-icon.marker-avistamiento {
    background: var(--secondary-color);
    /* Usa variable de color secundario */
}

/* Color para Perdidos */
.modern-marker-icon.marker-perdido {
    background: var(--primary-color);
    /* Usa variable de color primario */
}

/* Puntos Comunitarios */
.modern-marker-icon.marker-poi-parque {
    border-color: #28a745;
}

.modern-marker-icon.marker-poi-petfriendly {
    border-color: #fd7e14;
}

.modern-marker-icon.marker-poi-peligro {
    border-color: #dc3545;
    animation: pulse-danger 1.5s infinite;
}

@keyframes pulse-danger {
    0% {
        transform: rotate(-45deg) scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }

    70% {
        transform: rotate(-45deg) scale(1.1);
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        transform: rotate(-45deg) scale(0.95);
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Marcador de ubicación del usuario (punto azul) */
@keyframes pulse-user-location {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.user-location-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #4285F4;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Círculo pulsante (animación) */
.user-location-marker::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background-color: #4285F4;
    animation: pulse-user-location 2s infinite ease-out;
    z-index: -1;
}

/* --- (FIN) NUEVOS MARCADORES MODERNOS --- */

/* --- FIX: Wrapper para Leaflet DivIcon --- */
.leaflet-marker-wrapper {
    background: transparent !important;
    border: none !important;
}


.map-filtrado-section {
    padding-top: calc(70px + 2rem);
    min-height: calc(100vh - 70px);
    background: var(--bg-light);
}

.search-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.search-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 0;
}

.search-header>* {
    position: relative;
    z-index: 1;
}

.search-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-header p {
    font-size: clamp(1rem, 2vw, 1.1rem);
    opacity: 0.95;
    margin: 0;
}

.controles-panel {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.busqueda-principal {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.busqueda-principal>div {
    flex: 1;
    min-width: 250px;
}

.busqueda-principal label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.busqueda-principal label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.btn-geolocalizar {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
    font-size: 1rem;
    white-space: nowrap;
}

.btn-geolocalizar:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(78, 205, 196, 0.4);
}

.btn-geolocalizar:active {
    transform: translateY(0);
}

.btn-geolocalizar:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.controles-avanzados {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f0;
}

.control-grupo {
    display: flex;
    flex-direction: column;
}

.control-grupo label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.control-grupo label i {
    color: var(--primary-color);
}

.radio-slider {
    width: 100%;
    margin-top: 5px;
    height: 6px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

.radio-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.radio-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.radio-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.radio-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.radio-value {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.filtros-tipo {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.checkbox-container:hover {
    transform: translateX(3px);
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-container span {
    font-size: 14px;
    font-weight: 500;
}

.mapa-container {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 600px;
}

#mapa-resultados {
    width: 100%;
    height: 100%;
    z-index: 1;
}

#map-instruction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
    text-align: center;
}

.overlay-content {
    max-width: 550px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.overlay-content i {
    font-size: 80px;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.overlay-content h2 {
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 700;
}

.overlay-content p {
    color: var(--text-light);
    font-size: 1.1em;
    line-height: 1.7;
    margin-bottom: 10px;
}

.resultados-info {
    background: var(--bg-white);
    padding: 1.2rem 1.5rem;
    margin-top: 20px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    text-align: center;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.resultados-info i {
    color: var(--secondary-color);
    margin-right: 0.5rem;
}

/* Tom Select personalizado */
.ts-wrapper {
    width: 100% !important;
}

.ts-control {
    padding: 12px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: var(--border-radius-sm) !important;
    font-size: 15px !important;
    transition: all 0.3s ease !important;
}

.ts-control:focus,
.ts-wrapper.focus .ts-control {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1) !important;
}

.ts-dropdown {
    border-radius: var(--border-radius-sm) !important;
    border: 2px solid var(--primary-color) !important;
    box-shadow: var(--shadow-md) !important;
    margin-top: 5px !important;
}

.option-item {
    cursor: pointer;
    transition: background 0.2s;
}

.option-item:hover {
    background: #f8f9fa !important;
}

/* Responsive */
@media (max-width: 768px) {
    .map-filtrado-section {
        padding-top: 0;
    }

    .search-header {
        padding: 2rem 1.5rem;
    }

    .controles-panel {
        padding: 1.5rem;
    }

    .busqueda-principal {
        flex-direction: column;
    }

    .btn-geolocalizar {
        justify-content: center;
    }

    .mapa-container {
        height: 450px;
    }

    .controles-avanzados {
        grid-template-columns: 1fr;
    }

    .overlay-content i {
        font-size: 60px;
    }

    .overlay-content h2 {
        font-size: 1.4em;
    }

    .overlay-content p {
        font-size: 0.95em;
    }
}

/* ===================================================
   HERO DARK — nuevo estilo en sintonía con index.php
   =================================================== */
.map-filtrado-section {
    padding-top: 0;
    min-height: calc(100vh - 70px);
    background: var(--bg-light);
}

.mapa-hero {
    position: relative;
    background: linear-gradient(135deg, #0f0c29 0%, #141e30 50%, #1a2a4a 100%);
    padding-top: 80px;
    /* navbar */
    padding-bottom: 0;
    overflow: hidden;
}

.mapa-hero::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(78, 205, 196, 0.1) 0%, transparent 70%);
    top: -80px;
    right: -80px;
    pointer-events: none;
}

.mapa-hero::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.08) 0%, transparent 70%);
    bottom: 60px;
    left: -50px;
    pointer-events: none;
}

.mapa-hero-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.mapa-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: clamp(2rem, 4vh, 3rem);
    padding-bottom: clamp(3rem, 6vh, 4.5rem);
    align-items: center;
}

@media (min-width: 900px) {
    .mapa-hero-inner {
        grid-template-columns: 1fr auto;
        gap: 3rem;
    }
}

/* Badge */
.mapa-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(78, 205, 196, 0.15);
    border: 1px solid rgba(78, 205, 196, 0.35);
    color: #6ee9e3;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 1.2rem;
    width: fit-content;
}

.mapa-hero-badge i {
    animation: paw-bounce 2s ease-in-out infinite;
}

/* Título */
.mapa-hero-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    color: white;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.mapa-hero-text h1 span {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mapa-hero-text p {
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
    max-width: 520px;
}

/* Links rápidos laterales */
.mapa-hero-links {
    display: flex;
    flex-direction: row;
    gap: 0.6rem;
    flex-wrap: wrap;
}

@media (min-width: 900px) {
    .mapa-hero-links {
        flex-direction: column;
        gap: 0.7rem;
    }
}

.mapa-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85) !important;
    padding: 0.6rem 1.1rem;
    border-radius: 50px;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.mapa-quick-link i {
    color: #4ecdc4;
    font-size: 0.85rem;
}

.mapa-quick-link:hover {
    background: rgba(78, 205, 196, 0.15);
    border-color: rgba(78, 205, 196, 0.4);
    color: white !important;
    transform: translateX(3px);
}

@media (max-width: 900px) {
    .mapa-quick-link:hover {
        transform: translateY(-2px);
    }
}

/* Ola */
.mapa-hero-wave {
    position: relative;
    z-index: 2;
    line-height: 0;
    margin-top: -1px;
}

.mapa-hero-wave svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Cuerpo del mapa */
.mapa-body {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

/* Header del panel de controles */
.controles-panel-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.controles-panel-header i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Chips de filtro modernos */
.filtro-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
    border-radius: 50px;
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    background: #f0f0f0;
    color: #636e72;
}

.filtro-chip input[type="checkbox"] {
    display: none;
}

.filtro-chip-red {
    background: rgba(255, 107, 107, 0.1);
    border-color: rgba(255, 107, 107, 0.25);
    color: #ee5a52;
}

.filtro-chip-red:hover {
    background: rgba(255, 107, 107, 0.18);
    border-color: rgba(255, 107, 107, 0.5);
}

.filtro-chip-blue {
    background: rgba(78, 205, 196, 0.1);
    border-color: rgba(78, 205, 196, 0.25);
    color: #44a08d;
}

.filtro-chip-blue:hover {
    background: rgba(78, 205, 196, 0.18);
    border-color: rgba(78, 205, 196, 0.5);
}

/* Estado con checkbox desactivado = chip atenuado */
.filtro-chip:has(input:not(:checked)) {
    opacity: 0.45;
    filter: grayscale(0.4);
}

/* Overlay renovado */
.overlay-icon-wrap {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.2rem;
    font-size: 2.2rem;
    color: var(--primary-color);
    animation: bounce 2s infinite;
}

.overlay-tip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 206, 84, 0.12);
    border: 1px solid rgba(255, 206, 84, 0.3);
    color: #856404;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem !important;
    margin-top: 1rem !important;
}

.overlay-tip i {
    color: #f9ca24;
}