/* --- Marcadores tipo pin SVG --- */
.custom-marker {
    width: 32px;
    height: 32px;
    background: none;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;

}

.custom-marker svg {
    width: 32px;
    height: 32px;
    display: block;
}

.custom-marker.pendiente svg .pin {
    fill: #ffc107 !important;
    stroke: #b38f00 !important;
}
.custom-marker.en_progreso svg .pin {
    fill: #007bff !important;
    stroke: #003e80 !important;
}
.custom-marker.completado svg .pin {
    fill: #28a745 !important;
    stroke: #155724 !important;
}
.custom-marker.rechazado svg .pin {
    fill: #dc3545 !important;
    stroke: #721c24 !important;
}

.custom-marker .circle {
    fill: #fff !important;
    stroke: #ccc !important;
    stroke-width: 1.5;
}

.custom-marker:hover,
.custom-marker.hover-highlight {
    transform: scale(1.2);
    z-index: 100 !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
/* --- Popup de Mapbox --- */
.mapboxgl-popup-content {
    padding: 0 !important; /* Quitamos el padding base para aplicar nuestro propio diseño */
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-width: 280px !important;
}

/* --- Lista de reportes --- */
.report-item {
    cursor: pointer;
}

.report-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.report-item a:hover {
    text-decoration: none;
}

/* --- Filtros --- */
.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* --- Estilos para la evidencia --- */
.report-evidence {
    margin-top: 8px;
}

.view-evidence {
    font-size: 0.85rem;
}

.view-evidence i {
    margin-right: 4px;
}

#modal-evidence-img {
    transition: all 0.3s ease;
}

/* --- Mapa en pantalla completa --- */
.map-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.map-fullscreen .mapbox-container {
    height: 100vh !important;
}

.map-fullscreen .card-header {
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: rgba(255,255,255,0.9);
}

/* --- Clases para animaciones --- */
.appear {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* --- Media queries --- */
@media (max-width: 768px) {
    .filters-form {
        grid-template-columns: 1fr;
    }
    .modal-dialog {
        margin: 0.5rem;
    }
}
div.custom-marker.pendiente svg .pin { fill: #ffc107 !important; stroke: #b38f00 !important; }
div.custom-marker.en_progreso svg .pin { fill: #007bff !important; stroke: #003e80 !important; }
div.custom-marker.completado svg .pin { fill: #28a745 !important; stroke: #155724 !important; }
div.custom-marker.rechazado svg .pin { fill: #dc3545 !important; stroke: #721c24 !important; }
div.custom-marker .circle { fill: #fff !important; stroke: #ccc !important; stroke-width: 1.5; }

/* Estilos para popups de reportes */
.mapboxgl-popup.reporte-popup {
    z-index: 5;
}

.mapboxgl-popup.reporte-popup .mapboxgl-popup-content {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.mapboxgl-popup.reporte-popup .mapboxgl-popup-close-button {
    font-size: 18px;
    color: #666;
    right: 8px;
    top: 8px;
}

.mapboxgl-popup.reporte-popup .mapboxgl-popup-close-button:hover {
    background-color: transparent;
    color: #333;
}


/* --- Estilos para popups de reportes --- */
.mapboxgl-popup {
    z-index: 1000 !important; /* Z-index alto para asegurar que aparezca sobre los marcadores */
}

.mapboxgl-popup-content {
    padding: 0 !important; /* Quitamos el padding base para aplicar nuestro propio diseño */
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    max-width: 280px !important;
}

.mapboxgl-popup-close-button {
    font-size: 20px !important;
    color: #fff !important;
    right: 8px !important;
    top: 8px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 50% !important;
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    line-height: 1 !important;
    z-index: 5 !important;
}

.mapboxgl-popup-close-button:hover {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #fff !important;
}

/* Estilos mejorados para el contenido del popup */
.reporte-popup-container {
    display: flex;
    flex-direction: column;
}

.popup-header {
    padding: 12px 15px;
    color: #fff;
    font-weight: 600;
    position: relative;
}

.popup-header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-title-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.popup-icon {
    font-size: 16px;
    margin-top: 3px;
    flex-shrink: 0;
}

.popup-title {
    font-size: 16px;
    margin: 0;
    padding: 0;
    line-height: 1.3;
    word-break: break-word;
    flex-grow: 1;
}

.popup-header.pendiente { background: linear-gradient(135deg, #ffc107, #ff9800); }
.popup-header.en_progreso { background: linear-gradient(135deg, #007bff, #0056b3); }
.popup-header.completado { background: linear-gradient(135deg, #28a745, #198754); }

.estado-badge {
    display: flex;
    align-items: center;
    align-self: flex-start;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    gap: 4px;
}

.estado-badge i {
    font-size: 10px;
}

.popup-content {
    padding: 15px;
    background: #fff;
}

.popup-meta {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px 8px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
}

.popup-meta i {
    color: #777;
    font-size: 14px;
    text-align: center;
}

.popup-footer {
    background: #f8f9fa;
    padding: 12px 15px;
    border-top: 1px solid #eee;
}

.btn-ver-detalles {
    display: block;
    width: 100%;
    padding: 8px 12px;
    text-align: center;
    background: linear-gradient(135deg, #6c5ce7, #4834d4);
    color: #fff;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-ver-detalles:hover {
    background: linear-gradient(135deg, #4834d4, #6c5ce7);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mapboxgl-popup.reporte-popup {
    z-index: 1000 !important;
}

.mapboxgl-popup-content {
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18) !important;
    max-width: 280px !important;
}



.custom-marker.active-report {
    transform: scale(1.3);
    z-index: 200 !important;
    box-shadow: 0 0 16px rgba(0,0,0,0.5);
}

/* Mejora visual para marcadores al hacer clic o activarlos */
.custom-marker.active {
    transform: scale(1.5);
    z-index: 250 !important;
    transition: transform 0.3s ease, z-index 0s;
}

/* Añade un efecto de pulso cuando se activa un marcador */
@keyframes markerPulse {
    0% { transform: scale(1.4); box-shadow: 0 0 0 rgba(0,0,0,0.5); }
    70% { transform: scale(1.5); box-shadow: 0 0 10px rgba(0,0,0,0.3); }
    100% { transform: scale(1.4); box-shadow: 0 0 0 rgba(0,0,0,0.5); }
}

.custom-marker.active {
    animation: markerPulse 1.5s infinite;
}
