Firefly
The Lampyridae are a family of elateroid beetles with more than 2,000 described species, many of which are light-emitting. They are soft-bodied beetles commonly called fireflies, lightning bugs, or glowworms for their conspicuous production of light, mainly during twilight, to attract mates. Light production in the Lampyridae is thought to have originated as an honest warning signal that the larvae were distasteful; this was co-opted in evolution as a mating signal in the adults. In a further development, female fireflies of the genus Photuris mimic the flash pattern of Photinus species to trap their males as prey. 
Fireflies are found in temperate and tropical climates. Many live in marshes or in wet, wooded areas where their larvae have abundant sources of food. While all known fireflies glow as larvae, only some species produce light in their adult stage, and the location of the light organ varies among species and between sexes of the same species. Fireflies have attracted human attention since classical antiquity; their presence has been taken to signify a wide variety of conditions in different cultures and is especially appreciated aesthetically in Japan, where parks are set aside for this specific purpose.

Biology
Fireflies are beetles and in many aspects resemble other beetles at all stages of their life cycle, undergoing complete metamorphosis. A few days after mating, a female lays her fertilized eggs on or just below the surface of the ground. The eggs hatch three to four weeks later. In certain firefly species with aquatic larvae, such as Aquatica leii, the female oviposits on emergent portions of aquatic plants, and the larvae descend into the water after hatching.The larvae feed until the end of the summer. Most fireflies hibernate as larvae. Some do this by burrowing underground, while others find places on or under the bark of trees. They emerge in the spring. At least one species, Ellychnia corrusca, overwinters as an adult. The larvae of most species are specialized predators and feed on other larvae, terrestrial snails, and slugs. Some are so specialized that they have grooved mandibles that deliver digestive fluids directly to their prey. The larval stage lasts from several weeks up to, in certain species, two or more years. The larvae pupate for one to two and a half weeks and emerge as adults.Adult diet varies among firefly species: some are predatory, while others feed on plant pollen or nectar. Some adults, like the European glow-worm, have no mouth, emerging only to mate and lay eggs before dying. In most species, adults live for a few weeks in summer.Fireflies vary widely in their general appearance, with differences in color, shape, size, and features such as antennae. Adults differ in size depending on the species, with the largest up to 25 mm (1 in) long. Many species have non-flying larviform females. These can often be distinguished from the larvae only because the adult females have compound eyes, unlike the simple eyes of larvae, though the females have much smaller (and often highly regressed) eyes than those of their males. The most commonly known fireflies are nocturnal, although numerous species are diurnal and usually not luminescent; however, some species that remain in shadowy areas may produce light.Most fireflies are distasteful to vertebrate predators, as they contain the steroid pyrones lucibufagins, similar to the cardiotonic bufadienolides found in some poisonous toads. All fireflies glow as larvae, where bioluminescence is an honest aposematic warning signal to predators.

