/* =========================================
   ESTILOS GOBIERNO EN LA CALLE - FINAL + FIRMA V2
   ========================================= */

/* --- VARIABLES GLOBALES --- */
:root {
    --color-fondo-body: #021a0f;
    --color-tarjeta: rgba(0, 20, 10, 0.95);
    --color-verde-neon: #00ff55;
    --color-amarillo-neon: #FFD700;
    --color-morado-neon: #9d4edd;
    --color-texto-blanco: #FFFFFF;
    --color-borde-form: #1a4d2e;
}

/* --- CONFIGURACIÓN BASE --- */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-fondo-body);
    color: var(--color-texto-blanco);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: radial-gradient(circle at center, #0a3321 0%, #000000 100%);
}

/* --- ANIMACIONES --- */
@keyframes palpitate-logo {
    0% {
        transform: translateX(-50%) scale(1);
        border-color: var(--color-amarillo-neon);
        box-shadow: 0 0 20px var(--color-amarillo-neon), 0 0 40px var(--color-morado-neon);
    }

    50% {
        transform: translateX(-50%) scale(1.05);
        border-color: #fffacd;
        box-shadow: 0 0 40px var(--color-amarillo-neon), 0 0 60px var(--color-morado-neon);
    }

    100% {
        transform: translateX(-50%) scale(1);
        border-color: var(--color-amarillo-neon);
        box-shadow: 0 0 20px var(--color-amarillo-neon), 0 0 40px var(--color-morado-neon);
    }
}

@keyframes card-pulse {
    0% {
        box-shadow: 0 0 20px rgba(0, 255, 85, 0.2), 0 0 10px rgba(157, 78, 221, 0.1);
        border-color: var(--color-verde-neon);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.2), 0 0 20px rgba(157, 78, 221, 0.3);
        border-color: var(--color-amarillo-neon);
    }

    100% {
        box-shadow: 0 0 20px rgba(0, 255, 85, 0.2), 0 0 10px rgba(157, 78, 221, 0.1);
        border-color: var(--color-verde-neon);
    }
}

/* --- TARJETA PRINCIPAL --- */
.main-card {
    background-color: var(--color-tarjeta);
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    border: 1px solid var(--color-verde-neon);
    animation: card-pulse 4s infinite ease-in-out;
    position: relative;
    padding-bottom: 90px;
    margin-top: 110px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    margin-bottom: 50px;
}

/* --- LOGO FLOTANTE --- */
.floating-logo {
    position: absolute;
    top: -100px;
    left: 50%;
    width: 140px;
    height: 140px;
    background-color: #00331a;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-amarillo-neon);
    animation: palpitate-logo 3s infinite ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.floating-logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}

/* --- TIPOGRAFÍA --- */
.neon-title {
    color: var(--color-verde-neon);
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(0, 255, 85, 0.4);
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.section-title {
    color: var(--color-amarillo-neon);
    border-bottom: 1px solid var(--color-morado-neon);
    padding-bottom: 10px;
    margin-bottom: 25px;
    margin-top: 10px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.4);
}

/* --- FORMULARIOS Y SELECTS NEÓN --- */
.form-group {
    margin-bottom: 25px;
}

.form-label {
    color: var(--color-texto-blanco);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

.form-control,
select.form-control {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border: 1px solid var(--color-borde-form);
    color: #fff !important;
    border-radius: 12px;
    padding: 12px 15px;
}

select.form-control option {
    background-color: #000;
    color: #fff;
    padding: 10px;
}

.form-control:focus {
    background-color: rgba(0, 0, 0, 0.8) !important;
    outline: none;
    border-color: var(--color-amarillo-neon);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2), 0 0 5px var(--color-morado-neon);
}

/* --- BOTONES --- */
.btn-neon {
    background: transparent;
    border: 1px solid var(--color-verde-neon);
    color: var(--color-verde-neon);
    padding: 12px 20px;
    border-radius: 50px;
    transition: 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    display: block;
    width: 100%;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.btn-neon:hover {
    background: var(--color-verde-neon);
    color: #000;
    box-shadow: 0 0 25px var(--color-verde-neon);
}

/* --- BARRA INFERIOR --- */
.bottom-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(0, 0, 0, 0.8);
    border-top: 1px solid var(--color-morado-neon);
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.btn-icon {
    color: var(--color-texto-blanco);
    opacity: 0.7;
    font-size: 1.6rem;
    transition: 0.3s;
    text-decoration: none;
    position: relative;
}

.btn-icon:hover,
.btn-icon.active {
    color: var(--color-amarillo-neon);
    opacity: 1;
    transform: translateY(-5px);
    text-shadow: 0 0 10px var(--color-amarillo-neon);
}

.btn-icon.danger:hover {
    color: #ff4444;
    text-shadow: 0 0 10px #ff4444;
}

/* --- FIRMA DEL FOOTER (MODIFICADO: MÁS GRANDE) --- */
.footer-signature {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px dashed rgba(157, 78, 221, 0.3);
    margin-bottom: 20px;
}

.footer-signature img {
    max-width: 170px;
    /* CAMBIO: Aumentado de 100px a 170px */
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 5px var(--color-verde-neon));
}

.footer-signature p {
    color: var(--color-morado-neon);
    font-size: 0.85rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(157, 78, 221, 0.5);
    line-height: 1.4;
}

/* --- MAPA Y CONTENEDOR --- */
#map-container {
    width: 100%;
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-morado-neon);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.btn-fullscreen {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    color: var(--color-amarillo-neon);
    border: 1px solid var(--color-amarillo-neon);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    transition: 0.3s;
}

