/* =========================================================
   1. RESET Y VARIABLES GLOBALES
========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

:root {
    --azul: #073b4c;
    --azul-dark: #052d3a;
    --azul-light: #118ab2;
    
    --rojo: #ff0000;
    --naranja: #f97316;
    --amarillo: #FFC700;
    --verde: #15803d;
    --verde-claro: #02cf5e;
    --celeste-agua: #008fa7;
    --azul-agua: #1e40af;
    --gris: #475569;
    
    --fondo-header: #081B2B;
    --fondo-hero: #061523;
    --fondo: #000000;
    --blanco: #ffffff;
    --texto: #f8fafc;
    --texto-suave: #94a3b8;
    --borde: #334155;

    --alto-header: 105px; 
}

html {
    scroll-behavior: smooth;
    background-color: #000000;
}

body {
    background: var(--fondo);
    color: var(--texto);
    min-height: 100vh;
    overflow-x: hidden;
}

section[id],
header[id] {
    scroll-margin-top: var(--alto-header);
}

/* =========================================================
   2. HEADER Y NAVEGACIÓN
========================================================= */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #1e293b;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.45);
}

/* =========================================================
   3. HERO BANNER
========================================================= */
.hero-banner {
    position: relative;
    width: 100%;
    min-height: 450px;
    padding-top: var(--alto-header);
    background: #000000 url('bannenPuntos.png') center 35% / cover repeat;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-bg-pattern {
    display: none;
}

.hero-overlay {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 10px;
}

.hero-wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    width: 100%;
    min-height: 200px;
}

.hero-right-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    margin-left: auto;
}

.reports-counter-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(8px);
    border: 2px solid #FFC700;
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: 0 0 25px rgba(255, 199, 0, 0.2), 0 10px 30px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.reports-counter-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 35px rgba(255, 199, 0, 0.35), 0 15px 35px rgba(0, 0, 0, 1);
}

.counter-icon {
    color: #FFC700;
    font-size: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(255, 199, 0, 0.8));
    animation: alertPulse 1.8s infinite ease-in-out;
}

@keyframes alertPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(255, 199, 0, 0.8));
    }
    50% {
        opacity: 0.85;
        filter: drop-shadow(0 0 18px rgba(255, 199, 0, 1));
    }
}

.counter-info {
    display: flex;
    flex-direction: column;
}

.counter-number {
    font-size: 2.2rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.5px;
}

.counter-label {
    font-size: 0.85rem;
    color: #FFC700;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 6px;
}

/* =========================================================
   4. CÓMO FUNCIONA
========================================================= */
.como-top-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 10px;
    gap: 20px;
    background-color: #000000;
}

.como-funciona {
    background-color: #000000;
    color: #ffffff;
    padding: 15px 5% 5px;
}

.hero-title {
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 6px;
}

.hero-tagline {
    color: whitesmoke;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.hero-text-content {
    max-width: 550px;
}

.hero-right-slogan {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 320px;
    transform: rotate(-2.5deg);
}

.handwritten-text {
    font-family: 'Caveat', 'Segoe Print', cursive, sans-serif;
    font-size: 1.35rem;
    color: #ffffff;
    line-height: 1.2;
}

.slogan-underline {
    height: 3px;
    background-color: #FFC700;
    width: 90%;
    margin-top: 4px;
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(255, 199, 0, 0.5);
}

/* =========================================================
   5. BOTÓN REPORTAR
========================================================= */
.cta-principal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 35px auto 25px;
    text-align: center;
}

.btn-reportar-hero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #ffc700;
    color: #000000;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 199, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-reportar-hero:hover {
    background-color: #e6b300;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 199, 0, 0.45);
}

/* =========================================================
   6. SECCIÓN DEL MAPA Y FILTROS CIRCULARES
========================================================= */
.map-section {
    width: 100%;
    background-color: #000000;
    padding-top: 20px;
    padding-bottom: 0;
}