Light and chemical production
Light production in fireflies is due to the chemical process of bioluminescence. This occurs in specialized light-emitting organs, usually on a female firefly's lower abdomen. The enzyme luciferase acts on luciferin, in the presence of magnesium ions, ATP, and oxygen to produce light. Oxygen is supplied via an abdominal trachea or breathing tube. Gene coding for these substances has been inserted into many different organisms. Firefly luciferase is used in forensics, and the enzyme has medical uses – in particular, for detecting the presence of ATP or magnesium. Fireflies produce a "cold light", with no infrared or ultraviolet frequencies. The light may be yellow, green, or pale red, with wavelengths from 510 to 670 nanometers. Some species such as the dimly glowing "blue ghost" of the Eastern US may seem to emit blueish-white light from a distance and in low light conditions, but their glow is bright green when observed up close. Their perceived blue tint may be due to the Purkinje effect.Adults emit light primarily for mate selection. Early larval bioluminescence was adopted in the phylogeny of adult fireflies, and was repeatedly gained and lost before becoming fixed and retained as a mechanism of sexual communication in many species. Adult lampyrids have a variety of ways to communicate with mates in courtships: steady glows, flashing, and the use of chemical signals unrelated to photic systems. Chemical signals, or pheromones, are the ancestral form of sexual communication; this pre-dates the evolution of flash signaling in the lineage, and is retained today in diurnally-active species. Some species, especially lightning bugs of the genera Photinus, Photuris, and Pyractomena, are distinguished by the unique courtship flash patterns emitted by flying males in search of females. In general, females of the genus Photinus do not fly, but do give a flash response to males of their own species. Signals, whether photic or chemical, allow fireflies to identify mates of their own species. Flash signaling characteristics include differences in duration, timing, color, number and rate of repetitions, height of flight, and direction of flight (e.g. climbing or diving) and vary interspecifically and geographically. When flash signals are not sufficiently distinguished between species in a population, sexual selection encourages divergence of signaling patterns.Synchronization of flashing occurs in several species; it is explained as phase synchronization and spontaneous order. Tropical fireflies routinely synchronise their flashes among large groups, particularly in Southeast Asia. At night along river banks in the Malaysian jungles, fireflies synchronize their light emissions precisely. Current hypotheses about the causes of this behavior involve diet, social interaction, and altitude. In the Philippines, thousands of fireflies can be seen all year-round in the town of Donsol. In the United States, one of the most famous sightings of fireflies blinking in unison occurs annually near Elkmont, Tennessee, in the Great Smoky Mountains during the first weeks of June. Congaree National Park in South Carolina is another host to this phenomenon.Female "femme fatale" Photuris fireflies mimic the photic signaling patterns of the smaller Photinus, attracting males to what appears to be a suitable mate, then eating them. This provides the females with a supply of the toxic defensive lucibufagin chemicals.Many fireflies do not produce light. Usually these species are diurnal, or day-flying, such as those in the genus Ellychnia. A few diurnal fireflies that inhabit primarily shadowy places, such as beneath tall plants or trees, are luminescent. One such genus is Lucidota.
Non-bioluminescent fireflies use pheromones to signal mates. This is supported by the fact that some basal groups do not show bioluminescence and use chemical signaling, instead. Phosphaenus hemipterus has photic organs, yet is a diurnal firefly and displays large antennae and small eyes. These traits strongly suggest pheromones are used for sexual selection, while photic organs are used for warning signals. In controlled experiments, males coming from downwind arrived at females first, indicating that males travel upwind along a pheromone plume. Males can find females without the use of visual cues, so sexual communication in P. hemipterus appears to be mediated entirely by pheromones.

Evolution
Fossil history
The oldest known fossil of the Lampyridae family is Protoluciola from the Late Cretaceous (Cenomanian ~ 99 million years ago) Burmese amber of Myanmar, which belongs to the subfamily Luciolinae. The light producing organ is clearly present. The ancestral glow colour for the last common ancestor of all living fireflies has been inferred to be green, based on genomic analysis.

Taxonomy
The fireflies (including the lightning bugs) are a family, Lampyridae, of some 2,000 species within the Coleoptera. The family forms a single clade, a natural phylogenetic group. The term glowworm is used for both adults and larvae of firefly species such as Lampyris noctiluca, the common European glowworm, in which only the nonflying adult females glow brightly; the flying males glow weakly and intermittently. In the Americas, "glow worms" are the closely related Coleopteran family Phengodidae, while in New Zealand and Australia, a "glow worm" is a luminescent larva of the fungus gnat Arachnocampa, within the true flies, Diptera.

Phylogeny
The phylogeny of the Lampyridae family, based on both phylogenetic and morphological evidence by Martin et al. 2019, is:

Interaction with humans
Conservation
Firefly populations are thought to be declining worldwide. While monitoring data for many regions are scarce, a growing number of anecdotal reports, coupled with several published studies from Europe and Asia, suggest that fireflies are in trouble. Recent IUCN Red List assessments for North American fireflies have identified species with heightened extinction risk in the US, with 18 taxa categorized as threatened with extinction.Fireflies face threats including habitat loss and degradation, light pollution, pesticide use, poor water quality, invasive species, over-collection, and climate change. Firefly tourism, a quickly growing sector of the travel and tourism industry, has also been identified as a potential threat to fireflies and their habitats when not managed appropriately. Like many other organisms, fireflies are directly affected by land-use change (e.g., loss of habitat area and connectivity), which is identified as the main driver of biodiversity changes in terrestrial ecosystems. Pesticides, including insecticides and herbicides, have also been indicated as a likely cause of firefly decline. These chemicals can not only harm fireflies directly but also potentially reduce prey populations and degrade habitat. Light pollution is an especially concerning threat to fireflies. Since the majority of firefly species utilize bioluminescent courtship signals, they are also very sensitive to environmental levels of light and consequently to light pollution. A growing number of studies investigating the effects of artificial light at night on fireflies has shown that light pollution can disrupt fireflies' courtship signals and even interfere with larval dispersal. Researchers agree that protecting and enhancing firefly habitat is necessary to conserve their populations. Recommendations include reducing or limiting artificial light at night, restoring habitats where threatened species occur, and eliminating unnecessary pesticide use, among many others.Sundarbans Firefly Sanctuary in Bangladesh was established in 2019.

In culture
Fireflies have featured in human culture around the world for centuries. In Japan, the emergence of fireflies (Japanese: hotaru) signifies the anticipated changing of the seasons; firefly viewing is a special aesthetic pleasure of midsummer, celebrated in parks that exist for that one purpose. The Japanese sword called Hotarumaru, made in the 14th century, is so named for a legend that one night its flaws were repaired by fireflies.In Italy, the firefly (Italian: lucciola) appears in Canto XXVI of Dante's Inferno, written in the 14th century:

As many as the fireflies which the peasant sees in the [Tuscan] valley below, when he is resting on the hill—in the season [midsummer] when the sun hides least from us, and at the time of day [dusk] when the fly gives place to the mosquito—perhaps in the fields where he tills the ground and gathers in the grapes; with that many flames the eighth ditch [of Hell] was shining, ...
In Western culture, fireflies with their transiently appearing and disappearing lights are associated with "such distinct and even contradictory significances as childhood, crop, doom, elves, fear, habitat change, idyll, love, luck, mortality, prostitution, solstice, stars and fleetingness of words and cognition". The firefly was one of only about 12 kinds of beetle known in classical antiquity; Pliny the Elder advised sowing millet and harvesting barley at the moment when the glow-worms appeared.

References
Sources
Gullan, P. J.; Cranston, P. S. (2014). The Insects: An Outline of Entomology (5th ed.). John Wiley & Sons.

Further reading
Faust, Lynn Frierson (2017). "Fireflies, Glow-worms, and Lightning Bugs"
Lewis, S. M.; Cratsley, C. K. (2008). "Flash signal evolution, mate choice, and predation in fireflies". Annual Review of Entomology. 53: 293–321. doi:10.1146/annurev.ento.53.103106.093346. PMID 17877452. S2CID 16360536.
Lewis, Sara (2016). Silent Sparks: The Wondrous World of Fireflies. Princeton University Press. ISBN 978-1400880317.
Stous, Hollend (1997). "A review of predation in Photuris, and its effects on the evolution of flash signaling in other New World fireflies".

External links

An introduction to European fireflies and glow-worms
Firefly.org – Firefly & Lightning Bug Facts, Pictures, Information About Firefly Insect Disappearance
Firefly simulating robot, China
NCBI taxonomy database
Museum of Science, Boston – Understanding Fireflies
Video of a firefly larva in Austria
FireflyExperience.org – Luminous Photography and Videos of Fireflies & Lightning Bugs