.btn-fullscreen:hover {
    background: var(--color-verde-neon);
    color: #000;
    transform: scale(1.1);
}

.fullscreen-mode {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    background: #021a0f;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
}

.fix-z-index {
    transform: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    animation: none !important;
    z-index: 1 !important;
}

.leaflet-popup-content-wrapper {
    background: #002b15 !important;
    color: #fff !important;
    border: 1px solid var(--color-amarillo-neon);
}

.leaflet-popup-tip {
    background: #002b15 !important;
}

.leaflet-popup-close-button {
    color: var(--color-verde-neon) !important;
}

/* --- MARCADORES NEÓN (CORREGIDO Y DEFINITIVO) --- */

/* 1. El Contenedor Invisible (L.divIcon) */
/* Este es el div que Leaflet pone en el mapa. Le damos estructura. */
.neon-marker-wrapper {
    background: transparent !important;
    border: none !important;

    /* ¡IMPORTANTE! Forzamos flex para centrar la imagen dentro */
    display: flex !important;
    justify-content: center;
    align-items: flex-end;
    /* Alineado abajo para que salte desde el suelo */

    /* Permitimos que la animación salga del cuadro si es necesario */
    overflow: visible !important;
}

/* 2. La Imagen Interna (Tu logo.png) */
.neon-marker-img {
    /* Forzamos a que ocupe el espacio del contenedor */
    width: 40px !important;
    height: 40px !important;
    display: block !important;
    object-fit: contain;

    /* DOBLE BRILLO NEÓN (Verde + Dorado) */
    filter: drop-shadow(0 0 4px var(--color-verde-neon)) drop-shadow(0 0 8px var(--color-amarillo-neon));

    /* Animación de salto */
    animation: neon-bounce 1.5s infinite ease-in-out;

    /* El punto de pivote es abajo al centro */
    transform-origin: bottom center;
}

/* 3. La Animación del Salto */
@keyframes neon-bounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        /* Salta 12px arriba y crece un 10% */
        transform: translateY(-12px) scale(1.1);
    }
}

/* ... (MANTÉN TODO LO ANTERIOR) ... */

/* --- FILTROS DE MAPA --- */
.map-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--color-verde-neon);
    color: #fff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-verde-neon);
    color: #000;
    box-shadow: 0 0 10px var(--color-verde-neon);
    font-weight: bold;
}

/* --- ESTADOS DE TARJETAS (POPUP) --- */
/* Estado: POR VISITAR (Dorado) */
.status-card-future {
    border: 1px solid var(--color-amarillo-neon) !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.status-badge-future {
    background: var(--color-amarillo-neon);
    color: #000;
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Estado: VISITADO (Morado Tenue) */
.status-card-past {
    border: 1px solid var(--color-morado-neon) !important;
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.2);
}

.status-badge-past {
    background: var(--color-morado-neon);
    color: #fff;
    font-weight: bold;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* --- STICKMAN (GEOLOCALIZACIÓN) --- */
.stickman-icon {
    font-size: 30px;
    color: var(--color-morado-neon);
    text-shadow: 0 0 10px var(--color-morado-neon), 0 0 20px #fff;
    animation: stickman-wave 2s infinite;
}

@keyframes stickman-wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

/* --- TARJETAS EXPANDIBLES --- */
.text-truncate-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-expandable {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.card-expandable:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 85, 0.15) !important;
}

.card-expandable.expanded {
    z-index: 100;
    transform: scale(1.02);
    border-color: white !important;
    background: rgba(0, 30, 15, 0.95) !important;
}

.card-expandable.expanded .text-truncate-title {
    white-space: normal;
    overflow: visible;
}

.card-expandable.expanded .text-clamp-2 {
    -webkit-line-clamp: unset;
    display: block;
}

.evidence-gallery {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-top: 15px;
    border-top: 1px dashed #555;
    padding-top: 10px;
}

.card-expandable.expanded .evidence-gallery {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- CORRECCIÓN DE DESBORDAMIENTO (TRUNCATE) --- */

/* 1. Para Títulos Generales (h5, h6) */
.text-truncate-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

/* 2. Para Badges/Etiquetas (La corrección de tu imagen) */
.badge-truncate {
    display: inline-block;
    max-width: 220px;
    /* Límite de ancho para que no rompa la tarjeta */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* En móviles, el espacio es menor */
@media (max-width: 768px) {
    .badge-truncate {
        max-width: 140px;
    }
}

/* 3. Descripción (máximo 2 líneas) */
.text-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- TARJETA EXPANDIBLE (ANIMACIÓN) --- */
.card-expandable {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    /* IMPORTANTE: Esto recorta cualquier cosa que se salga */
}

.card-expandable:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 255, 85, 0.15) !important;
}

/* ESTADO EXPANDIDO (CLIC) */
.card-expandable.expanded {
    z-index: 100;
    transform: scale(1.02);
    border-color: white !important;
    background: rgba(0, 30, 15, 0.98) !important;
    max-height: none;
    /* Dejar crecer */
}

/* Al expandir, quitamos los límites de texto */
.card-expandable.expanded .text-truncate-title,
.card-expandable.expanded .badge-truncate {
    white-space: normal;
    overflow: visible;
    max-width: 100%;
    /* Permitir que ocupe todo el ancho necesario */
}

.card-expandable.expanded .text-clamp-2 {
    -webkit-line-clamp: unset;
    display: block;
}

/* Galería oculta */
.evidence-gallery {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    margin-top: 15px;
    border-top: 1px dashed #555;
    padding-top: 10px;
}

.card-expandable.expanded .evidence-gallery {
    display: block;
    opacity: 1;
    animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}