/* ============================================================
   forms.css — Formularios con mapa y gestión de fotos
   Usado en: publicar.php, editar_publicacion.php, detalle.php
   ============================================================ */

/* ---- Mapa embebido ---- */
#mapa,
#mapa-edit {
    height: 300px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
}

#mapa-edit {
    height: 250px;
    margin-bottom: 20px;
}

#mapa-detalle {
    height: 300px;
    width: 100%;
    border-radius: 15px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* ---- Zona de fotos (drag & drop) ---- */
#lista-fotos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    min-height: 110px;
    border: 2px dashed #bbb;
    padding: 10px;
    border-radius: 10px;
    background: #fff;
}

.foto-item {
    width: 100px;
    height: 100px;
    position: relative;
    cursor: grab;
}

.foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Primera foto = portada/principal */
.foto-item:first-child img {
    border-color: #007bff;
    border-width: 3px;
}

.foto-item:first-child::after {
    content: "PRINCIPAL";
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    font-size: 9px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    font-weight: bold;
}

/* En la edición se llama PORTADA */
.foto-item.portada:first-child::after {
    content: "PORTADA";
}

.btn-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4d;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ---- Carrusel de detalle ---- */
.carousel-item img {
    object-fit: cover;
    height: 400px;
    width: 100%;
}

.carousel {
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.fixed-bottom-bar {
    z-index: 1030;
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 15px;
}

/* ---- Mapa comunidad ---- */
#mapa-general {
    height: calc(100vh - 56px);
    width: 100%;
}

.iw-content {
    text-align: center;
    max-width: 150px;
}

.iw-foto {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin-bottom: 8px;
}

.iw-nombre {
    font-weight: bold;
    font-size: 1.1em;
    color: black;
    display: block;
}

.iw-especie {
    text-transform: capitalize;
    color: #666;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}