.map-content-container {
    width: 92%;
    max-width: 1450px;
    margin: 0 auto;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.map-header-top {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex-shrink: 0;
}

.map-label {
    display: block;
    color: #ffc700;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.map-header h2 {
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.map-filtros-circulos-container {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
}

.map-filtros-circulos {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: start;
    justify-items: center;
    gap: 8px;
    flex: 1;
    max-width: 850px;
    margin-left: auto;
}

.btn-circulo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.btn-circulo .icon-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    margin-bottom: 6px;
    color: #ffffff !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-circulo[data-categoria="bache"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ff2a4b; }
.btn-circulo[data-categoria="corte"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ff8c38; }
.btn-circulo[data-categoria="luminaria"] .icon-circle {box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ffdc00;}
.btn-circulo[data-categoria="basura"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #22c55e; }
.btn-circulo[data-categoria="corte_agua"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #38bdf8; }
.btn-circulo[data-categoria="perdida_cloaca"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #2563eb; }
.btn-circulo[data-categoria="otro"] .icon-circle,
.btn-circulo[data-categoria="todas"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #94a3b8; }

.btn-circulo span {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2 !important;
    text-align: center;
    white-space: nowrap;
    color: #94a3b8 !important;
    text-transform: uppercase;
    margin-top: 6px;
}

.btn-circulo.active .icon-circle { transform: scale(1.12); }
.btn-circulo.active[data-categoria="bache"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ff2a4b, 0 0 12px #ff2a4b; }
.btn-circulo.active[data-categoria="corte"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ff8c38, 0 0 12px #ff8c38; }
.btn-circulo.active[data-categoria="luminaria"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ffdc00, 0 0 12px #ffdc00; }
.btn-circulo.active[data-categoria="basura"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #22c55e, 0 0 12px #22c55e; }
.btn-circulo.active[data-categoria="corte_agua"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #38bdf8, 0 0 12px #38bdf8; }
.btn-circulo.active[data-categoria="perdida_cloaca"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #2563eb, 0 0 12px #2563eb; }
.btn-circulo.active[data-categoria="otro"] .icon-circle,
.btn-circulo.active[data-categoria="todas"] .icon-circle { box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ffffff, 0 0 12px #ffffff; }

.btn-circulo.active span {
    color: #ffffff !important;
    font-weight: 700;
}

.map-wrapper {
    width: 100%;
    background: #111827;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #1e293b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    margin-bottom: 40px;
}

#map {
    width: 100%;
    height: 350px;
    border-radius: 12px;
}

/* =========================================================
   7. PIN PUNTOS DEL MAPA
========================================================= */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.pin-drop {
    width: 38px;
    height: 38px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    border: 2px solid #ffffff;
    transition: transform 0.2s ease;
}

.pin-drop:hover {
    transform: rotate(-45deg) scale(1.15);
    z-index: 1000;
}

.pin-drop i {
    transform: rotate(45deg);
    color: #ffffff !important;
    font-size: 16px;
}

.pin-bache          { background-color: var(--rojo); }
.pin-corte          { background-color: var(--naranja); }
.pin-luminaria      { background-color: #eab308; }
.pin-luminaria i    { color: #1e293b !important; }
.pin-basura         { background-color: var(--verde); }
.pin-corte_agua     { background-color: var(--celeste-agua); }
.pin-perdida_cloaca { background-color: var(--azul-agua); }
.pin-otro           { background-color: var(--gris); }

/* =========================================================
   8. MODAL Y VISOR
========================================================= */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 15px;
}

.modal-card {
    background: #313131;
    color: #ffffff;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    border: 1px solid #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #334155;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #ffffff;
    text-transform: uppercase;
}

.modal-header span {
    font-size: 0.9rem;
    font-weight: 800;
    color: whitesmoke;
    text-transform: uppercase;
}

#mapa-modal {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    margin-top: 6px;
    border: 1px solid #334155;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid #334155;
}

.btn-secondary {
    border: none;
    background: #334155;
    color: #ffffff;
    padding: 11px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-primary-modal {
    border: none;
    background: var(--amarillo);
    color: #000000;
    padding: 11px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #ffffff;
    background: #1b1b1b;
    color: #ffffff;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    outline: none;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .direccion { flex: 2; }
.form-row .numero { flex: 1; }

.guia-rapida-modal {
    background-color: #1b1b1b;
    border: 1px solid #ffffff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.paso-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.paso-numero {
    background-color: #FFC700;
    color: #000000;
    font-weight: 800;
    font-size: 13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.paso-texto {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    line-height: 1.2;
}

.paso-texto strong {
    color: #ffffff;
    font-size: 12px;
    margin-bottom: 2px;
}

.paso-texto span {
    color: #94a3b8;
}

.lightbox-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.lightbox-backdrop img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 25px;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
}

/* Botón de solucionar en el popup */
.btn-resolver-popup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #ffc700;
    color: #000000 !important;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-resolver-popup:hover {
    background-color: #e6b300;
    transform: translateY(-1px);
}

.btn-resolver-popup:active {
    transform: translateY(0);
}

/* =========================================================
   9. RESPONSIVE
========================================================= */

@media (max-width: 850px) {

        .hero-banner {
        /* Asigna la nueva imagen vertical */
        background-image: url('bannenPuntos.png') !important;
        background-position: left top !important;
        background-size: cover !important;
        
        /* Proporción ideal para adaptar la imagen vertical */
        min-height: 450px !important;
        padding-top: calc(var(--alto-header) - 5px) !important;
        padding-bottom: 20px !important;

        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important; /* Mueve la tarjeta abajo para no tapar el texto */
        align-items: center !important;
    }


    .como-top-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-text-content {
        max-width: 100%;
    }
}

@media (max-width: 600px) {

    .hero-banner {
        background-image: url('bannenPuntoscel.png') !important;
        background-size: 100% auto !important;
        background-position: center -70px !important;
        background-repeat: no-repeat !important;
        min-height: 0 !important;
        height: auto !important;
        padding-top: calc(var(--alto-header) - 5px) !important;
        padding-bottom: 5px !important;
        position: relative !important;
        display: block !important;
    }

    .reports-counter-card {
        position: absolute !important;
        top: -20px !important;
        right: 12px !important;
        width: 155px !important;
        padding: 6px 10px !important;
        background: rgba(11, 15, 25, 0.85) !important;
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
        border: 1px solid #ffc700 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
        margin: 0 !important;
        z-index: 10 !important;
    }

    .reports-counter-card .number {
        font-size: 1.1rem !important;
        line-height: 1 !important;
    }

    .reports-counter-card .label {
        font-size: 0.6rem !important;
    }

    .map-section {
        padding-top: 10px;
    }

    .map-header {
        margin-bottom: 10px;
    }

    .map-filtros-circulos-container {
        width: 100%;
        padding-bottom: 5px;
        margin-bottom: 15px;
        overflow-x: visible !important; 
    }

    /* Forzamos las 2 filas de 4 columnas de forma clara */
    .map-filtros-circulos {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        grid-template-rows: repeat(2, auto) !important;
        gap: 12px 4px !important;
        margin-left: 0 !important;
        padding: 0 4px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .btn-circulo {
        width: 100% !important;
        max-width: none !important;
    }
}